Mercurial > hg
diff mercurial/streamclone.py @ 6901:43a817f3a649
streamclone: fold in localrepo.storefiles
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 13 Aug 2008 20:18:44 -0500 |
parents | 80e51429cb9a |
children | 87abfefafe02 |
line wrap: on
line diff
--- 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')