##// END OF EJS Templates
dirstate-item: implement `v1_size` with higher level block...
marmoute -
r48749:dbf2d038 default
parent child Browse files
Show More
@@ -354,32 +354,22 b' class DirstateItem(object):'
354 # the object has no state to record, this is -currently-
354 # the object has no state to record, this is -currently-
355 # unsupported
355 # unsupported
356 raise RuntimeError('untracked item')
356 raise RuntimeError('untracked item')
357 elif not self._wc_tracked:
357 elif self.merged_removed:
358 # File was deleted
358 return NONNORMAL
359 if self._merged:
359 elif self.from_p2_removed:
360 return NONNORMAL
361 elif self._clean_p2:
362 return FROM_P2
363 else:
364 return 0
365 elif self._merged:
366 return FROM_P2
360 return FROM_P2
367 elif not (self._p1_tracked or self._p2_tracked) and self._wc_tracked:
361 elif self.removed:
368 # Added
362 return 0
363 elif self.merged:
364 return FROM_P2
365 elif self.added:
369 return NONNORMAL
366 return NONNORMAL
370 elif self._clean_p2 and self._wc_tracked:
367 elif self.from_p2:
371 return FROM_P2
372 elif not self._p1_tracked and self._p2_tracked and self._wc_tracked:
373 return FROM_P2
368 return FROM_P2
374 elif self._possibly_dirty:
369 elif self._possibly_dirty:
375 if self._size is None:
370 return self._size if self._size is not None else NONNORMAL
376 return NONNORMAL
371 else:
377 else:
378 return self._size
379 elif self._wc_tracked:
380 return self._size
372 return self._size
381 else:
382 raise RuntimeError('unreachable')
383
373
384 def v1_mtime(self):
374 def v1_mtime(self):
385 """return a "mtime" suitable for v1 serialization"""
375 """return a "mtime" suitable for v1 serialization"""
General Comments 0
You need to be logged in to leave comments. Login now