sapling/tests/test-commitcloud-backup-all.t

73 lines
2.0 KiB
Perl
Raw Normal View History

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
$ enable amend
$ setconfig extensions.treemanifest=!
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
$ . "$TESTDIR/library.sh"
$ . "$TESTDIR/infinitepush/library.sh"
$ setconfig extensions.commitcloud=
$ setupcommon
$ hginit server
$ cd server
$ setupserver
$ setconfig remotefilelog.server=true
$ touch base
$ hg commit -Aqm base
$ cd ..
$ hgcloneshallow ssh://user@dummy/server shallow -q
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *.*s (glob)
$ cd shallow
Test pushing of specific sets of commits
$ drawdag <<'EOS'
> B C
> | |
> A1 A2 D1 D2 D3 E1 E2
> \| \| | \ /
> . . . .
> # amend: A1 -> A2
> # amend: D1 -> D2 -> D3
> # rebase: E1 -> E2
> EOS
$ hg book -r $E1 pinnedvisible --hidden
$ hg up $D2 -q --hidden
Check backing up top stack commit and mid commit
$ hg cloud check -r $A1 -r $D2 -r $E1
* not backed up (glob)
* not backed up (glob)
* not backed up (glob)
$ hg cloud backup --traceback
backing up stack rooted at 64164d1e0f82
remote: pushing 2 commits:
remote: 64164d1e0f82 A1
remote: 796f1f48de85 B
backing up stack rooted at d0d71d09c927
remote: pushing 2 commits:
remote: d0d71d09c927 A2
remote: daeeb2f180d6 C
backing up stack rooted at d79a807cba78
remote: pushing 1 commit:
remote: d79a807cba78 D2
backing up stack rooted at eccc11f58a56
remote: pushing 1 commit:
remote: eccc11f58a56 D3
backing up stack rooted at 42952ab62cec
remote: pushing 1 commit:
remote: 42952ab62cec E1
backing up stack rooted at 4903fdffd9c6
remote: pushing 1 commit:
remote: 4903fdffd9c6 E2
commitcloud: backed up 8 commits
$ hg cloud check -r $A1 -r $D2 -r $E1
64164d1e0f82f6a670c84728b83061df1b126b5c backed up
d79a807cba78db45ec042b74da65ebfd6d58eadd backed up
42952ab62cecf85e36eaab6965b6bf3f5e3e9fe1 backed up
$ hg cloud check -r $D1 --hidden
7c8a43610cd6d316f9bec941fa2677e5c7a90bf5 not backed up