##// END OF EJS Templates
branchmap: make error messages consistent between Python 2 and 3...
Augie Fackler -
r35849:a011e414 default
parent child Browse files
Show More
@@ -18,6 +18,7 b' from .node import ('
18 from . import (
18 from . import (
19 encoding,
19 encoding,
20 error,
20 error,
21 pycompat,
21 scmutil,
22 scmutil,
22 util,
23 util,
23 )
24 )
@@ -52,18 +53,19 b' def read(repo):'
52 filteredhash=filteredhash)
53 filteredhash=filteredhash)
53 if not partial.validfor(repo):
54 if not partial.validfor(repo):
54 # invalidate the cache
55 # invalidate the cache
55 raise ValueError('tip differs')
56 raise ValueError(r'tip differs')
56 cl = repo.changelog
57 cl = repo.changelog
57 for l in lines:
58 for l in lines:
58 if not l:
59 if not l:
59 continue
60 continue
60 node, state, label = l.split(" ", 2)
61 node, state, label = l.split(" ", 2)
61 if state not in 'oc':
62 if state not in 'oc':
62 raise ValueError('invalid branch state')
63 raise ValueError(r'invalid branch state')
63 label = encoding.tolocal(label.strip())
64 label = encoding.tolocal(label.strip())
64 node = bin(node)
65 node = bin(node)
65 if not cl.hasnode(node):
66 if not cl.hasnode(node):
66 raise ValueError('node %s does not exist' % hex(node))
67 raise ValueError(
68 r'node %s does not exist' % pycompat.sysstr(hex(node)))
67 partial.setdefault(label, []).append(node)
69 partial.setdefault(label, []).append(node)
68 if state == 'c':
70 if state == 'c':
69 partial._closednodes.add(node)
71 partial._closednodes.add(node)
@@ -73,7 +75,7 b' def read(repo):'
73 if repo.filtername is not None:
75 if repo.filtername is not None:
74 msg += ' (%s)' % repo.filtername
76 msg += ' (%s)' % repo.filtername
75 msg += ': %s\n'
77 msg += ': %s\n'
76 repo.ui.debug(msg % inst)
78 repo.ui.debug(msg % pycompat.bytestr(inst))
77 partial = None
79 partial = None
78 return partial
80 return partial
79
81
General Comments 0
You need to be logged in to leave comments. Login now