Patchwork [4,of,5,v2] treemanifest: implement iterentries()

login
register
mail settings
Submitter Martin von Zweigbergk
Date Feb. 22, 2016, 7:12 a.m.
Message ID <CAESOdVCqmHo0E=nFX9RS_Y3O-ZfFt21WwcaHR1mvi29rXCVVJQ@mail.gmail.com>
Download mbox | patch
Permalink /patch/13289/
State Accepted
Delegated to: Augie Fackler
Headers show

Comments

Martin von Zweigbergk - Feb. 22, 2016, 7:12 a.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1454908441 28800
#      Sun Feb 07 21:14:01 2016 -0800
# Node ID 6d391c0d22e1363d53f763a9d054dbed4ce2dc08
# Parent  51d5c564702c5bf7ddbebc10a84866245abed7d5
# Available At http://42.netv6.net/martinvonz-wip/mercurial/
#              hg pull http://42.netv6.net/martinvonz-wip/mercurial/
-r 6d391c0d22e1
treemanifest: implement iterentries()

To make tests pass with _treeinmem manually set to True, we need to
implement the recently added iterentries() on the treemanifest class
too.

Patch

diff -r 51d5c564702c -r 6d391c0d22e1 mercurial/manifest.py
--- a/mercurial/manifest.py     Thu Feb 11 15:38:56 2016 -0800
+++ b/mercurial/manifest.py     Sun Feb 07 21:14:01 2016 -0800
@@ -520,6 +520,15 @@ 
         self._node = node
         self._dirty = False

+    def iterentries(self):
+        self._load()
+        for p, n in sorted(self._dirs.items() + self._files.items()):
+            if p in self._files:
+                yield self._subpath(p), n, self._flags.get(p, '')
+            else:
+                for x in n.iterentries():
+                    yield x
+
     def iteritems(self):
         self._load()
         for p, n in sorted(self._dirs.items() + self._files.items()):