diff mercurial/commands.py @ 24189:8b4b9ee6001a

log: make -fr show complete history from the given revs Right now it's very obtuse to show the history of a particular rev (hg log -r 'reverse(::foo)'). This changes the -f option to make it follow history for the revs specified by -r. The current -f -r behavior is to limit the result of -r to only the commits that are ancestors of the current working copy. Changing this is a bit of a BC break, but the old behavior is A) rare, B) easy to emulate (& ::.), and C) currently undefined. The new behavior is frequently requested enough that I think the change is worth it.
author Durham Goode <durham@fb.com>
date Fri, 06 Feb 2015 11:04:55 -0800
parents 9cb1f82a2571
children 8fe5fc8d7b8e
line wrap: on
line diff
--- a/mercurial/commands.py	Tue Feb 24 14:12:13 2015 +0100
+++ b/mercurial/commands.py	Fri Feb 06 11:04:55 2015 -0800
@@ -4478,6 +4478,10 @@
     Returns 0 on success.
 
     """
+    if opts.get('follow') and opts.get('rev'):
+        opts['rev'] = [revset.formatspec('reverse(::%lr)', opts.get('rev'))]
+        del opts['follow']
+
     if opts.get('graph'):
         return cmdutil.graphlog(ui, repo, *pats, **opts)