Patchwork localrepo: changed revs to use spanset instead of baseset

login
register
mail settings
Submitter Lucas Moscovicz
Date March 6, 2014, 1:43 a.m.
Message ID <fbaab934596fc4e38541.1394070212@dev1037.prn2.facebook.com>
Download mbox | patch
Permalink /patch/3869/
State Accepted
Commit a4d587c6e3dd142cd1a8d5713e161aca28e3f825
Headers show

Comments

Lucas Moscovicz - March 6, 2014, 1:43 a.m.
# HG changeset patch
# User Lucas Moscovicz <lmoscovicz@fb.com>
# Date 1394070125 28800
#      Wed Mar 05 17:42:05 2014 -0800
# Node ID fbaab934596fc4e38541b5f0d7e66f206117a5d1
# Parent  b9f916935250e1f81c0994b8b8804d01bc325f83
localrepo: changed revs to use spanset instead of baseset

Performance benchmarking:

$ time hg log -qf -l1
...

real  0m1.420s
user  0m1.249s
sys 0m0.167s

$ time ~/local/hg/hg log -qf -l1
...

real  0m0.719s
user  0m0.614s
sys 0m0.103s
Augie Fackler - March 6, 2014, 3:38 p.m.
On Wed, Mar 05, 2014 at 05:43:32PM -0800, Lucas Moscovicz wrote:
> # HG changeset patch
> # User Lucas Moscovicz <lmoscovicz@fb.com>
> # Date 1394070125 28800
> #      Wed Mar 05 17:42:05 2014 -0800
> # Node ID fbaab934596fc4e38541b5f0d7e66f206117a5d1
> # Parent  b9f916935250e1f81c0994b8b8804d01bc325f83
> localrepo: changed revs to use spanset instead of baseset


Looks simple and safe enough, queued.

>
> Performance benchmarking:
>
> $ time hg log -qf -l1
> ...
>
> real  0m1.420s
> user  0m1.249s
> sys 0m0.167s
>
> $ time ~/local/hg/hg log -qf -l1
> ...
>
> real  0m0.719s
> user  0m0.614s
> sys 0m0.103s
>
> diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
> --- a/mercurial/localrepo.py
> +++ b/mercurial/localrepo.py
> @@ -428,7 +428,7 @@
>          '''Return a list of revisions matching the given revset'''
>          expr = revset.formatspec(expr, *args)
>          m = revset.match(None, expr)
> -        return revset.baseset([r for r in m(self, revset.baseset(self))])
> +        return m(self, revset.spanset(self))
>
>      def set(self, expr, *args):
>          '''
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -428,7 +428,7 @@ 
         '''Return a list of revisions matching the given revset'''
         expr = revset.formatspec(expr, *args)
         m = revset.match(None, expr)
-        return revset.baseset([r for r in m(self, revset.baseset(self))])
+        return m(self, revset.spanset(self))
 
     def set(self, expr, *args):
         '''