Make annotate --follow an alias for -f/--file to behave like in older versions stable
authorThomas Arendsen Hein <thomas@intevation.de>
Wed, 03 Mar 2010 22:04:59 +0100
branchstable
changeset 10579 f142fa3c0a8c
parent 10577 d5bd1beff794
child 10580 612c142b7a82
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.
mercurial/commands.py
tests/test-annotate.out
--- a/mercurial/commands.py	Wed Mar 03 14:50:35 2010 +0100
+++ b/mercurial/commands.py	Wed Mar 03 22:04:59 2010 +0100
@@ -99,6 +99,11 @@
     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 @@
     "^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)')),
--- a/tests/test-annotate.out	Wed Mar 03 14:50:35 2010 +0100
+++ b/tests/test-annotate.out	Wed Mar 03 22:04:59 2010 +0100
@@ -102,4 +102,4 @@
 1:3: a
 % generate ABA rename configuration
 % annotate after ABA with follow
-8: foo
+foo: foo