##// END OF EJS Templates
tags: require -f to replace an existing tag...
Matt Mackall -
r4267:8185a1ca default
parent child Browse files
Show More
@@ -2463,6 +2463,9 b' def tag(ui, repo, name, rev_=None, **opt'
2463 rev_ = nullid
2463 rev_ = nullid
2464 if not message:
2464 if not message:
2465 message = _('Removed tag %s') % name
2465 message = _('Removed tag %s') % name
2466 elif name in repo.tags() and not opts['force']:
2467 raise util.Abort(_('a tag named %s already exists (use -f to force)')
2468 % name)
2466 if not rev_ and repo.dirstate.parents()[1] != nullid:
2469 if not rev_ and repo.dirstate.parents()[1] != nullid:
2467 raise util.Abort(_('uncommitted merge - please provide a '
2470 raise util.Abort(_('uncommitted merge - please provide a '
2468 'specific revision'))
2471 'specific revision'))
@@ -2955,7 +2958,8 b' table = {'
2955 _('hg status [OPTION]... [FILE]...')),
2958 _('hg status [OPTION]... [FILE]...')),
2956 "tag":
2959 "tag":
2957 (tag,
2960 (tag,
2958 [('l', 'local', None, _('make the tag local')),
2961 [('f', 'force', None, _('replace existing tag')),
2962 ('l', 'local', None, _('make the tag local')),
2959 ('m', 'message', '', _('message for tag commit log entry')),
2963 ('m', 'message', '', _('message for tag commit log entry')),
2960 ('d', 'date', '', _('record datecode as commit date')),
2964 ('d', 'date', '', _('record datecode as commit date')),
2961 ('u', 'user', '', _('record user as commiter')),
2965 ('u', 'user', '', _('record user as commiter')),
@@ -74,7 +74,7 b" hg tag -d '1000000 0' bar #"
74 echo >> foo
74 echo >> foo
75 hg ci -m 'change foo 1' -d '1000000 0' # rev 2
75 hg ci -m 'change foo 1' -d '1000000 0' # rev 2
76 hg up -C 1
76 hg up -C 1
77 hg tag -r 1 -d '1000000 0' bar # rev 3
77 hg tag -r 1 -d '1000000 0' -f bar # rev 3
78 hg up -C 1
78 hg up -C 1
79 echo >> foo
79 echo >> foo
80 hg ci -m 'change foo 2' -d '1000000 0' # rev 4
80 hg ci -m 'change foo 2' -d '1000000 0' # rev 4
@@ -91,14 +91,17 b' hg init t3'
91 cd t3
91 cd t3
92 echo foo > foo
92 echo foo > foo
93 hg add foo
93 hg add foo
94 hg ci -m 'add foo' -d '1000000 0' # rev 0
94 hg ci -m 'add foo' -d '1000000 0' # rev 0
95 hg tag -d '1000000 0' bar # rev 1 bar -> 0
95 hg tag -d '1000000 0' -f bar # rev 1 bar -> 0
96 hg tag -d '1000000 0' bar # rev 2 bar -> 1
96 hg tag -d '1000000 0' -f bar # rev 2 bar -> 1
97 hg tag -d '1000000 0' -r 0 bar # rev 3 bar -> 0
97 hg tag -d '1000000 0' -fr 0 bar # rev 3 bar -> 0
98 hg tag -d '1000000 0' -r 1 bar # rev 3 bar -> 1
98 hg tag -d '1000000 0' -fr 1 bar # rev 3 bar -> 1
99 hg tag -d '1000000 0' -r 0 bar # rev 4 bar -> 0
99 hg tag -d '1000000 0' -fr 0 bar # rev 4 bar -> 0
100 hg tags
100 hg tags
101 hg co 3
101 hg co 3
102 echo barbar > foo
102 echo barbar > foo
103 hg ci -m 'change foo' -d '1000000 0' # rev 0
103 hg ci -m 'change foo' -d '1000000 0' # rev 0
104 hg tags
104 hg tags
105
106 hg tag -d '1000000 0' -r 3 bar # should complain
107 hg tags No newline at end of file
@@ -54,3 +54,6 b' bar 0:b40'
54 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
54 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
55 tip 6:b5ff9d142648
55 tip 6:b5ff9d142648
56 bar 0:b409d9da318e
56 bar 0:b409d9da318e
57 abort: a tag named bar already exists (use -f to force)
58 tip 6:b5ff9d142648
59 bar 0:b409d9da318e
General Comments 0
You need to be logged in to leave comments. Login now