mercurial/streamclone.py
changeset 6901 43a817f3a649
parent 6840 80e51429cb9a
child 6925 87abfefafe02
--- a/mercurial/streamclone.py	Wed Aug 13 20:18:43 2008 -0500
+++ b/mercurial/streamclone.py	Wed Aug 13 20:18:44 2008 -0500
@@ -31,8 +31,19 @@
         fileobj.write('1\n')
         return
 
+    entries = []
+    total_bytes = 0
     try:
-        entries, total_bytes = repo.storefiles()
+        l = None
+        try:
+            repo.ui.debug('scanning\n')
+            # get consistent snapshot of repo, lock during scan
+            l = repo.lock()
+            for name, ename, size in repo.store.walk():
+                entries.append((name, size))
+                total_bytes += size
+        finally:
+            del l
     except (lock.LockHeld, lock.LockUnavailable), inst:
         repo.ui.warn('locking the repository failed: %s\n' % (inst,))
         fileobj.write('2\n')