Patchwork log: allow revset for --follow to be lazily evaluated

login
register
mail settings
Submitter Siddharth Agarwal
Date July 13, 2014, 3:49 a.m.
Message ID <2925ebabeb5d09641336.1405223394@dev1738.prn1.facebook.com>
Download mbox | patch
Permalink /patch/5158/
State Accepted
Commit abae1eb695c077fa21b6ef0b7056f36d63cf0302
Headers show

Comments

Siddharth Agarwal - July 13, 2014, 3:49 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@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.
Matt Mackall - July 14, 2014, 11:28 p.m.
On Sat, 2014-07-12 at 20:49 -0700, Siddharth Agarwal wrote:
> # HG changeset patch
> # User Siddharth Agarwal <sid0@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.

Probably left-overs from before switching to the new log code. Queued
for default, thanks.

Patch

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()