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