# HG changeset patch # User Patrick Mezard # Date 1344077091 -7200 # Node ID 03672e955bc81bb46ce3075179d3cfb6ef014bcd # Parent 984be08ef50438c6b3bcfa472e70e4e7511a7336 evolve: make graft wrapper handle --rev diff -r 984be08ef504 -r 03672e955bc8 hgext/evolve.py --- a/hgext/evolve.py Tue Jul 31 14:30:00 2012 +0200 +++ b/hgext/evolve.py Sat Aug 04 12:44:51 2012 +0200 @@ -634,6 +634,10 @@ lock.release() def graftwrapper(orig, ui, repo, *revs, **kwargs): + kwargs = dict(kwargs) + revs = list(revs) + kwargs.get('rev', []) + kwargs['rev'] = [] + lock = repo.lock() try: if kwargs.get('old_obsolete'): diff -r 984be08ef504 -r 03672e955bc8 tests/test-evolve.t --- a/tests/test-evolve.t Tue Jul 31 14:30:00 2012 +0200 +++ b/tests/test-evolve.t Sat Aug 04 12:44:51 2012 +0200 @@ -356,3 +356,51 @@ (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 -r3 -O + grafting revision 3 + $ hg graft -r1 -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 + | + | x 3:0e84df4912da@default(draft) add 3 + | | + | x 2:db038628b9e5@default(draft) add 2 + | | + | o 1:73d38bb17fd7@default(draft) add 1 + |/ + o 0:8685c6d34325@default(draft) add 0 + + $ hg debugsuccessors + 0e84df4912da 0b9e50c35132 + db038628b9e5 acb28cd497b7 + $ cd .. +