Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commands.py @ 2967:eef469259745
tag: shorten hash in default commit message
Move default message to commands.py
Pass node in binary for consistency
Remove default arguments
Fix up tests
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 20 Aug 2006 23:52:52 -0500 |
parents | fb493241d7f6 |
children | f63667f694de |
line wrap: on
line diff
--- a/mercurial/commands.py Sun Aug 20 22:51:56 2006 -0500 +++ b/mercurial/commands.py Sun Aug 20 23:52:52 2006 -0500 @@ -2594,17 +2594,20 @@ if opts['rev']: rev_ = opts['rev'] if rev_: - r = hex(repo.lookup(rev_)) + r = repo.lookup(rev_) else: p1, p2 = repo.dirstate.parents() if p1 == nullid: raise util.Abort(_('no revision to tag')) if p2 != nullid: raise util.Abort(_('outstanding uncommitted merges')) - r = hex(p1) - - repo.tag(name, r, opts['local'], opts['message'], opts['user'], - opts['date']) + r = p1 + + message = opts['message'] + if not message: + message = _('Added tag %s for changeset %s') % (name, short(r)) + + repo.tag(name, r, message, opts['local'], opts['user'], opts['date']) def tags(ui, repo): """list repository tags