comparison 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
comparison
equal deleted inserted replaced
8108:a26d33749bd8 8109:496ae1ea4698
39 raise StreamException(1) 39 raise StreamException(1)
40 40
41 entries = [] 41 entries = []
42 total_bytes = 0 42 total_bytes = 0
43 try: 43 try:
44 l = None 44 # get consistent snapshot of repo, lock during scan
45 lock = repo.lock()
45 try: 46 try:
46 repo.ui.debug(_('scanning\n')) 47 repo.ui.debug(_('scanning\n'))
47 # get consistent snapshot of repo, lock during scan
48 l = repo.lock()
49 for name, ename, size in repo.store.walk(): 48 for name, ename, size in repo.store.walk():
50 entries.append((name, size)) 49 entries.append((name, size))
51 total_bytes += size 50 total_bytes += size
52 finally: 51 finally:
53 del l 52 lock.release()
54 except error.LockError: 53 except error.LockError:
55 raise StreamException(2) 54 raise StreamException(2)
56 55
57 yield '0\n' 56 yield '0\n'
58 repo.ui.debug(_('%d files, %d bytes to transfer\n') % 57 repo.ui.debug(_('%d files, %d bytes to transfer\n') %