[PATCH 2 of 5 V3] store: move top file walk to a separate function
Durham Goode
durham at fb.com
Wed May 8 18:24:17 CDT 2013
# HG changeset patch
# User Durham Goode <durham at fb.com>
# Date 1368048120 25200
# Wed May 08 14:22:00 2013 -0700
# Node ID bb46f7711dad7512cdde723db5030540df1142c7
# Parent 517845b6057f5f64c3085e29a33f7da8a3c84774
store: move top file walk to a separate function
Some extensions find it useful to be able to walk the non-data files in the
repo, so I'm moving that part of the walk to a separate function.
In particular, this allows an extension to interact with only the non-filelog
store data (for instance, when cloning everything but filelogs).
diff --git a/mercurial/store.py b/mercurial/store.py
--- a/mercurial/store.py
+++ b/mercurial/store.py
@@ -322,13 +322,16 @@
def datafiles(self):
return self._walk('data', True)
+ def topfiles(self):
+ # yield manifest before changelog
+ return reversed(self._walk('', False))
+
def walk(self):
'''yields (unencoded, encoded, size)'''
# yield data files first
for x in self.datafiles():
yield x
- # yield manifest before changelog
- for x in reversed(self._walk('', False)):
+ for x in self.topfiles():
yield x
def copylist(self):
More information about the Mercurial-devel
mailing list