Mercurial > public > mercurial-scm > hg-stable
comparison 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 |
comparison
equal
deleted
inserted
replaced
2966:fb493241d7f6 | 2967:eef469259745 |
---|---|
2592 if opts['rev']: | 2592 if opts['rev']: |
2593 raise util.Abort(_("use only one form to specify the revision")) | 2593 raise util.Abort(_("use only one form to specify the revision")) |
2594 if opts['rev']: | 2594 if opts['rev']: |
2595 rev_ = opts['rev'] | 2595 rev_ = opts['rev'] |
2596 if rev_: | 2596 if rev_: |
2597 r = hex(repo.lookup(rev_)) | 2597 r = repo.lookup(rev_) |
2598 else: | 2598 else: |
2599 p1, p2 = repo.dirstate.parents() | 2599 p1, p2 = repo.dirstate.parents() |
2600 if p1 == nullid: | 2600 if p1 == nullid: |
2601 raise util.Abort(_('no revision to tag')) | 2601 raise util.Abort(_('no revision to tag')) |
2602 if p2 != nullid: | 2602 if p2 != nullid: |
2603 raise util.Abort(_('outstanding uncommitted merges')) | 2603 raise util.Abort(_('outstanding uncommitted merges')) |
2604 r = hex(p1) | 2604 r = p1 |
2605 | 2605 |
2606 repo.tag(name, r, opts['local'], opts['message'], opts['user'], | 2606 message = opts['message'] |
2607 opts['date']) | 2607 if not message: |
2608 message = _('Added tag %s for changeset %s') % (name, short(r)) | |
2609 | |
2610 repo.tag(name, r, message, opts['local'], opts['user'], opts['date']) | |
2608 | 2611 |
2609 def tags(ui, repo): | 2612 def tags(ui, repo): |
2610 """list repository tags | 2613 """list repository tags |
2611 | 2614 |
2612 List the repository tags. | 2615 List the repository tags. |