evolve: fix the dirstate after setting parents with dirty wdir (issue5930)
Before this patch, during an interrupted evolve it can be confused
about copies. This patch fix the dirstate when parents are changed
using dirstate.setparents() with a dirty wdir.
Changes in test file reflect the fixed behaviour.
--- a/hgext3rd/evolve/evolvecmd.py Thu Mar 07 01:02:05 2019 +0530
+++ b/hgext3rd/evolve/evolvecmd.py Thu Mar 07 01:47:14 2019 +0530
@@ -825,6 +825,7 @@
repo.dirstate.write(tr)
# fix up dirstate for copies and renames
copies.duplicatecopies(repo, repo[None], dest.rev(), orig.p1().rev())
+ dirstatedance(repo, dest, orig.node(), None)
class LocalMergeFailure(MergeFailure, exc.__class__):
pass
--- a/tests/test-evolve-continue.t Thu Mar 07 01:02:05 2019 +0530
+++ b/tests/test-evolve-continue.t Thu Mar 07 01:47:14 2019 +0530
@@ -421,8 +421,6 @@
affected by the evolved changeset (nor was 'a')
$ hg st -C
- M b
- a
M c
A d
? c.orig