##// END OF EJS Templates
merge: mark .hgsubstate as possibly dirty before submerge for consistency...
FUJIWARA Katsunori -
r23971:6becb9db stable
parent child Browse files
Show More
@@ -741,7 +741,15 b' def applyupdates(repo, actions, wctx, mc'
741
741
742 numupdates = sum(len(l) for m, l in actions.items() if m != 'k')
742 numupdates = sum(len(l) for m, l in actions.items() if m != 'k')
743
743
744 def dirtysubstate():
745 # mark '.hgsubstate' as possibly dirty forcibly, because
746 # modified '.hgsubstate' is misunderstood as clean,
747 # when both st_size/st_mtime of '.hgsubstate' aren't changed,
748 # even if "submerge" fails and '.hgsubstate' is inconsistent
749 repo.dirstate.normallookup('.hgsubstate')
750
744 if [a for a in actions['r'] if a[0] == '.hgsubstate']:
751 if [a for a in actions['r'] if a[0] == '.hgsubstate']:
752 dirtysubstate()
745 subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
753 subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
746
754
747 # remove in parallel (must come first)
755 # remove in parallel (must come first)
@@ -760,6 +768,7 b' def applyupdates(repo, actions, wctx, mc'
760 updated = len(actions['g'])
768 updated = len(actions['g'])
761
769
762 if [a for a in actions['g'] if a[0] == '.hgsubstate']:
770 if [a for a in actions['g'] if a[0] == '.hgsubstate']:
771 dirtysubstate()
763 subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
772 subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
764
773
765 # forget (manifest only, just log it) (must come first)
774 # forget (manifest only, just log it) (must come first)
@@ -785,6 +794,7 b' def applyupdates(repo, actions, wctx, mc'
785 z += 1
794 z += 1
786 progress(_updating, z, item=f, total=numupdates, unit=_files)
795 progress(_updating, z, item=f, total=numupdates, unit=_files)
787 if f == '.hgsubstate': # subrepo states need updating
796 if f == '.hgsubstate': # subrepo states need updating
797 dirtysubstate()
788 subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx),
798 subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx),
789 overwrite)
799 overwrite)
790 continue
800 continue
@@ -758,6 +758,8 b' test if untracked file is not overwritte'
758
758
759 $ echo issue3276_ok > repo/s/b
759 $ echo issue3276_ok > repo/s/b
760 $ hg -R repo2 push -f -q
760 $ hg -R repo2 push -f -q
761 $ touch -t 200001010000 repo/.hgsubstate
762 $ hg -R repo status --config debug.dirstate.delaywrite=2 repo/.hgsubstate
761 $ hg -R repo update
763 $ hg -R repo update
762 b: untracked file differs
764 b: untracked file differs
763 abort: untracked files in working directory differ from files in requested revision (in subrepo s)
765 abort: untracked files in working directory differ from files in requested revision (in subrepo s)
@@ -766,6 +768,7 b' test if untracked file is not overwritte'
766 $ cat repo/s/b
768 $ cat repo/s/b
767 issue3276_ok
769 issue3276_ok
768 $ rm repo/s/b
770 $ rm repo/s/b
771 $ touch -t 200001010000 repo/.hgsubstate
769 $ hg -R repo revert --all
772 $ hg -R repo revert --all
770 reverting repo/.hgsubstate (glob)
773 reverting repo/.hgsubstate (glob)
771 reverting subrepo s
774 reverting subrepo s
General Comments 0
You need to be logged in to leave comments. Login now