sapling/eden/scm/tests/test-smartlog-collapse-obsolete.t
Jun Wu 9d71e83f99 smartlog: show obsoleted commit stack
Summary:
With `sl -r OBSOLETED` the intention is see the obsoleted stack instead of just
a single commit. So filter the "::heads" with "- public()", not "& draft()".

The goal is to deprecate `--hidden`. See the linked post for more context.

Reviewed By: DurhamG

Differential Revision: D27093425

fbshipit-source-id: 76e9650a809c1d94da2341e2aca31d349487610d
2021-03-17 23:23:07 -07:00

173 lines
2.1 KiB
Perl

#chg-compatible
$ configure modern
$ setconfig format.use-segmented-changelog=1
$ enable smartlog rebase
$ disable commitcloud
$ newrepo
$ drawdag << 'EOS'
> G
> |
> F
> |
> E
> |
> D
> |
> C
> |
> B Z
> |/
> A
> EOS
$ hg bookmark -r $Z master
$ hg bookmark -r $G old
$ hg bookmark -r $F new
$ hg rebase -qr $C::$F -d $Z
The obsoleted C::F should be collapsed:
$ hg sl -T '{desc}' --config smartlog.collapse-obsolete=true
o F
o E
o D
o C
o Z
o G
x F
x C
o B
o A
The feature can be turned off:
$ hg sl -T '{desc}' --config smartlog.collapse-obsolete=false
o F
o E
o D
o C
o Z
o G
x F
x E
x D
x C
o B
o A
The "." is always shown using the default command:
$ hg up -q 'min(desc(D))'
$ hg sl -T '{desc}' --config smartlog.collapse-obsolete=true
o F
o E
o D
o C
o Z
o G
x F
@ D
x C
o B
o A
"." can still be hidden or shown with explicit `-r`:
$ hg sl -T '{desc}' -r 'desc(G)' --config smartlog.collapse-obsolete=true
o Z
o G
x F
x C
o B
o A
$ hg sl -T '{desc}' -r 'desc(G)+.' --config smartlog.collapse-obsolete=true
o Z
o G
x F
@ D
x C
o B
o A
"-r" with obsoleted stack.
$ hg hide -q 'desc(G)'
$ hg up -q 'desc(Z)'
$ hg sl -T '{desc}' -r 'desc(F) - (desc(Z)::)'
@ Z
o F
o E
o D
o C
o B
o A
$ hg sl -T '{desc}' -r 'desc(F) - (desc(Z)::)' --config smartlog.collapse-obsolete=false
@ Z
x F
x E
x D
x C
o B
o A