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