sapling/eden/scm/tests/test-commitcloud-sync-rb-join.t
Mark Juggurnauth-Thomas 810192fad4 commitcloud: ensure remotebookmarks in local state matches the cloud
Summary:
The `remotebookmarks` field in the local commit cloud state should always be one of:
* The empty set, if the previous sync was performed with remotebookmarks sync disabled; or
* The cloud workspace's remote bookmarks for that version.

Currently when processing remote bookmarks, we may store in the local state the
outcome of conflict resolution for the remote bookmarks.  This is the wrong
thing to do, as it means we won't then upload those conflict resolutions as a
new cloud version, which means they may get lost and rolled back.

Change application of cloud remote bookmarks to store the cloud remote bookmarks
in the local state, even if we changed them through conflict resolution.  This
means we will always upload the newly updated remote bookmarks to the server,
and things will stay more in sync.

Reviewed By: quark-zju

Differential Revision: D27291238

fbshipit-source-id: 8e6a0ab150da5907d32b8127aa0e6ccb17df4eea
2021-03-26 02:15:09 -07:00

73 lines
1.2 KiB
Raku

#chg-compatible
$ configure modern
$ showgraph() {
> hg log -G -T "{desc}: {phase} {bookmarks} {remotenames}" -r "all()"
> }
$ newserver server
$ cd $TESTTMP/server
$ echo base > base
$ hg commit -Aqm base
$ echo 1 > public1
$ hg commit -Aqm public1
$ hg bookmark master
$ cd $TESTTMP
$ clone server client1
$ cd client1
$ hg up -q remote/master
$ hg cloud sync -q
$ showgraph
@ public1: public remote/master
o base: public
$ cd $TESTTMP
$ cd server
$ echo 2 > public2
$ hg commit -Aqm public2
$ cd $TESTTMP
$ clone server client2
$ cd client2
$ hg up -q remote/master
$ hg cloud sync -q
$ showgraph
@ public2: public remote/master
o public1: public
o base: public
$ cd $TESTTMP
$ cd client1
$ hg cloud sync -q
$ showgraph
o public2: public remote/master
@ public1: public
o base: public
$ echo 1 > file
$ hg commit -Aqm draft1
$ hg cloud sync -q
$ cd $TESTTMP
$ cd client2
$ hg cloud sync -q
$ showgraph
o draft1: draft
@ public2: public remote/master
o public1: public
o base: public
$