diff hgext/mq.py @ 16551:ebf6d38c9063 stable

localrepo: add setparents() to adjust dirstate copies (issue3407) The fix introduced in eab9119c5dee was only partially successful. It is correct to turn dirstate 'm' merge records into normal/dirty ones but copy records are lost in the process. To adjust them as well, we need to look in the first parent manifest to know which files were added and preserve only related records. But the dirstate does not have access to changesets, the logic has to moved at another level, in localrepo.
author Patrick Mezard <patrick@mezard.eu>
date Sun, 29 Apr 2012 22:25:55 +0200
parents 9b26d541e972
children b2ca2f40c9c1
line wrap: on
line diff
--- a/hgext/mq.py	Sun Apr 29 16:18:46 2012 +0200
+++ b/hgext/mq.py	Sun Apr 29 22:25:55 2012 +0200
@@ -749,7 +749,7 @@
                 for f in merged:
                     repo.dirstate.merge(f)
                 p1, p2 = repo.dirstate.parents()
-                repo.dirstate.setparents(p1, merge)
+                repo.setparents(p1, merge)
 
             match = scmutil.matchfiles(repo, files or [])
             oldtip = repo['tip']
@@ -1355,7 +1355,7 @@
                     fctx = ctx[f]
                     repo.wwrite(f, fctx.data(), fctx.flags())
                     repo.dirstate.normal(f)
-                repo.dirstate.setparents(qp, nullid)
+                repo.setparents(qp, nullid)
             for patch in reversed(self.applied[start:end]):
                 self.ui.status(_("popping %s\n") % patch.name)
             del self.applied[start:end]
@@ -1546,7 +1546,7 @@
                 oldphase = repo[top].phase()
 
                 # assumes strip can roll itself back if interrupted
-                repo.dirstate.setparents(*cparents)
+                repo.setparents(*cparents)
                 self.applied.pop()
                 self.applieddirty = True
                 self.strip(repo, [top], update=False,