print p.idxnames
assert(len(p) == total)
for pe, e in p, git.idxmerge(inp, final_progress=False):
- assert(i == pi.next())
+ pin = pi.next()
+ assert(i == pin)
assert(p.exists(i))
return total, outfilename
url_match = re.match(
'%s(?:%s%s)?%s' % (protocol, host, port, path), remote, re.I)
if url_match:
- assert(url_match.group(1) in ('ssh', 'bup', 'file'))
+ if not url_match.group(1) in ('ssh', 'bup', 'file'):
+ raise ClientError, 'unexpected protocol: %s' % url_match.group(1)
return url_match.group(1,3,4,5)
else:
rs = remote.split(':', 1)
if not self.p or self.p.poll() != None:
self._restart()
assert(self.p)
- assert(self.p.poll() == None)
+ poll_result = self.p.poll()
+ assert(poll_result == None)
if self.inprogress:
log('_fast_get: opening %r while %r is open\n'
% (id, self.inprogress))
yield type
for blob in it:
yield blob
- assert(self.p.stdout.readline() == '\n')
+ readline_result = self.p.stdout.readline()
+ assert(readline_result == '\n')
self.inprogress = None
except Exception, e:
it.abort()
full_path_to_name). Path must start with '/'.
Example:
'/home/foo' -> [('', '/'), ('home', '/home'), ('foo', '/home/foo')]"""
- assert(path.startswith('/'))
+ if not path.startswith('/'):
+ raise Exception, 'path must start with "/": %s' % path
# Since we assume path startswith('/'), we can skip the first element.
result = [('', '/')]
norm_path = os.path.abspath(path)
try:
client.parse_remote('http://asdf.com/bup')
WVFAIL()
- except AssertionError:
+ except client.ClientError:
WVPASS()