mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
b1547cad1a
Summary:
Visible heads can overlap with scratch remote bookmarks, and in bad cases
(before D26792731 (7a759b6075
)), overlap with public remotenames.
When we remove remotenames we need to remove referred nodes in visibleheads
too so we don't end up with massive draft commits.
Reviewed By: DurhamG
Differential Revision: D26954215
fbshipit-source-id: 91010e6608d0150ecf374ce31705e97712154b27
124 lines
2.6 KiB
Perl
124 lines
2.6 KiB
Perl
#chg-compatible
|
|
|
|
$ configure modern
|
|
$ setconfig 'infinitepush.branchpattern=re:(^hack/.*)'
|
|
$ newserver server
|
|
|
|
$ clone server client1
|
|
$ clone server client2
|
|
$ clone server client3
|
|
$ clone server client4
|
|
$ clone server client5
|
|
|
|
Push 3 branches to the server.
|
|
|
|
$ cd client1
|
|
|
|
$ drawdag << 'EOS'
|
|
> B C D
|
|
> \|/
|
|
> A H
|
|
> |/
|
|
> Z
|
|
> EOS
|
|
|
|
$ hg push -r $Z --to release --create -q
|
|
$ hg push -r $B --to master --create -q
|
|
$ hg push -r $C --to other --create -q
|
|
$ hg push -r $D --to another --create -q
|
|
$ hg push -r $H --to hack/foo --create -q
|
|
|
|
Fetch all remote names:
|
|
|
|
$ cd $TESTTMP/client2
|
|
$ hg pull -B other -B master -B another -B release -B hack/foo -q
|
|
|
|
Commit (draft) on "another":
|
|
|
|
$ drawdag << 'EOS'
|
|
> E
|
|
> |
|
|
> desc(D)
|
|
> EOS
|
|
|
|
Cleanup: another is kept because of draft E, master is kept because it is
|
|
selectivepull default:
|
|
|
|
$ hg debugcleanremotenames
|
|
removed 3 non-essential remote bookmarks: remote/hack/foo, remote/other, remote/release
|
|
|
|
$ hg log -T '{desc} {remotenames} {phase}' -Gr 'all()'
|
|
o E draft
|
|
│
|
|
o D remote/another public
|
|
│
|
|
│ o B remote/master public
|
|
├─╯
|
|
o A public
|
|
│
|
|
o Z public
|
|
|
|
'hide --cleanup' does the same thing:
|
|
|
|
$ cd $TESTTMP/client3
|
|
$ hg pull -B other -B master -B another -B release -q
|
|
$ enable amend
|
|
$ hg hide --cleanup
|
|
removed 3 non-essential remote bookmarks: remote/another, remote/other, remote/release
|
|
|
|
$ hg log -T '{desc} {remotenames} {phase}' -Gr 'all()'
|
|
o B remote/master public
|
|
│
|
|
o A public
|
|
│
|
|
o Z public
|
|
|
|
Auto cleanup triggered by remotenames.autocleanupthreshold:
|
|
|
|
$ cd $TESTTMP/client4
|
|
$ hg pull -B other -B master -B another -B release -q
|
|
$ hg log -T '{desc} {remotenames} {phase}' -Gr 'all()' --config remotenames.autocleanupthreshold=1
|
|
attempt to clean up remote bookmarks since they exceed threshold 1
|
|
removed 3 non-essential remote bookmarks: remote/another, remote/other, remote/release
|
|
o B remote/master public
|
|
│
|
|
o A public
|
|
│
|
|
o Z public
|
|
|
|
Resethead command to reset all heads (including draft heads):
|
|
|
|
$ cd $TESTTMP
|
|
$ cd client5
|
|
$ hg pull -B other -B master -B another -B release -q
|
|
$ drawdag << 'EOS'
|
|
> E
|
|
> |
|
|
> desc(D)
|
|
> EOS
|
|
|
|
$ hg log -T '{desc} {remotenames} {phase}' -Gr 'all()'
|
|
o E draft
|
|
│
|
|
o D remote/another public
|
|
│
|
|
│ o C remote/other public
|
|
├─╯
|
|
│ o B remote/master public
|
|
├─╯
|
|
o A public
|
|
│
|
|
o Z remote/release public
|
|
|
|
$ hg debugresetheads
|
|
|
|
Notice that only the "master" head is left:
|
|
|
|
$ hg log -T '{desc} {remotenames} {phase}' -Gr 'all()'
|
|
o B remote/master public
|
|
│
|
|
o A public
|
|
│
|
|
o Z public
|
|
|