comparison mercurial/commands.py @ 4273:8185a1ca8628

tags: require -f to replace an existing tag based on a patch from Johan Herland <johherla@online.no>
author Matt Mackall <mpm@selenic.com>
date Fri, 23 Mar 2007 00:12:28 -0500
parents 89075f106414
children f38f90a177dc bc6f5a1d8b7b
comparison
equal deleted inserted replaced
4272:fe7f38dda34b 4273:8185a1ca8628
2461 message = opts['message'] 2461 message = opts['message']
2462 if opts['remove']: 2462 if opts['remove']:
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'))
2469 r = repo.changectx(rev_).node() 2472 r = repo.changectx(rev_).node()
2470 2473
2953 ('', 'rev', [], _('show difference from revision')), 2956 ('', 'rev', [], _('show difference from revision')),
2954 ] + walkopts, 2957 ] + walkopts,
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')),
2962 ('r', 'rev', '', _('revision to tag')), 2966 ('r', 'rev', '', _('revision to tag')),
2963 ('', 'remove', None, _('remove a tag'))], 2967 ('', 'remove', None, _('remove a tag'))],