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

69 lines
1.9 KiB
Perl
Raw Normal View History

Create an ondisk bundlestore in .hg/scratchbranches
$ setconfig extensions.treemanifest=!
$ . "$TESTDIR/library.sh"
$ . "$TESTDIR/infinitepush/library.sh"
$ cp $HGRCPATH $TESTTMP/defaulthgrc
$ setupcommon
$ hg init master
$ cd master
Check that we can send a scratch on the server and it does not show there in
the history but is stored on disk
$ setupserver
$ cd ..
$ hg clone ssh://user@dummy/master client -q
$ cd client
$ mkcommit "initial commit"
$ mkcommit "another commit"
$ hg push -r . -q
$ mkcommit "stack 1 - commit 1"
$ mkcommit "stack 1 - commit 2"
$ hg up 0
0 files updated, 0 files merged, 3 files removed, 0 files unresolved
$ mkcommit "stack 2 - commit 1"
$ mkcommit "stack 2 - commit 2"
$ hg log -G -T '{shortest(node)} {desc} {phase}'
@ ccd5 stack 2 - commit 2 draft
|
o f133 stack 2 - commit 1 draft
|
| o d567 stack 1 - commit 2 draft
| |
| o bc62 stack 1 - commit 1 draft
| |
| o cf4b another commit public
|/
o 966a initial commit public
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
backing up stack rooted at bc62325caa65
remote: pushing 2 commits:
remote: bc62325caa65 stack 1 - commit 1
remote: d567dbbdd271 stack 1 - commit 2
backing up stack rooted at f13337e62e40
remote: pushing 2 commits:
remote: f13337e62e40 stack 2 - commit 1
remote: ccd5ee66f08a stack 2 - commit 2
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
commitcloud: backed up 4 commits
$ hg pull -r bc62
pulling from ssh://user@dummy/master
no changes found
adding changesets
adding manifests
adding file changes
added 0 changesets with 0 changes to 1 files
$ hg log -G -T '{shortest(node)} {desc} {phase}'
@ ccd5 stack 2 - commit 2 draft
|
o f133 stack 2 - commit 1 draft
|
| o d567 stack 1 - commit 2 draft
| |
| o bc62 stack 1 - commit 1 draft
| |
| o cf4b another commit public
|/
o 966a initial commit public