mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
dac395b3ce
Summary: When rebasing a long stack, it's common to have a long obsoleted (`x`) stack. The `x` stack is likely duplicated with their successors therefore generally not that useful. They take a lot of space, making it harder to find useful commits. Collapse them in smartlog output by only showing their heads and roots. This is disabled for automation as VSCode @ FB has issues rendering the "unstable" commits. Screenshot of before vs after: {F242018914} Reviewed By: markbt Differential Revision: D22289661 fbshipit-source-id: 1afce073e14abe8c23a05d52d60847fc5e0bfb66
77 lines
759 B
Perl
77 lines
759 B
Perl
#chg-compatible
|
|
|
|
$ enable rebase smartlog
|
|
|
|
$ 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
|
|
|