##// END OF EJS Templates
change 'hg tag' to tag the parent rev instead of tip
Benoit Boissinot -
r2647:46182568 default
parent child Browse files
Show More
@@ -2651,7 +2651,7 b' def tag(ui, repo, name, rev_=None, **opt'
2651 very useful to compare different revision, to go back to significant
2651 very useful to compare different revision, to go back to significant
2652 earlier versions or to mark branch points as releases, etc.
2652 earlier versions or to mark branch points as releases, etc.
2653
2653
2654 If no revision is given, the tip is used.
2654 If no revision is given, the parent of the working directory is used.
2655
2655
2656 To facilitate version control, distribution, and merging of tags,
2656 To facilitate version control, distribution, and merging of tags,
2657 they are stored as a file named ".hgtags" which is managed
2657 they are stored as a file named ".hgtags" which is managed
@@ -2671,7 +2671,12 b' def tag(ui, repo, name, rev_=None, **opt'
2671 if rev_:
2671 if rev_:
2672 r = hex(repo.lookup(rev_))
2672 r = hex(repo.lookup(rev_))
2673 else:
2673 else:
2674 r = hex(repo.changelog.tip())
2674 p1, p2 = repo.dirstate.parents()
2675 if p1 == nullid:
2676 raise util.Abort(_('no revision to tag'))
2677 if p2 != nullid:
2678 raise util.Abort(_('outstanding uncommited merges'))
2679 r = hex(p1)
2675
2680
2676 repo.tag(name, r, opts['local'], opts['message'], opts['user'],
2681 repo.tag(name, r, opts['local'], opts['message'], opts['user'],
2677 opts['date'])
2682 opts['date'])
@@ -19,6 +19,11 b' hg tag -l -d "1000000 0" "bleah1" 1'
19 cat .hgtags
19 cat .hgtags
20 cat .hg/localtags
20 cat .hg/localtags
21
21
22 hg update 0
23 hg tag -d "1000000 0" "foobar"
24 cat .hgtags
25 cat .hg/localtags
26
22 hg tag -l 'xx
27 hg tag -l 'xx
23 newline'
28 newline'
24 hg tag -l 'xx:xx'
29 hg tag -l 'xx:xx'
@@ -25,5 +25,8 b" use of 'hg tag NAME [REV]' is deprecated"
25 0acdaf8983679e0aac16e811534eb49d7ee1f2b4 bleah
25 0acdaf8983679e0aac16e811534eb49d7ee1f2b4 bleah
26 0acdaf8983679e0aac16e811534eb49d7ee1f2b4 bleah0
26 0acdaf8983679e0aac16e811534eb49d7ee1f2b4 bleah0
27 c5c60883086f5526bd3e36814b94a73a4e75e172 bleah1
27 c5c60883086f5526bd3e36814b94a73a4e75e172 bleah1
28 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
29 0acdaf8983679e0aac16e811534eb49d7ee1f2b4 foobar
30 c5c60883086f5526bd3e36814b94a73a4e75e172 bleah1
28 abort: '\n' cannot be used in a tag name
31 abort: '\n' cannot be used in a tag name
29 abort: ':' cannot be used in a tag name
32 abort: ':' cannot be used in a tag name
General Comments 0
You need to be logged in to leave comments. Login now