Show More
@@ -40,13 +40,7 b' def _filename(repo):' | |||||
40 | def read(repo): |
|
40 | def read(repo): | |
41 | try: |
|
41 | try: | |
42 | f = repo.cachevfs(_filename(repo)) |
|
42 | f = repo.cachevfs(_filename(repo)) | |
43 | lines = f.read().split('\n') |
|
43 | cachekey = next(f).split(" ", 2) | |
44 | f.close() |
|
|||
45 | except (IOError, OSError): |
|
|||
46 | return None |
|
|||
47 |
|
||||
48 | try: |
|
|||
49 | cachekey = lines.pop(0).split(" ", 2) |
|
|||
50 | last, lrev = cachekey[:2] |
|
44 | last, lrev = cachekey[:2] | |
51 | last, lrev = bin(last), int(lrev) |
|
45 | last, lrev = bin(last), int(lrev) | |
52 | filteredhash = None |
|
46 | filteredhash = None | |
@@ -58,7 +52,7 b' def read(repo):' | |||||
58 | # invalidate the cache |
|
52 | # invalidate the cache | |
59 | raise ValueError(r'tip differs') |
|
53 | raise ValueError(r'tip differs') | |
60 | cl = repo.changelog |
|
54 | cl = repo.changelog | |
61 |
for l in |
|
55 | for l in f: | |
62 | if not l: |
|
56 | if not l: | |
63 | continue |
|
57 | continue | |
64 | node, state, label = l.split(" ", 2) |
|
58 | node, state, label = l.split(" ", 2) | |
@@ -72,6 +66,10 b' def read(repo):' | |||||
72 | partial.setdefault(label, []).append(node) |
|
66 | partial.setdefault(label, []).append(node) | |
73 | if state == 'c': |
|
67 | if state == 'c': | |
74 | partial._closednodes.add(node) |
|
68 | partial._closednodes.add(node) | |
|
69 | ||||
|
70 | except (IOError, OSError): | |||
|
71 | return None | |||
|
72 | ||||
75 | except Exception as inst: |
|
73 | except Exception as inst: | |
76 | if repo.ui.debugflag: |
|
74 | if repo.ui.debugflag: | |
77 | msg = 'invalid branchheads cache' |
|
75 | msg = 'invalid branchheads cache' |
General Comments 0
You need to be logged in to leave comments.
Login now