hgext/fix.py
branchstable
changeset 47886 86a60679cf61
parent 47797 e69c82bf3a01
child 47924 66ff8d3865b3
equal deleted inserted replaced
47885:3962503cd1e8 47886:86a60679cf61
   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):