# HG changeset patch # User Anton Shestakov # Date 1594779055 -28800 # Node ID 9f9f04301df0a00ac0cefb1ff7b7c7977b0630d6 # Parent 5a70669beaa3f5a97029a2e3e6be509c9df63fd6 tests: less words and less markup to maintain in test-rewind.t Capitalized comments are now used for describing test cases and all-lowercase comments are for smaller steps. diff -r 5a70669beaa3 -r 9f9f04301df0 tests/test-rewind.t --- a/tests/test-rewind.t Tue Sep 08 11:56:17 2020 +0800 +++ b/tests/test-rewind.t Wed Jul 15 10:10:55 2020 +0800 @@ -41,8 +41,8 @@ $ cd .. -Test rewinding to single changesets -==================================== +Rewinding to a single changeset +=============================== $ hg clone rewind-testing-base rewind-testing-single-prunes updating to branch default @@ -52,15 +52,12 @@ Prune changeset unrelated to the working copy --------------------------------------------- -Setup -````` - -Update to an unrelated changeset +update to an unrelated changeset $ hg up 'desc("c_ROOT")' 0 files updated, 0 files merged, 2 files removed, 0 files unresolved -Prune the head +prune the head $ hg prune -r 'desc("c_B0")' 1 changesets pruned @@ -77,8 +74,7 @@ summary: c_ROOT -Actual rewind -````````````` +actual rewind $ hg rewind --hidden --to 'desc("c_B0")' rewound to 1 changesets @@ -144,22 +140,19 @@ summary: c_ROOT -Other independant rewind create a different revision ----------------------------------------------------------- - -setup -````` +Other independent rewind creates a different revision +----------------------------------------------------- note: we use "default-date" to make it a "different rewind" $ echo '[devel]' >> $HGRCPATH $ echo 'default-date = 1 0' >> $HGRCPATH -Actual rewind -````````````` - $ hg prune 'desc("c_B0")' 1 changesets pruned + +actual rewind + $ hg rewind --hidden --to 'min(desc("c_B0"))' rewound to 1 changesets $ hg debugobsolete @@ -246,12 +239,9 @@ 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd rewind-testing-single-amends -rewind a simple amend - creating content-divergence +Rewind a simple amend - creating content-divergence --------------------------------------------------- -Setup -````` - $ echo BB > B $ hg amend -m 'c_B1' $ hg log -G @@ -273,8 +263,7 @@ summary: c_ROOT -Actual rewind -````````````` +actual rewind $ hg rewind --hidden --to 'desc("c_B0")' --as-divergence 2 new content-divergent changesets @@ -355,8 +344,8 @@ summary: c_ROOT -Cleanup -``````` +cleanup + $ hg prune 'max(desc("c_B0"))' 1 changesets pruned $ hg log -G @@ -378,8 +367,10 @@ summary: c_ROOT -rewind a simple amend - obsoleting the current latest successors ----------------------------------------------------------------- +Rewind a simple amend - obsoleting the current latest successor +--------------------------------------------------------------- + +actual rewind $ echo 'default-date = 2 0' >> $HGRCPATH $ hg rewind --hidden --to 'min(desc("c_B0"))' @@ -478,16 +469,12 @@ 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd rewind-testing-single-split-fold -rewind a simple split +Rewind a simple split --------------------- -Setup -````` - $ echo C > C $ echo D > D - $ hg add C D - $ hg ci -m 'c_CD0' + $ hg ci -qAm 'c_CD0' $ hg split --config ui.interactive=yes << EOF > y > f @@ -562,8 +549,7 @@ x 49fb7d900906 (3) c_CD0 -Actual rewind -````````````` +actual rewind $ hg rewind --hidden --to 'min(desc("c_CD0"))' rewound to 1 changesets @@ -629,16 +615,12 @@ summary: c_ROOT -rewind a fold +Rewind a fold ------------- -setup -````` - $ echo 'default-date = 3 0' >> $HGRCPATH -Actual Rewind -````````````` +actual rewind $ hg rewind --to '9576e80d6851+a0316c4c5417' --hidden rewound to 2 changesets @@ -702,8 +684,8 @@ $ cd .. -Test rewinding stack -==================== +Rewinding a stack +================= $ hg clone rewind-testing-base rewind-testing-stack updating to branch default @@ -713,9 +695,6 @@ Rewinding the top of the stack only ----------------------------------- -setup -````` - $ hg up 'desc("c_A0")' 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo AA >> A @@ -769,8 +748,7 @@ summary: c_ROOT -Actual rewind -````````````` +actual rewind $ hg rewind --hidden --to 'min(desc(c_B0))' --exact 1 new orphan changesets @@ -829,10 +807,10 @@ summary: c_ROOT -Testing default argument (and cleanup) -`````````````````````````````````````` +Testing the defaults +-------------------- -rewind with no argument should be equivalent to `--from .` +rewind with no arguments should be equivalent to `--from .` $ echo 'default-date = 4 0' >> $HGRCPATH $ hg rewind