# HG changeset patch # User Thomas Arendsen Hein # Date 2010-03-03 21:04:59 # Node ID f142fa3c0a8c555109cec4ee6475bc1aa5d52fc5 # Parent d5bd1beff794461611bb37999a79bd110c88d008 Make annotate --follow an alias for -f/--file to behave like in older versions Since 98a0421b9e52 annotate follows copies/renames by default, but the output of e.g. "annotate --follow --number" should not change without some deprecation time. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -99,6 +99,11 @@ def annotate(ui, repo, *pats, **opts): anyway, although the results will probably be neither useful nor desirable. """ + if opts.get('follow'): + # --follow is deprecated and now just an alias for -f/--file + # to mimic the behavior of Mercurial before version 1.5 + opts['file'] = 1 + datefunc = ui.quiet and util.shortdate or util.datestr getdate = util.cachefunc(lambda x: datefunc(x[0].date())) @@ -3422,7 +3427,8 @@ table = { "^annotate|blame": (annotate, [('r', 'rev', '', _('annotate the specified revision')), - ('', 'follow', None, _('follow copies and renames (DEPRECATED)')), + ('', 'follow', None, + _('follow copies/renames and list the filename (DEPRECATED)')), ('', 'no-follow', None, _("don't follow copies and renames")), ('a', 'text', None, _('treat all files as text')), ('u', 'user', None, _('list the author (long with -v)')), diff --git a/tests/test-annotate.out b/tests/test-annotate.out --- a/tests/test-annotate.out +++ b/tests/test-annotate.out @@ -102,4 +102,4 @@ 1:2: a 1:3: a % generate ABA rename configuration % annotate after ABA with follow -8: foo +foo: foo