sapling/infinitepush
Stanislau Hlebik fd8f0625ef infinitepush: add hg backup command
Summary:
Backups all new non-extinct [1] commits to bundlestore.

When it is called for the first time `hg backup` will backup all draft
visible commits. Next backups will save only new commits since the last
backup (it is recorded in `.hg/store/infinitepushbackuptip`[2]).

It's an initial implementation. Later the following features will be added:
1) It will be called automatically whenever user creates or strips commits
or even creates or deletes bookmarks
2) It will also save all local bookmarks and all local heads
(probably only visible).

Note: calling `pushcmd` directly does not set default values for opts. That means that `--to` will be None and `_scratchbranchmatcher` will throw exception. Let's add a check to ensure that `--to` is never None.

[1] I also want to backup extinct commits (i.e. obsolete invisible commits).
But it will require bigger changes in discovery algorithm, so I'd leave it
for later.
[2] The name is a bit verbose. But I want to keep `infinitepush` part to make
it easier to debug problems.

Test Plan: Run `test-infinitepush-*`

Reviewers: rmcelroy, mitrandir, durham

Reviewed By: durham

Subscribers: mjpieters, #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D4147651

Tasks: 12479677

Signature: t1:4147651:1479229440:3eb38880c14f18e9a2fb4eaba44bedf079bca506
2016-11-16 02:13:17 -08:00
..
integrationtests infinitepush: move integration test to the rool level directory 2016-08-31 01:44:59 -07:00
tests infinitepush: fix pyflakes 2016-10-24 06:08:56 -07:00
__init__.py infinitepush: add hg backup command 2016-11-16 02:13:17 -08:00
fileindexapi.py infinitepush: add mysql waittimeout server-side 2016-11-01 01:44:38 -07:00
indexapi.py infinitepush: add mysql waittimeout server-side 2016-11-01 01:44:38 -07:00
README infinitepush: sample implementation 2016-08-26 06:09:01 -07:00
sqlindexapi.py infinitepush: add mysql waittimeout server-side 2016-11-01 01:44:38 -07:00
store.py infinitepush: fix pyflakes 2016-10-24 06:08:56 -07:00

## What is it?

This extension adds ability to save certain pushes to a remote blob store
as bundles and to serve commits from remote blob store.
The revisions are stored on disk or in everstore.
The metadata are stored in sql or on disk.

## Config options

infinitepush.branchpattern: pattern to detect a scratchbranch, example
                            're:scratch/.+'

infinitepush.indextype: disk or sql for the metadata
infinitepush.reponame: only relevant for sql metadata backend, reponame to put in
                       sql

infinitepush.indexpath: only relevant for ondisk metadata backend, the path to
                        store the index on disk. If not set will be under .hg
                        in a folder named filebundlestore

infinitepush.storepath: only relevant for ondisk metadata backend, the path to
                        store the bundles. If not set, it will be
                        .hg/filebundlestore