# HG changeset patch # User Benoit Boissinot # Date 1135709530 21600 # Node ID 41366b7d67093f9221d1347a11f38b010ec2f374 # Parent dca956c9767d6b6814a7b5fb6cdb005cc7511133 fix 'hg tag - fix a collision with the option keyword rev and the option name - update the tests diff -r dca956c9767d -r 41366b7d6709 mercurial/commands.py --- a/mercurial/commands.py Thu Dec 22 13:18:44 2005 -0600 +++ b/mercurial/commands.py Tue Dec 27 12:52:10 2005 -0600 @@ -2019,7 +2019,7 @@ for f in changes: ui.write(format % f) -def tag(ui, repo, name, rev=None, **opts): +def tag(ui, repo, name, rev_=None, **opts): """add a tag for the current tip or a given revision Name a particular revision using . @@ -2037,10 +2037,10 @@ """ if name == "tip": raise util.Abort(_("the name 'tip' is reserved")) - if 'rev' in opts: - rev = opts['rev'] - if rev: - r = hex(repo.lookup(rev)) + if opts['rev']: + rev_ = opts['rev'] + if rev_: + r = hex(repo.lookup(rev_)) else: r = hex(repo.changelog.tip()) diff -r dca956c9767d -r 41366b7d6709 tests/test-tag --- a/tests/test-tag Thu Dec 22 13:18:44 2005 -0600 +++ b/tests/test-tag Tue Dec 27 12:52:10 2005 -0600 @@ -11,6 +11,13 @@ echo foo >> .hgtags hg tag -d "0 0" "bleah2" || echo "failed" +hg revert .hgtags +hg tag -d "0 0" -r 0 "bleah0" +hg tag -l -d "0 0" "bleah1" 1 + +cat .hgtags +cat .hg/localtags + hg tag -l 'xx newline' hg tag -l 'xx:xx' diff -r dca956c9767d -r 41366b7d6709 tests/test-tag.out --- a/tests/test-tag.out Thu Dec 22 13:18:44 2005 -0600 +++ b/tests/test-tag.out Tue Dec 27 12:52:10 2005 -0600 @@ -18,5 +18,8 @@ abort: working copy of .hgtags is changed (please commit .hgtags manually) failed +acb14030fe0a21b60322c440ad2d20cf7685a376 bleah +acb14030fe0a21b60322c440ad2d20cf7685a376 bleah0 +863197ef03781c4fc00276d83eb66c4cb9cd91df bleah1 abort: '\n' cannot be used in a tag name abort: ':' cannot be used in a tag name