Commits

Patrick Mézard committed 03672e9

evolve: make graft wrapper handle --rev

  • Participants
  • Parent commits 984be08
  • Branches default

Comments (0)

Files changed (2)

File hgext/evolve.py

         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'):

File 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 -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 ..
+