##// END OF EJS Templates
dirstate-item: use need_delay when packing dirstate...
marmoute -
r48329:1a630242 default
parent child Browse files
Show More
@@ -39,6 +39,9 b' FROM_P2 = -2'
39 # a special value used internally for `size` if the file is modified/merged/added
39 # a special value used internally for `size` if the file is modified/merged/added
40 NONNORMAL = -1
40 NONNORMAL = -1
41
41
42 # a special value used internally for `time` if the time is ambigeous
43 AMBIGUOUS_TIME = -1
44
42
45
43 class DirstateItem(object):
46 class DirstateItem(object):
44 """represent a dirstate entry
47 """represent a dirstate entry
@@ -540,7 +543,7 b' def pack_dirstate(dmap, copymap, pl, now'
540 write = cs.write
543 write = cs.write
541 write(b"".join(pl))
544 write(b"".join(pl))
542 for f, e in pycompat.iteritems(dmap):
545 for f, e in pycompat.iteritems(dmap):
543 if e[0] == b'n' and e[3] == now:
546 if e.need_delay(now):
544 # The file was last modified "simultaneously" with the current
547 # The file was last modified "simultaneously" with the current
545 # write to dirstate (i.e. within the same second for file-
548 # write to dirstate (i.e. within the same second for file-
546 # systems with a granularity of 1 sec). This commonly happens
549 # systems with a granularity of 1 sec). This commonly happens
@@ -550,7 +553,7 b' def pack_dirstate(dmap, copymap, pl, now'
550 # dirstate, forcing future 'status' calls to compare the
553 # dirstate, forcing future 'status' calls to compare the
551 # contents of the file if the size is the same. This prevents
554 # contents of the file if the size is the same. This prevents
552 # mistakenly treating such files as clean.
555 # mistakenly treating such files as clean.
553 e = DirstateItem(e[0], e[1], e[2], -1)
556 e = DirstateItem(e.state, e.mode, e.size, AMBIGUOUS_TIME)
554 dmap[f] = e
557 dmap[f] = e
555
558
556 if f in copymap:
559 if f in copymap:
General Comments 0
You need to be logged in to leave comments. Login now