sapling/eden/scm/tests/test-commitcloud-update.t

84 lines
2.0 KiB
Perl
Raw Normal View History

#chg-compatible
$ setconfig extensions.treemanifest=!
$ setup() {
> cat << EOF >> .hg/hgrc
> [extensions]
> amend=
> [experimental]
> evolution=createmarkers
> EOF
> }
$ . "$TESTDIR/library.sh"
$ . "$TESTDIR/infinitepush/library.sh"
$ setupcommon
Setup server
$ hg init repo
$ cd repo
$ setupserver
$ cd ..
Setup the first client
$ hg clone ssh://user@dummy/repo first_client -q
$ cd first_client
$ setup
$ cd ..
Setup the second client
$ hg clone ssh://user@dummy/repo second_client -q
$ cd second_client
$ setup
$ mkcommit commit
$ hg log -r . -T '{node}\n'
7e6a6fd9c7c8c8c307ee14678f03d63af3a7b455
$ mkcommit commit2
commitcloud: incorporate infinitepush backups into commitcloud Summary: Merge the functionality of the infinitepushbackup extension (backing up commits to commit cloud) into the commitcloud extension. These two extensions are highly coupled, and the commitcloud extension monkey-patches the infinitepushbackup extension for a lot of its functionality. There is also a lot of code duplication between the two extensions which we can remove if they are part of the same extension. The infinitepushbackup commands (`hg pushbackup`, ...) are moved to subcommands of the `hg cloud` command, e.g. `hg cloud backup`. Each feature of the infinitepushbackup extension is moved to a new module in the commit cloud extension: The `background` module controls background execution of `hg cloud backup` and `hg cloud sync`. The `backupbookmarks` module tracks and updates scratch bookmarks for backups. This will be deprecated in the future. The `backupstate` module tracks whether or not a commit has been backed up. This is now tracked separately from backup bookmarks in a new file: `.hg/commitcloud/backedupheads.<remote-identifier>`. This also covers hidden commits, preventing a re-backup of previously backed up commits when they are unhidden. Previously the commitcloud extension customized the smartlog annotations: `Backing up` became `Syncing`, etc. This is now removed for consistency. Previously the infinitepushbackup extension disabled background backup by injecting an `infinitepushbackup.disableduntil` config entry into the user's config. This is now replaced with a state file at `.hg/commitcloud/autobackup`. Either option can be set to disable auto backup. Commit cloud will wait until both have expired before starting to run background backups again. Reviewed By: DurhamG Differential Revision: D15276939 fbshipit-source-id: 1d28989a157286e47d3dd97ca9c70b27f692dda1
2019-05-20 16:11:59 +03:00
$ hg cloud backup -q
$ mkcommit commitwithbook
$ hg push -r . --to scratch/commit --create -q
$ hg up -q null
$ mkcommit onemorecommit
$ hg log -r . -T '{node}\n'
94f1e8b68592fbdd8e8606b6426bbd075a59c94c
commitcloud: incorporate infinitepush backups into commitcloud Summary: Merge the functionality of the infinitepushbackup extension (backing up commits to commit cloud) into the commitcloud extension. These two extensions are highly coupled, and the commitcloud extension monkey-patches the infinitepushbackup extension for a lot of its functionality. There is also a lot of code duplication between the two extensions which we can remove if they are part of the same extension. The infinitepushbackup commands (`hg pushbackup`, ...) are moved to subcommands of the `hg cloud` command, e.g. `hg cloud backup`. Each feature of the infinitepushbackup extension is moved to a new module in the commit cloud extension: The `background` module controls background execution of `hg cloud backup` and `hg cloud sync`. The `backupbookmarks` module tracks and updates scratch bookmarks for backups. This will be deprecated in the future. The `backupstate` module tracks whether or not a commit has been backed up. This is now tracked separately from backup bookmarks in a new file: `.hg/commitcloud/backedupheads.<remote-identifier>`. This also covers hidden commits, preventing a re-backup of previously backed up commits when they are unhidden. Previously the commitcloud extension customized the smartlog annotations: `Backing up` became `Syncing`, etc. This is now removed for consistency. Previously the infinitepushbackup extension disabled background backup by injecting an `infinitepushbackup.disableduntil` config entry into the user's config. This is now replaced with a state file at `.hg/commitcloud/autobackup`. Either option can be set to disable auto backup. Commit cloud will wait until both have expired before starting to run background backups again. Reviewed By: DurhamG Differential Revision: D15276939 fbshipit-source-id: 1d28989a157286e47d3dd97ca9c70b27f692dda1
2019-05-20 16:11:59 +03:00
$ hg cloud backup -q
$ cd ..
Change the paths: 'default' path should be incorrect, but 'infinitepush' path should be correct
`hg up` should nevertheless succeed
$ cd first_client
$ hg paths
default = ssh://user@dummy/repo
$ cat << EOF >> .hg/hgrc
> [paths]
> default=ssh://user@dummy/broken
> infinitepush=ssh://user@dummy/repo
> EOF
$ hg paths
default = ssh://user@dummy/broken
infinitepush = ssh://user@dummy/repo
$ hg up 7e6a6fd9c7c8c8 -q
'7e6a6fd9c7c8c8' does not exist locally - looking for it remotely...
'7e6a6fd9c7c8c8' found remotely
pull finished in * sec (glob)
Same goes for updating to a bookmark
$ hg up scratch/commit -q
'scratch/commit' does not exist locally - looking for it remotely...
'scratch/commit' found remotely
pull finished in * sec (glob)
Now try to pull it
$ hg pull -r 94f1e8b68592 -q
Now change the paths again try pull with no parameters. It should use default path
$ cat << EOF >> .hg/hgrc
> [paths]
> default=ssh://user@dummy/repo
> infinitepush=ssh://user@dummy/broken
> EOF
$ hg pull
pulling from ssh://user@dummy/repo
searching for changes
no changes found