Show More
@@ -2965,21 +2965,17 b' def debugrebuilddirstate(ui, repo, rev, ' | |||||
2965 | wlock = repo.wlock() |
|
2965 | wlock = repo.wlock() | |
2966 | try: |
|
2966 | try: | |
2967 | dirstate = repo.dirstate |
|
2967 | dirstate = repo.dirstate | |
2968 |
|
2968 | changedfiles = None | ||
2969 | # See command doc for what minimal does. |
|
2969 | # See command doc for what minimal does. | |
2970 | if opts.get('minimal'): |
|
2970 | if opts.get('minimal'): | |
|
2971 | manifestfiles = set(ctx.manifest().keys()) | |||
2971 | dirstatefiles = set(dirstate) |
|
2972 | dirstatefiles = set(dirstate) | |
2972 | ctxfiles = set(ctx.manifest().keys()) |
|
2973 | manifestonly = manifestfiles - dirstatefiles | |
2973 |
|
|
2974 | dsonly = dirstatefiles - manifestfiles | |
2974 | indirstate = file in dirstatefiles |
|
2975 | dsnotadded = set(f for f in dsonly if dirstate[f] != 'a') | |
2975 | inctx = file in ctxfiles |
|
2976 | changedfiles = manifestonly | dsnotadded | |
2976 |
|
2977 | |||
2977 | if indirstate and not inctx and dirstate[file] != 'a': |
|
2978 | dirstate.rebuild(ctx.node(), ctx.manifest(), changedfiles) | |
2978 | dirstate.drop(file) |
|
|||
2979 | elif inctx and not indirstate: |
|
|||
2980 | dirstate.normallookup(file) |
|
|||
2981 | else: |
|
|||
2982 | dirstate.rebuild(ctx.node(), ctx.manifest()) |
|
|||
2983 | finally: |
|
2979 | finally: | |
2984 | wlock.release() |
|
2980 | wlock.release() | |
2985 |
|
2981 |
@@ -639,17 +639,22 b' class dirstate(object):' | |||||
639 |
|
639 | |||
640 | def rebuild(self, parent, allfiles, changedfiles=None): |
|
640 | def rebuild(self, parent, allfiles, changedfiles=None): | |
641 | if changedfiles is None: |
|
641 | if changedfiles is None: | |
|
642 | # Rebuild entire dirstate | |||
642 | changedfiles = allfiles |
|
643 | changedfiles = allfiles | |
643 | oldmap = self._map |
|
644 | lastnormaltime = self._lastnormaltime | |
644 | self.clear() |
|
645 | self.clear() | |
645 | for f in allfiles: |
|
646 | self._lastnormaltime = lastnormaltime | |
646 | if f not in changedfiles: |
|
647 | ||
647 | self._map[f] = oldmap[f] |
|
648 | for f in changedfiles: | |
|
649 | mode = 0o666 | |||
|
650 | if f in allfiles and 'x' in allfiles.flags(f): | |||
|
651 | mode = 0o777 | |||
|
652 | ||||
|
653 | if f in allfiles: | |||
|
654 | self._map[f] = dirstatetuple('n', mode, -1, 0) | |||
648 | else: |
|
655 | else: | |
649 | if 'x' in allfiles.flags(f): |
|
656 | self._map.pop(f, None) | |
650 | self._map[f] = dirstatetuple('n', 0o777, -1, 0) |
|
657 | ||
651 | else: |
|
|||
652 | self._map[f] = dirstatetuple('n', 0o666, -1, 0) |
|
|||
653 | self._pl = (parent, nullid) |
|
658 | self._pl = (parent, nullid) | |
654 | self._dirty = True |
|
659 | self._dirty = True | |
655 |
|
660 |
@@ -115,7 +115,7 b' dirstate' | |||||
115 | $ hg debugrebuilddirstate --minimal |
|
115 | $ hg debugrebuilddirstate --minimal | |
116 | $ hg debugdirstate --nodates |
|
116 | $ hg debugdirstate --nodates | |
117 | r 0 0 * bar (glob) |
|
117 | r 0 0 * bar (glob) | |
118 |
n |
|
118 | n 644 -1 * foo (glob) | |
119 | a 0 -1 * qux (glob) |
|
119 | a 0 -1 * qux (glob) | |
120 | $ hg status -A |
|
120 | $ hg status -A | |
121 | A qux |
|
121 | A qux |
General Comments 0
You need to be logged in to leave comments.
Login now