Show More
@@ -186,19 +186,7 b' class dirstate(object):' | |||||
186 |
|
186 | |||
187 | @propertycache |
|
187 | @propertycache | |
188 | def _pl(self): |
|
188 | def _pl(self): | |
189 | try: |
|
189 | return self._map.parents() | |
190 | fp = self._map._opendirstatefile() |
|
|||
191 | st = fp.read(40) |
|
|||
192 | fp.close() |
|
|||
193 | l = len(st) |
|
|||
194 | if l == 40: |
|
|||
195 | return st[:20], st[20:40] |
|
|||
196 | elif l > 0 and l < 40: |
|
|||
197 | raise error.Abort(_('working directory state appears damaged!')) |
|
|||
198 | except IOError as err: |
|
|||
199 | if err.errno != errno.ENOENT: |
|
|||
200 | raise |
|
|||
201 | return [nullid, nullid] |
|
|||
202 |
|
190 | |||
203 | @propertycache |
|
191 | @propertycache | |
204 | def _dirs(self): |
|
192 | def _dirs(self): | |
@@ -1381,3 +1369,17 b' class dirstatemap(object):' | |||||
1381 | self._pendingmode = mode |
|
1369 | self._pendingmode = mode | |
1382 | return fp |
|
1370 | return fp | |
1383 |
|
1371 | |||
|
1372 | def parents(self): | |||
|
1373 | try: | |||
|
1374 | fp = self._opendirstatefile() | |||
|
1375 | st = fp.read(40) | |||
|
1376 | fp.close() | |||
|
1377 | l = len(st) | |||
|
1378 | if l == 40: | |||
|
1379 | return st[:20], st[20:40] | |||
|
1380 | elif l > 0 and l < 40: | |||
|
1381 | raise error.Abort(_('working directory state appears damaged!')) | |||
|
1382 | except IOError as err: | |||
|
1383 | if err.errno != errno.ENOENT: | |||
|
1384 | raise | |||
|
1385 | return [nullid, nullid] |
General Comments 0
You need to be logged in to leave comments.
Login now