comparison mercurial/streamclone.py @ 7640:7197812e8d44

error: move lock errors rename LockException to LockError
author Matt Mackall <mpm@selenic.com>
date Mon, 12 Jan 2009 11:09:14 -0600
parents 810ca383da9c
children 496ae1ea4698
comparison
equal deleted inserted replaced
7639:ae7a614a6a57 7640:7197812e8d44
3 # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com> 3 # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com>
4 # 4 #
5 # This software may be used and distributed according to the terms 5 # This software may be used and distributed according to the terms
6 # of the GNU General Public License, incorporated herein by reference. 6 # of the GNU General Public License, incorporated herein by reference.
7 7
8 import util, lock 8 import util, error
9 from i18n import _ 9 from i18n import _
10 10
11 class StreamException(Exception): 11 class StreamException(Exception):
12 def __init__(self, code): 12 def __init__(self, code):
13 Exception.__init__(self) 13 Exception.__init__(self)
49 for name, ename, size in repo.store.walk(): 49 for name, ename, size in repo.store.walk():
50 entries.append((name, size)) 50 entries.append((name, size))
51 total_bytes += size 51 total_bytes += size
52 finally: 52 finally:
53 del l 53 del l
54 except (lock.LockHeld, lock.LockUnavailable): 54 except error.LockError:
55 raise StreamException(2) 55 raise StreamException(2)
56 56
57 yield '0\n' 57 yield '0\n'
58 repo.ui.debug(_('%d files, %d bytes to transfer\n') % 58 repo.ui.debug(_('%d files, %d bytes to transfer\n') %
59 (len(entries), total_bytes)) 59 (len(entries), total_bytes))