##// END OF EJS Templates
dirstate: add code to update the non-normal set...
Laurent Charignon -
r27590:f2d0ada0 default
parent child Browse files
Show More
@@ -440,7 +440,7 b' class dirstate(object):'
440 440
441 441 def invalidate(self):
442 442 for a in ("_map", "_copymap", "_filefoldmap", "_dirfoldmap", "_branch",
443 "_pl", "_dirs", "_ignore"):
443 "_pl", "_dirs", "_ignore", "_nonnormalset"):
444 444 if a in self.__dict__:
445 445 delattr(self, a)
446 446 self._lastnormaltime = 0
@@ -489,6 +489,8 b' class dirstate(object):'
489 489 self._dirs.addpath(f)
490 490 self._dirty = True
491 491 self._map[f] = dirstatetuple(state, mode, size, mtime)
492 if state != 'n' or mtime == -1:
493 self._nonnormalset.add(f)
492 494
493 495 def normal(self, f):
494 496 '''Mark a file normal and clean.'''
@@ -498,6 +500,8 b' class dirstate(object):'
498 500 s.st_size & _rangemask, mtime & _rangemask)
499 501 if f in self._copymap:
500 502 del self._copymap[f]
503 if f in self._nonnormalset:
504 self._nonnormalset.remove(f)
501 505 if mtime > self._lastnormaltime:
502 506 # Remember the most recent modification timeslot for status(),
503 507 # to make sure we won't miss future size-preserving file content
@@ -525,6 +529,8 b' class dirstate(object):'
525 529 self._addpath(f, 'n', 0, -1, -1)
526 530 if f in self._copymap:
527 531 del self._copymap[f]
532 if f in self._nonnormalset:
533 self._nonnormalset.remove(f)
528 534
529 535 def otherparent(self, f):
530 536 '''Mark as coming from the other parent, always dirty.'''
@@ -560,6 +566,7 b' class dirstate(object):'
560 566 elif entry[0] == 'n' and entry[2] == -2: # other parent
561 567 size = -2
562 568 self._map[f] = dirstatetuple('r', 0, size, 0)
569 self._nonnormalset.add(f)
563 570 if size == 0 and f in self._copymap:
564 571 del self._copymap[f]
565 572
@@ -575,6 +582,8 b' class dirstate(object):'
575 582 self._dirty = True
576 583 self._droppath(f)
577 584 del self._map[f]
585 if f in self._nonnormalset:
586 self._nonnormalset.remove(f)
578 587
579 588 def _discoverpath(self, path, normed, ignoremissing, exists, storemap):
580 589 if exists is None:
@@ -652,6 +661,7 b' class dirstate(object):'
652 661
653 662 def clear(self):
654 663 self._map = {}
664 self._nonnormalset = set()
655 665 if "_dirs" in self.__dict__:
656 666 delattr(self, "_dirs")
657 667 self._copymap = {}
@@ -676,6 +686,8 b' class dirstate(object):'
676 686 self._map[f] = dirstatetuple('n', mode, -1, 0)
677 687 else:
678 688 self._map.pop(f, None)
689 if f in self._nonnormalset:
690 self._nonnormalset.remove(f)
679 691
680 692 self._pl = (parent, nullid)
681 693 self._dirty = True
@@ -709,6 +721,7 b' class dirstate(object):'
709 721 for f, e in dmap.iteritems():
710 722 if e[0] == 'n' and e[3] == now:
711 723 dmap[f] = dirstatetuple(e[0], e[1], e[2], -1)
724 self._nonnormalset.add(f)
712 725
713 726 # emulate that all 'dirstate.normal' results are written out
714 727 self._lastnormaltime = 0
@@ -743,6 +756,7 b' class dirstate(object):'
743 756 break
744 757
745 758 st.write(parsers.pack_dirstate(self._map, self._copymap, self._pl, now))
759 self._nonnormalset = nonnormalentries(self._map)
746 760 st.close()
747 761 self._lastnormaltime = 0
748 762 self._dirty = self._dirtypl = False
General Comments 0
You need to be logged in to leave comments. Login now