Patchwork [4,of,4,lazy-manifest] context: don't sort manifest entries

login
register
mail settings
Submitter Augie Fackler
Date Jan. 8, 2015, 8:35 p.m.
Message ID <1bb05f6482bc53f6f1ca.1420749301@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/7388/
State Superseded
Commit 8ec2df32bd39aa74d77d6b094b7c15ba5236ed81
Headers show

Comments

Augie Fackler - Jan. 8, 2015, 8:35 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1416200425 18000
#      Mon Nov 17 00:00:25 2014 -0500
# Node ID 1bb05f6482bc53f6f1ca5851bd9238ef1570c156
# Parent  07da98fd38a1269c899b3c81fbe23dbc807511d0
context: don't sort manifest entries

The manifest iterator is now pre-sorted, so we can skip this check.
Gregory Szorc - Jan. 9, 2015, 9:11 a.m.
> On Jan 8, 2015, at 12:35, Augie Fackler <raf@durin42.com> wrote:
> 
> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # Date 1416200425 18000
> #      Mon Nov 17 00:00:25 2014 -0500
> # Node ID 1bb05f6482bc53f6f1ca5851bd9238ef1570c156
> # Parent  07da98fd38a1269c899b3c81fbe23dbc807511d0
> context: don't sort manifest entries
> 
> The manifest iterator is now pre-sorted, so we can skip this check.
> 
> diff --git a/mercurial/context.py b/mercurial/context.py
> --- a/mercurial/context.py
> +++ b/mercurial/context.py
> @@ -101,8 +101,7 @@ class basectx(object):
>         return self.filectx(key)
> 
>     def __iter__(self):
> -        for f in sorted(self._manifest):
> -            yield f
> +        return (f for f in self._manifest)

return iter(self_manifest)

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -101,8 +101,7 @@  class basectx(object):
         return self.filectx(key)
 
     def __iter__(self):
-        for f in sorted(self._manifest):
-            yield f
+        return (f for f in self._manifest)
 
     def _manifestmatches(self, match, s):
         """generate a new manifest filtered by the match argument