sapling/eden/scm/tests/test-revset-lost.t
Jun Wu 00ecfbb16c tests: opt-in new test runner for passing tests
Summary:
A lot of tests are passing with the new test runner.

This is done by `./edit-feature-header.py debugruntest` and paste
the `Passed:` section from `hg debugruntest -v test-*.t` output.

Note: some tests fail with this but pass with debugruntest. They
will be investigated as follow-up.

Differential Revision: D34931992

fbshipit-source-id: 99abc3d9800bb1dd3487dbfa15d715c0bd3ba878
2022-08-16 14:59:23 -07:00

77 lines
1.3 KiB
Perl

#chg-compatible
#debugruntest-compatible
$ configure modern
$ setconfig ui.allowemptycommit=1
$ enable histedit
Configure repo:
$ newrepo
$ drawdag << 'EOS'
> D
> |
> C E
> |/
> B
> |
> A
> EOS
Nothing is lost initially:
$ hg log -r 'lost()'
Hiding a commit also hides its descendants:
$ hg hide $B -q
$ hg log -r 'lost()' -T '{desc}\n'
B
C
E
D
`unhide` makes a commit and its ancestors no longer lost:
$ hg unhide $D
$ hg log -r 'lost()' -T '{desc}\n'
E
$ hg unhide $E
$ hg log -r 'lost()'
`drop` in `histedit` can produce lost commits:
$ hg up $D -q
$ hg histedit $C --commands - <<EOF
> pick $D
> drop $C
> EOF
$ hg log -r 'lost()' -T '{desc}\n'
C
`amend` (or `metaedit`) does not make commits lost if they have successors:
$ newrepo
$ hg commit -m A -q
$ hg amend -m B
$ hg amend -m C
$ hg amend -m D
$ hg log -r 'lost()' # Nothing is lost initially
$ hg hide '.' -q
$ hg log -r 'lost()' -T '{desc}\n'
D
Lost nodes are sorted by most recent hidden first:
$ newrepo
$ drawdag << 'EOS'
> E
> | D
> |/C
> |/B
> |/
> A
> EOS
$ hg log -r 'lost()' # Nothing is lost initially
$ hg hide $C -q
$ hg hide $B -q
$ hg hide $E -q
$ hg hide $D -q
$ hg log -r 'lost()' -T '{desc}\n'
D
E
B
C