sapling/eden/scm/tests/test-git-submodule-revert.t
Muir Manders 1bcc7abff8 tests: enable rust status for debugruntest tests
Summary:
The new status doesn't work w/ legacy repos, so the tests need to be migrated. For each test, first I tried migrating to eagerepo, but in many cases that didn't work. Next I tried a remotefilelog repo (AKA "newclientrepo"). If I still couldn't get the test to work I just disabled rust status. This was mostly in tests that disabled treemanifest or were explicitly coupled with revlogs somehow.

Some tests had acute "hg status" discrepancies, so I left a FIXME(status) and disabled rust status.

I added a new "eagerepo" tinit.sh function that turns on eager format (for client repos). With this, tests doing "hg init" might just work with features that expect a modern repo.

Reviewed By: quark-zju

Differential Revision: D43839499

fbshipit-source-id: ce6d3b2747b90d31bd246c30551bdb55c446112f
2023-03-16 10:58:55 -07:00

84 lines
1.5 KiB
Perl

#chg-compatible
#require git no-windows
#debugruntest-compatible
Test the 'revert' command with submodules:
$ configure modern
$ setconfig diff.git=1
$ setconfig status.use-rust=false
$ . $TESTDIR/git.sh
$ enable rebase
Prepare submodule and main repo:
$ sl init --git sub
$ drawdag --cwd sub << 'EOS'
> S5
> :
> S1
> EOS
$ sl init --git main
$ drawdag --cwd main --no-files << EOS
> B # B/m=$S2 (submodule)
> | # A/m=$S1 (submodule)
> A # A/.gitmodules=[submodule "m"]\n path=m\n url=file://$TESTTMP/sub/.sl/store/git
> EOS
Revert submodule changes in working copy:
$ cd ~/main
$ sl go -q $B
- no-op revert
$ sl revert m
$ sl st
- revert to current commit
$ sl --cwd ~/sub -q checkout $S3
$ sl st
$ sl d
$ sl revert m
$ sl st
$ sl d
- revert to different commit
$ sl up -qC .
$ sl revert -r '.^' m
$ sl st
M m
$ sl d
diff --git a/m b/m
--- a/m
+++ b/m
@@ -1,1 +1,1 @@
-Subproject commit b1eae93731683dc9cf99f3714f5b4a23c6b0b13b
+Subproject commit 5d045cb6dd867debc8828c96e248804f892cf171
- reset to different commit
$ sl --config extensions.reset= reset -kr '.^'
$ sl st
Revert committed submodule changes:
$ sl go -qC $B
- revert submodule change so commit B looks like commit A
$ sl revert -r $A m
$ sl amend
$ sl cat -r . m
Subproject commit 5d045cb6dd867debc8828c96e248804f892cf171
$ sl cat -r $A m
Subproject commit 5d045cb6dd867debc8828c96e248804f892cf171
$ sl st