750 update/merge, and means that the working directory simply isn't affected |
750 update/merge, and means that the working directory simply isn't affected |
751 unless the --working-dir flag is given. |
751 unless the --working-dir flag is given. |
752 |
752 |
753 Directly updates the dirstate for the affected files. |
753 Directly updates the dirstate for the affected files. |
754 """ |
754 """ |
755 assert repo.dirstate.p2() == nullid |
|
756 |
|
757 for path, data in pycompat.iteritems(filedata): |
755 for path, data in pycompat.iteritems(filedata): |
758 fctx = ctx[path] |
756 fctx = ctx[path] |
759 fctx.write(data, fctx.flags()) |
757 fctx.write(data, fctx.flags()) |
760 |
758 |
761 oldp1 = repo.dirstate.p1() |
759 oldp1 = repo.dirstate.p1() |
762 newp1 = replacements.get(oldp1, oldp1) |
760 newp1 = replacements.get(oldp1, oldp1) |
763 if newp1 != oldp1: |
761 if newp1 != oldp1: |
|
762 assert repo.dirstate.p2() == nullid |
764 with repo.dirstate.parentchange(): |
763 with repo.dirstate.parentchange(): |
765 scmutil.movedirstate(repo, repo[newp1]) |
764 scmutil.movedirstate(repo, repo[newp1]) |
766 |
765 |
767 |
766 |
768 def replacerev(ui, repo, ctx, filedata, replacements): |
767 def replacerev(ui, repo, ctx, filedata, replacements): |