mirror of
https://github.com/facebook/sapling.git
synced 2024-10-12 01:39:21 +03:00
81d738646f
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
29 lines
625 B
Perl
29 lines
625 B
Perl
|
|
$ . "$TESTDIR/library.sh"
|
|
$ . "$TESTDIR/infinitepush/library.sh"
|
|
$ setupcommon
|
|
|
|
Setup server
|
|
$ hg init repo
|
|
$ cd repo
|
|
$ setupserver
|
|
$ cd ..
|
|
|
|
Clone
|
|
$ hg clone ssh://user@dummy/repo client -q
|
|
$ cd client
|
|
|
|
Create log dir
|
|
$ mkdir $TESTTMP/logs
|
|
|
|
Setup background backup logging
|
|
$ setconfig infinitepushbackup.logdir=$TESTTMP/logs
|
|
$ mkcommit first
|
|
|
|
Check that logging fails because of wrong permissions
|
|
$ hg cloud backup --background
|
|
$ waitbgbackup
|
|
$ hg cloud backup --background --debug
|
|
$TESTTMP/logs directory has incorrect permission, background backup logging will be disabled
|
|
$ waitbgbackup
|