diff tests/test-rewind.t @ 3871:2e32a1ef0c60

rewing: add the ability to rewind "from" revisions
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 17 Jun 2018 03:10:19 +0200
parents e0bf44befd6e
children bbc3cfdfe42b
line wrap: on
line diff
--- a/tests/test-rewind.t	Sun Jun 17 03:29:34 2018 +0200
+++ b/tests/test-rewind.t	Sun Jun 17 03:10:19 2018 +0200
@@ -748,11 +748,11 @@
      summary:     c_ROOT
   
 
-cleanup
-```````
+Testing --from (and cleanup)
+```````````````````````````
 
   $ echo 'default-date = 4 0' >> $HGRCPATH
-  $ hg rewind --hidden --to 'precursors(.)'
+  $ hg rewind --from '.'
   rewinded to 1 changesets
   (1 changesets obsoleted)
   working directory is now at 7b1440274cc3
@@ -797,8 +797,8 @@
        rewritten(meta, date) as 96622b0702dd using rewind by test (Thu Jan 01 00:00:03 1970 +0000)
        rewritten(parent) as a65fceb2324a using evolve by test (Thu Jan 01 00:00:03 1970 +0000)
   
-Automaticlaly rewinding the full stack
---------------------------------------
+Automatically rewinding the full stack (with --to)
+--------------------------------------------------
 
   $ hg rewind --hidden --to 'precursors(.)'
   rewinded to 2 changesets
@@ -851,3 +851,67 @@
      date:        Thu Jan 01 00:00:00 1970 +0000
      summary:     c_ROOT
   
+
+Automatically rewinding the full stack (with --from)
+----------------------------------------------------
+
+  $ echo 'default-date = 6 0' >> $HGRCPATH
+  $ hg rewind --hidden --from '.'
+  rewinded to 2 changesets
+  (2 changesets obsoleted)
+  working directory is now at 141aedbbde8f
+  $ hg debugobsolete
+  579f120ba91885449adc92eedf48ef3569742cee d952d1794ff657f5c2a82225d2e6307ed930b32f 0 (Thu Jan 01 00:00:03 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'}
+  7e594302a05d3769b27be88fc3cdfd39d7498498 a65fceb2324ae1eb1231610193d24a5fa02c7c0e 0 (Thu Jan 01 00:00:03 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  7e594302a05d3769b27be88fc3cdfd39d7498498 96622b0702dd86e3a702b0235b420da41f072efe 4 (Thu Jan 01 00:00:03 1970 +0000) {'ef1': '34', 'operation': 'rewind', 'user': 'test'}
+  a65fceb2324ae1eb1231610193d24a5fa02c7c0e 96622b0702dd86e3a702b0235b420da41f072efe 0 (Thu Jan 01 00:00:03 1970 +0000) {'ef1': '38', 'operation': 'rewind', 'user': 'test'}
+  a65fceb2324ae1eb1231610193d24a5fa02c7c0e 7b1440274cc3b3f8bfcffc891172a7d2d7e9140c 4 (Thu Jan 01 00:00:04 1970 +0000) {'ef1': '34', 'operation': 'rewind', 'user': 'test'}
+  96622b0702dd86e3a702b0235b420da41f072efe 7b1440274cc3b3f8bfcffc891172a7d2d7e9140c 0 (Thu Jan 01 00:00:04 1970 +0000) {'ef1': '38', 'operation': 'rewind', 'user': 'test'}
+  579f120ba91885449adc92eedf48ef3569742cee c0d232501dd8e52b8ca8a266f25db89f5120c17f 4 (Thu Jan 01 00:00:05 1970 +0000) {'ef1': '34', 'operation': 'rewind', 'user': 'test'}
+  96622b0702dd86e3a702b0235b420da41f072efe 70892f498f2993d626848bb312ff856168d0b9c4 4 (Thu Jan 01 00:00:05 1970 +0000) {'ef1': '38', 'operation': 'rewind', 'user': 'test'}
+  7b1440274cc3b3f8bfcffc891172a7d2d7e9140c 70892f498f2993d626848bb312ff856168d0b9c4 0 (Thu Jan 01 00:00:05 1970 +0000) {'ef1': '38', 'operation': 'rewind', 'user': 'test'}
+  d952d1794ff657f5c2a82225d2e6307ed930b32f c0d232501dd8e52b8ca8a266f25db89f5120c17f 0 (Thu Jan 01 00:00:05 1970 +0000) {'ef1': '43', 'operation': 'rewind', 'user': 'test'}
+  d952d1794ff657f5c2a82225d2e6307ed930b32f 7b4aed5e99d2734da6cc25f0095876c5cb6e8084 4 (Thu Jan 01 00:00:06 1970 +0000) {'ef1': '34', 'operation': 'rewind', 'user': 'test'}
+  7b1440274cc3b3f8bfcffc891172a7d2d7e9140c 141aedbbde8f407fc8a8a7355221733b0fc01ca5 4 (Thu Jan 01 00:00:06 1970 +0000) {'ef1': '38', 'operation': 'rewind', 'user': 'test'}
+  70892f498f2993d626848bb312ff856168d0b9c4 141aedbbde8f407fc8a8a7355221733b0fc01ca5 0 (Thu Jan 01 00:00:06 1970 +0000) {'ef1': '38', 'operation': 'rewind', 'user': 'test'}
+  c0d232501dd8e52b8ca8a266f25db89f5120c17f 7b4aed5e99d2734da6cc25f0095876c5cb6e8084 0 (Thu Jan 01 00:00:06 1970 +0000) {'ef1': '43', 'operation': 'rewind', 'user': 'test'}
+  $ hg obslog
+  @    141aedbbde8f (10) c_B0
+  |\
+  x |  70892f498f29 (8) c_B0
+  |\|    rewritten(meta, date, parent) as 141aedbbde8f using rewind by test (Thu Jan 01 00:00:06 1970 +0000)
+  | |
+  | x  7b1440274cc3 (6) c_B0
+  |/|    rewritten(meta, date, parent) as 141aedbbde8f using rewind by test (Thu Jan 01 00:00:06 1970 +0000)
+  | |    rewritten(meta, date, parent) as 70892f498f29 using rewind by test (Thu Jan 01 00:00:05 1970 +0000)
+  | |
+  x |  96622b0702dd (5) c_B0
+  |\|    rewritten(meta, date, parent) as 70892f498f29 using rewind by test (Thu Jan 01 00:00:05 1970 +0000)
+  | |    rewritten(meta, date, parent) as 7b1440274cc3 using rewind by test (Thu Jan 01 00:00:04 1970 +0000)
+  | |
+  | x  a65fceb2324a (4) c_B0
+  |/     rewritten(meta, date) as 7b1440274cc3 using rewind by test (Thu Jan 01 00:00:04 1970 +0000)
+  |      rewritten(meta, date, parent) as 96622b0702dd using rewind by test (Thu Jan 01 00:00:03 1970 +0000)
+  |
+  x  7e594302a05d (2) c_B0
+       rewritten(meta, date) as 96622b0702dd using rewind by test (Thu Jan 01 00:00:03 1970 +0000)
+       rewritten(parent) as a65fceb2324a using evolve by test (Thu Jan 01 00:00:03 1970 +0000)
+  
+  $ hg log -G
+  @  changeset:   10:141aedbbde8f
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:06 1970 +0000
+  |  summary:     c_B0
+  |
+  o  changeset:   9:7b4aed5e99d2
+  |  parent:      0:eba9c2249fe7
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:06 1970 +0000
+  |  summary:     c_A1
+  |
+  o  changeset:   0:eba9c2249fe7
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     c_ROOT
+