Show More
@@ -2439,14 +2439,20 b' def tag(ui, repo, name, rev_=None, **opt' | |||||
2439 | "please use 'hg tag [-r REV] NAME' instead\n")) |
|
2439 | "please use 'hg tag [-r REV] NAME' instead\n")) | |
2440 | if opts['rev']: |
|
2440 | if opts['rev']: | |
2441 | raise util.Abort(_("use only one form to specify the revision")) |
|
2441 | raise util.Abort(_("use only one form to specify the revision")) | |
|
2442 | if opts['rev'] and opts['remove']: | |||
|
2443 | raise util.Abort(_("--rev and --remove are incompatible")) | |||
2442 | if opts['rev']: |
|
2444 | if opts['rev']: | |
2443 | rev_ = opts['rev'] |
|
2445 | rev_ = opts['rev'] | |
|
2446 | message = opts['message'] | |||
|
2447 | if opts['remove']: | |||
|
2448 | rev_ = nullid | |||
|
2449 | if not message: | |||
|
2450 | message = _('Removed tag %s') % name | |||
2444 | if not rev_ and repo.dirstate.parents()[1] != nullid: |
|
2451 | if not rev_ and repo.dirstate.parents()[1] != nullid: | |
2445 | raise util.Abort(_('uncommitted merge - please provide a ' |
|
2452 | raise util.Abort(_('uncommitted merge - please provide a ' | |
2446 | 'specific revision')) |
|
2453 | 'specific revision')) | |
2447 | r = repo.changectx(rev_).node() |
|
2454 | r = repo.changectx(rev_).node() | |
2448 |
|
2455 | |||
2449 | message = opts['message'] |
|
|||
2450 | if not message: |
|
2456 | if not message: | |
2451 | message = _('Added tag %s for changeset %s') % (name, short(r)) |
|
2457 | message = _('Added tag %s for changeset %s') % (name, short(r)) | |
2452 |
|
2458 | |||
@@ -2935,7 +2941,8 b' table = {' | |||||
2935 | ('m', 'message', '', _('message for tag commit log entry')), |
|
2941 | ('m', 'message', '', _('message for tag commit log entry')), | |
2936 | ('d', 'date', '', _('record datecode as commit date')), |
|
2942 | ('d', 'date', '', _('record datecode as commit date')), | |
2937 | ('u', 'user', '', _('record user as commiter')), |
|
2943 | ('u', 'user', '', _('record user as commiter')), | |
2938 |
('r', 'rev', '', _('revision to tag')) |
|
2944 | ('r', 'rev', '', _('revision to tag')), | |
|
2945 | ('', 'remove', None, _('remove a tag'))], | |||
2939 | _('hg tag [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME')), |
|
2946 | _('hg tag [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME')), | |
2940 | "tags": (tags, [], _('hg tags')), |
|
2947 | "tags": (tags, [], _('hg tags')), | |
2941 | "tip": |
|
2948 | "tip": |
@@ -328,7 +328,8 b' class localrepository(repo.repository):' | |||||
328 | self.tagscache = {} |
|
328 | self.tagscache = {} | |
329 | for k,nh in globaltags.items(): |
|
329 | for k,nh in globaltags.items(): | |
330 | n = nh[0] |
|
330 | n = nh[0] | |
331 | self.tagscache[k] = n |
|
331 | if n != nullid: | |
|
332 | self.tagscache[k] = n | |||
332 | self.tagscache['tip'] = self.changelog.tip() |
|
333 | self.tagscache['tip'] = self.changelog.tip() | |
333 |
|
334 | |||
334 | return self.tagscache |
|
335 | return self.tagscache |
@@ -79,3 +79,7 b' 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 | |
81 | hg tags |
|
81 | hg tags | |
|
82 | ||||
|
83 | hg tag --remove -d '1000000 0' bar | |||
|
84 | hg tip | |||
|
85 | hg tags |
@@ -42,3 +42,10 b' 1 files updated, 0 files merged, 0 files' | |||||
42 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
42 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
43 | tip 4:36195b728445 |
|
43 | tip 4:36195b728445 | |
44 | bar 1:b204a97e6e8d |
|
44 | bar 1:b204a97e6e8d | |
|
45 | changeset: 5:57e1983b4a60 | |||
|
46 | tag: tip | |||
|
47 | user: test | |||
|
48 | date: Mon Jan 12 13:46:40 1970 +0000 | |||
|
49 | summary: Removed tag bar | |||
|
50 | ||||
|
51 | tip 5:57e1983b4a60 |
General Comments 0
You need to be logged in to leave comments.
Login now