Commits

Pierre-Yves David  committed b047e94

Properly update after fold

The previous version only set the parent, it did not rebuilt dirstate or update
any file content.

  • Participants
  • Parent commits bebc675

Comments (0)

Files changed (2)

File hgext/evolve.py

             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)
 

File tests/test-evolve.t

 
 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)
   |
   ***
   
   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