diff mercurial/streamclone.py @ 8109:496ae1ea4698

switch lock releasing in the core from gc to explicit
author Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
date Wed, 22 Apr 2009 02:01:22 +0200
parents 7197812e8d44
children 46293a0c7e9f
line wrap: on
line diff
--- a/mercurial/streamclone.py	Wed Apr 22 02:01:22 2009 +0200
+++ b/mercurial/streamclone.py	Wed Apr 22 02:01:22 2009 +0200
@@ -41,16 +41,15 @@
     entries = []
     total_bytes = 0
     try:
-        l = None
+        # get consistent snapshot of repo, lock during scan
+        lock = repo.lock()
         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
+            lock.release()
     except error.LockError:
         raise StreamException(2)