Commits

Patrick Mézard committed 18a0d96

evolve: graft --continue is optional, test

Comments (0)

Files changed (2)

     lock = repo.lock()
     try:
         if kwargs.get('old_obsolete'):
-            if kwargs['continue']:
+            if kwargs.get('continue'):
                 obsoleted.extend(repo.opener.read('graftstate').splitlines())
             else:
                 obsoleted.extend(revs)

tests/test-evolve.t

   (run 'hg update' to get a working copy)
   $ hg up
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ cd ..
+
+Test graft --obsolete/--old-obsolete
+
+  $ hg init test-graft
+  $ cd test-graft
+  $ mkcommit 0
+  $ mkcommit 1
+  $ mkcommit 2
+  $ mkcommit 3
+  $ hg up -qC 0
+  $ mkcommit 4
+  created new head
+  $ glog --hidden
+  @  4:ce341209337f@default(draft) add 4
+  |
+  | o  3:0e84df4912da@default(draft) add 3
+  | |
+  | o  2:db038628b9e5@default(draft) add 2
+  | |
+  | o  1:73d38bb17fd7@default(draft) add 1
+  |/
+  o  0:8685c6d34325@default(draft) add 0
+  
+  $ hg graft 3 -O
+  grafting revision 3
+  $ hg graft 1 -o 2
+  grafting revision 1
+  $ glog --hidden
+  @  6:acb28cd497b7@default(draft) add 1
+  |
+  o  5:0b9e50c35132@default(draft) add 3
+  |
+  o  4:ce341209337f@default(draft) add 4
+  |
+  | o  3:0e84df4912da@default(secret) add 3
+  | |
+  | o  2:db038628b9e5@default(secret) add 2
+  | |
+  | o  1:73d38bb17fd7@default(draft) add 1
+  |/
+  o  0:8685c6d34325@default(draft) add 0
+  
+  $ hg debugsuccessors
+  0e84df4912da 0b9e50c35132
+  db038628b9e5 acb28cd497b7
+
+Test graft --continue
+
+  $ hg up -qC 0
+  $ echo 2 > 1
+  $ hg ci -Am conflict 1
+  created new head
+  $ hg up -qC 6
+  $ hg graft -O 7
+  grafting revision 7
+  merging 1
+  warning: conflicts during merge.
+  merging 1 incomplete! (edit conflicts, then use 'hg resolve --mark')
+  abort: unresolved conflicts, can't continue
+  (use hg resolve and hg graft --continue)
+  [255]
+  $ hg log -r7 --template '{rev}:{node|short} {obsolete}\n'
+  7:a5bfd90a2f29 stable
+  $ echo 3 > 1
+  $ hg resolve -m 1
+  $ hg graft --continue -O
+  grafting revision 7
+  $ glog --hidden
+  @  8:920e58bb443b@default(draft) conflict
+  |
+  | o  7:a5bfd90a2f29@default(secret) conflict
+  | |
+  o |  6:acb28cd497b7@default(draft) add 1
+  | |
+  o |  5:0b9e50c35132@default(draft) add 3
+  | |
+  o |  4:ce341209337f@default(draft) add 4
+  |/
+  | o  3:0e84df4912da@default(secret) add 3
+  | |
+  | o  2:db038628b9e5@default(secret) add 2
+  | |
+  | o  1:73d38bb17fd7@default(draft) add 1
+  |/
+  o  0:8685c6d34325@default(draft) add 0
+  
+  $ hg debugsuccessors
+  0e84df4912da 0b9e50c35132
+  a5bfd90a2f29 920e58bb443b
+  db038628b9e5 acb28cd497b7
+
+  $ cd ..
+