# HG changeset patch # User Patrick Mezard # Date 1344159261 -7200 # Node ID 18a0d96ed559089edf90206c469f3f8c26681c64 # Parent a1fb18ad29a1096d780bfdf6a40caaad954d77e2 evolve: graft --continue is optional, test diff -r a1fb18ad29a1 -r 18a0d96ed559 hgext/evolve.py --- a/hgext/evolve.py Sat Aug 04 12:48:20 2012 +0200 +++ b/hgext/evolve.py Sun Aug 05 11:34:21 2012 +0200 @@ -638,7 +638,7 @@ 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) diff -r a1fb18ad29a1 -r 18a0d96ed559 tests/test-evolve.t --- a/tests/test-evolve.t Sat Aug 04 12:48:20 2012 +0200 +++ b/tests/test-evolve.t Sun Aug 05 11:34:21 2012 +0200 @@ -365,3 +365,98 @@ (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 .. +