mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 16:31:02 +03:00
d7f7bc0181
Summary: With `collapse-obsolete`, `.` can be obsoleted and in the middle of a stack and not shown up. That can be confusing. Make the smartlog revset always show the `heads` passed in. If `.` is in `heads` (the default), then show it. Reviewed By: DurhamG Differential Revision: D24696595 fbshipit-source-id: 7deab109d0e0ae5e703928252bc63312d936955f
136 lines
1.6 KiB
Perl
136 lines
1.6 KiB
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
|
|
|
|
|
|
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
|
|
|