Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commands.py @ 3172:5c93dd0ae413
Refactor annotate copy support.
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Wed, 27 Sep 2006 09:10:21 -0700 |
parents | e43fd1623fe1 |
children | 3637d5d17cbc |
line wrap: on
line diff
--- a/mercurial/commands.py Wed Sep 27 09:35:53 2006 +0200 +++ b/mercurial/commands.py Wed Sep 27 09:10:21 2006 -0700 @@ -612,8 +612,9 @@ opmap = [['user', lambda x: ui.shortuser(x.user())], ['number', lambda x: str(x.rev())], ['changeset', lambda x: short(x.node())], - ['date', getdate]] - if not opts['user'] and not opts['changeset'] and not opts['date']: + ['date', getdate], ['follow', lambda x: x.path()]] + if (not opts['user'] and not opts['changeset'] and not opts['date'] + and not opts['follow']): opts['number'] = 1 ctx = repo.changectx(opts['rev']) @@ -625,7 +626,7 @@ ui.write(_("%s: binary file\n") % ((pats and rel) or abs)) continue - lines = fctx.annotate() + lines = fctx.annotate(follow=opts.get('follow')) pieces = [] for o, f in opmap: @@ -2671,6 +2672,7 @@ "^annotate": (annotate, [('r', 'rev', '', _('annotate the specified revision')), + ('f', 'follow', None, _('follow file copies and renames')), ('a', 'text', None, _('treat all files as text')), ('u', 'user', None, _('list the author')), ('d', 'date', None, _('list the date')),