##// END OF EJS Templates
fix: rewrite writeworkingdir() to explicitly not work with merges...
Martin von Zweigbergk -
r48566:3feda1e7 stable
parent child Browse files
Show More
@@ -132,6 +132,7 b' import subprocess'
132
132
133 from mercurial.i18n import _
133 from mercurial.i18n import _
134 from mercurial.node import (
134 from mercurial.node import (
135 nullid,
135 nullrev,
136 nullrev,
136 wdirrev,
137 wdirrev,
137 )
138 )
@@ -753,16 +754,18 b' def writeworkingdir(repo, ctx, filedata,'
753
754
754 Directly updates the dirstate for the affected files.
755 Directly updates the dirstate for the affected files.
755 """
756 """
757 assert repo.dirstate.p2() == nullid
758
756 for path, data in pycompat.iteritems(filedata):
759 for path, data in pycompat.iteritems(filedata):
757 fctx = ctx[path]
760 fctx = ctx[path]
758 fctx.write(data, fctx.flags())
761 fctx.write(data, fctx.flags())
759 if repo.dirstate[path] == b'n':
762 if repo.dirstate[path] == b'n':
760 repo.dirstate.set_possibly_dirty(path)
763 repo.dirstate.set_possibly_dirty(path)
761
764
762 oldparentnodes = repo.dirstate.parents()
765 oldp1 = repo.dirstate.p1()
763 newparentnodes = [replacements.get(n, n) for n in oldparentnodes]
766 newp1 = replacements.get(oldp1, oldp1)
764 if newparentnodes != oldparentnodes:
767 if newp1 != oldp1:
765 repo.setparents(*newparentnodes)
768 repo.setparents(newp1, nullid)
766
769
767
770
768 def replacerev(ui, repo, ctx, filedata, replacements):
771 def replacerev(ui, repo, ctx, filedata, replacements):
General Comments 0
You need to be logged in to leave comments. Login now