##// END OF EJS Templates
context: only scan unknowns when needed
Matt Mackall -
r11101:50247483 default
parent child Browse files
Show More
@@ -564,10 +564,12 b' class workingctx(changectx):'
564 if user:
564 if user:
565 self._user = user
565 self._user = user
566 if changes:
566 if changes:
567 self._status = list(changes[:5])
567 self._status = list(changes[:4])
568 self._unknown = changes[4]
568 self._ignored = changes[5]
569 self._ignored = changes[5]
569 self._clean = changes[6]
570 self._clean = changes[6]
570 else:
571 else:
572 self._unknown = None
571 self._ignored = None
573 self._ignored = None
572 self._clean = None
574 self._clean = None
573
575
@@ -597,6 +599,9 b' class workingctx(changectx):'
597 def _manifest(self):
599 def _manifest(self):
598 """generate a manifest corresponding to the working directory"""
600 """generate a manifest corresponding to the working directory"""
599
601
602 if self._unknown is None:
603 self.status(unknown=True)
604
600 man = self._parents[0].manifest().copy()
605 man = self._parents[0].manifest().copy()
601 copied = self._repo.dirstate.copies()
606 copied = self._repo.dirstate.copies()
602 if len(self._parents) > 1:
607 if len(self._parents) > 1:
@@ -611,7 +616,8 b' class workingctx(changectx):'
611 f = copied.get(f, f)
616 f = copied.get(f, f)
612 return getman(f).flags(f)
617 return getman(f).flags(f)
613 ff = self._repo.dirstate.flagfunc(cf)
618 ff = self._repo.dirstate.flagfunc(cf)
614 modified, added, removed, deleted, unknown = self._status[:5]
619 modified, added, removed, deleted = self._status
620 unknown = self._unknown
615 for i, l in (("a", added), ("m", modified), ("u", unknown)):
621 for i, l in (("a", added), ("m", modified), ("u", unknown)):
616 for f in l:
622 for f in l:
617 orig = copied.get(f, f)
623 orig = copied.get(f, f)
@@ -629,7 +635,7 b' class workingctx(changectx):'
629
635
630 @propertycache
636 @propertycache
631 def _status(self):
637 def _status(self):
632 return self._repo.status(unknown=True)[:5]
638 return self._repo.status()[:4]
633
639
634 @propertycache
640 @propertycache
635 def _user(self):
641 def _user(self):
@@ -653,10 +659,15 b' class workingctx(changectx):'
653 _status property will implicitly read the status using its default
659 _status property will implicitly read the status using its default
654 arguments."""
660 arguments."""
655 stat = self._repo.status(ignored=ignored, clean=clean, unknown=unknown)
661 stat = self._repo.status(ignored=ignored, clean=clean, unknown=unknown)
656 self._ignored = ignored and stat[5] or None
662 self._unknown = self._ignored = self._clean = None
657 self._clean = clean and stat[6] or None
663 if unknown:
658 self._status = stat[:5]
664 self._unknown = stat[4]
659 return self._status
665 if ignored:
666 self._ignored = stat[5]
667 if clean:
668 self._clean = stat[6]
669 self._status = stat[:4]
670 return stat
660
671
661 def manifest(self):
672 def manifest(self):
662 return self._manifest
673 return self._manifest
@@ -678,7 +689,8 b' class workingctx(changectx):'
678 def deleted(self):
689 def deleted(self):
679 return self._status[3]
690 return self._status[3]
680 def unknown(self):
691 def unknown(self):
681 return self._status[4]
692 assert self._unknown is not None # must call status first
693 return self._unknown
682 def ignored(self):
694 def ignored(self):
683 assert self._ignored is not None # must call status first
695 assert self._ignored is not None # must call status first
684 return self._ignored
696 return self._ignored
@@ -491,6 +491,7 b' def update(repo, node, branchmerge, forc'
491
491
492 ### calculate phase
492 ### calculate phase
493 action = []
493 action = []
494 wc.status(unknown=True) # prime cache
494 if not force:
495 if not force:
495 _checkunknown(wc, p2)
496 _checkunknown(wc, p2)
496 if not util.checkcase(repo.path):
497 if not util.checkcase(repo.path):
General Comments 0
You need to be logged in to leave comments. Login now