# HG changeset patch # User Pierre-Yves David # Date 1347296204 -7200 # Node ID b047e9417d96d3463ade0a4e6b0dbcedcad5e5e5 # Parent bebc6753e7b93b9fa102cedf9bfdbf2f8a5074ee Properly update after fold The previous version only set the parent, it did not rebuilt dirstate or update any file content. diff -r bebc6753e7b9 -r b047e9417d96 hgext/evolve.py --- a/hgext/evolve.py Mon Sep 10 18:22:45 2012 +0200 +++ b/hgext/evolve.py Mon Sep 10 18:56:44 2012 +0200 @@ -2078,7 +2078,7 @@ tr.release() ui.status('%i changesets folded\n' % len(revs)) if repo.revs('. and %ld', revs): - repo.dirstate.setparents(newid, node.nullid) + hg.update(repo, newid) finally: lockmod.release(lock, wlock) diff -r bebc6753e7b9 -r b047e9417d96 tests/test-evolve.t --- a/tests/test-evolve.t Mon Sep 10 18:22:45 2012 +0200 +++ b/tests/test-evolve.t Mon Sep 10 18:56:44 2012 +0200 @@ -554,8 +554,10 @@ Test fold + $ rm *.orig $ hg fold 6::10 2 changesets folded + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ glog @ 11:*@default(draft) add 1 (glob) | @@ -573,9 +575,43 @@ *** conflict + $ hg debugrebuildstate + $ hg st + +Test fold with wc parent is not the head of the folded revision + + $ hg up 4 + 0 files updated, 0 files merged, 2 files removed, 0 files unresolved + $ hg fold 4::11 + 3 changesets folded + 2 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ glog + @ 12:*@default(draft) add 4 (glob) + | + | o 1:73d38bb17fd7@default(draft) add 1 + |/ + o 0:8685c6d34325@default(draft) add 0 + + $ hg log -r 12 --template '{desc}\n' + add 4 + + *** + + add 3 + + *** + + add 1 + + *** + + conflict + $ hg debugrebuildstate + $ hg st Test olog $ hg olog - 6 : add 1 - test - 10 : conflict - test + 4 : add 4 - test + 5 : add 3 - test + 11 : add 1 - test