[PATCH] log: allow revset for --follow to be lazily evaluated

Siddharth Agarwal sid0 at fb.com
Sat Jul 12 22:49:54 CDT 2014


# HG changeset patch
# User Siddharth Agarwal <sid0 at fb.com>
# Date 1405223040 25200
#      Sat Jul 12 20:44:00 2014 -0700
# Node ID 2925ebabeb5d09641336f3b42a4cb4240d7f48c5
# Parent  e6c10ed302aaba92013aae7c4d6ca7d855851978
log: allow revset for --follow to be lazily evaluated

It is unclear to me why evaluation was forced.

For a repository with over 700,000 commits, 'hg log -f' drops from 1.2 seconds
to 0.2 seconds.

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1720,7 +1720,7 @@
     if opts.get('rev'):
         revs = scmutil.revrange(repo, opts['rev'])
     elif follow:
-        revs = revset.baseset(repo.revs('reverse(:.)'))
+        revs = repo.revs('reverse(:.)')
     else:
         revs = revset.spanset(repo)
         revs.reverse()


More information about the Mercurial-devel mailing list