changeset 549:b047e9417d96 stable

Properly update after fold The previous version only set the parent, it did not rebuilt dirstate or update any file content.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Mon, 10 Sep 2012 18:56:44 +0200
parents bebc6753e7b9
children 362e65fc6146
files hgext/evolve.py tests/test-evolve.t
diffstat 2 files changed, 39 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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)
 
--- 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