Commit Graph

147 Commits

Author SHA1 Message Date
Jun Wu
ff3d5e9c4a codemod: use policy.importmod
Summary:
Do not `from mercurial.cext import ...`. That breaks pure.
Besides, add `from __future__ import absolute_import` for files I touched.

Test Plan: arc unit

Reviewers: #mercurial, simonfar

Reviewed By: simonfar

Subscribers: mjpieters

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

Signature: t1:5156067:1496252444:eb620a56c5bd852017ce2b2d41a12631d9d0866f
2017-05-31 10:46:16 -07:00
Stanislau Hlebik
4136d61d32 infinitepush: reduce pushbackup memory usage
Summary:
Previously `_getrevstobackup()` would load manifest for each commit in memory
only to check if a file was deleted in this commit or not. Manifest can be
quite big and since every loaded flatmanifest is cached in fastmanifest then
memory usage can be huge.
Since we are doing this only to check if there are any commits that were
downloaded to the client without filelogs and then were stripped server-side.
This cases are rare and it would be easier to track these commits in the
config file.

Test Plan: arc unit

Reviewers: #mercurial, mjpieters, quark

Reviewed By: quark

Subscribers: mjpieters

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

Tasks: 15389402

Signature: t1:5111372:1495848867:4028bd48313ac0e2022c3695195bedc6eda80abf
2017-05-29 12:54:26 -07:00
Durham Goode
6e542135ee imports: update c extension imports
Upstream has moved various c extension into mercurial.cext
2017-05-23 15:26:08 -07:00
Durham Goode
e34660b057 commands: update to use registrar instead of cmdutil
Summary: Upstream has deprecated cmdutil.commands() in favor of registrar.commands()

Test Plan: Ran the tests

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: mjpieters

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

Signature: t1:5106486:1495485074:0e20f00622cc651e8c9dda837f84dd84cc51099e
2017-05-22 13:38:37 -07:00
Stanislau Hlebik
036f4a7f7b infinitepush: use unfiltered() repo in isbackedup command
Summary:
One of the heads may point to filtered commit and isbackedup command fails in
this case. Let's use repo.unfiltered()

Test Plan: arc unit

Reviewers: #mercurial, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, mjpieters, #sourcecontrol

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

Signature: t1:5001977:1493907725:f6a138bd4e2cae48b64152fceaf73660ea91f43b
2017-05-17 07:27:52 -07:00
Stanislau Hlebik
5bb6893d41 infinitepush: cleanup temp files
Summary: Infinitepush didn't clean up temp files during pulls.

Test Plan:
Choose any hg server that's not in vip (for example, hg014.lla2).
Run `hg pull ssh://hg014.lla2.facebook.com//data/scm/fbsource -r INFINITEPUSH_COMMIT_HASH`
Check that new /tmp/tmp* file has appeared.
Install fixed infinitepush extension on the server.
Run the same command again, make sure it works fine.

Note: no new unittests, because temp filenames are random and that's difficult to test.

Reviewers: #mercurial, dschatzberg, tja

Reviewed By: tja

Subscribers: mjpieters

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

Tasks: 17599765

Signature: t1:5077767:1495025042:d209d1e5342442ac8b05a4c80748780bbf36846c
2017-05-17 06:42:04 -07:00
Stanislau Hlebik
8b3bb637b4 infinitepush: fix skipping downloading bundle
Summary:
`bundlefile` variable wasn't initialized if `head in nodestobundle` were true.
Even worse, the previous version of `bundlefile` were used. That means that in
some cases infinitepush sends back a wrong bundle.

Adding a unittest is quite tricky because problem shows up only in one rare
case. Example: we have a stack of 2 commits A and B and each commit in the
stack has a bookmark that points to it. Then `getbundlechunks()` `heads`
parameter contains two heads: commit A and commit B in undefined order.
If it happens that first element in the list is commit A we'll create a bundle
that contains only commit A. And we'll reuse the same bundle when we process
commit B. That means that we'll send the same bundle with commit A twice,
but no bundles with commit B.

I refactored the code to make sure we won't get the same bug in
the future.

Test Plan: arc unit

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: durham, mjpieters, #sourcecontrol

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

Tasks: 17719083, 15389402

Signature: t1:4969547:1493749313:587f9e4446a3c21b47c081a0fe4cd9e200dab5cd
2017-05-03 00:31:24 -07:00
Stanislau Hlebik
9a02f3a792 infinitepush: use infinitepush path instead of default push
Summary:
As @quark suggested, it's better to use `infinitepush` path instead of
default-push, because `default-push` is facebook-specific configuration.

Test Plan: arc unit

Reviewers: #mercurial, rmcelroy

Reviewed By: rmcelroy

Subscribers: quark, rmcelroy, mjpieters, #sourcecontrol

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

Tasks: 15389402

Signature: t1:4962324:1493727112:35c45c57a527d2de5a35ea83e1031dc1908ac28e
2017-05-02 05:50:10 -07:00
Stanislau Hlebik
1642b009fa infinitepush: add isbackedup command
Summary:
Command that checks if a commit was backed up.
It does it by checking if revisions are in local backup state.

Test Plan: Run unit tests and lints

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: durham, mjpieters, #sourcecontrol

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

Tasks: 17519836

Signature: t1:4938072:1493072854:291765bb59d327db8504feb47d6089818ae1e11a
2017-04-25 01:09:28 -07:00
Stanislau Hlebik
d610259241 infinitepush: delete bkpstate from shared working copy
Summary:
infinitepushbackup.tempcleanworkingcopiesbackups option sends special command
to clean backup bookmarks from the server for the shared working copy (i.e.
if we have main repo `fbsource` and shared working copy `fbsource2` we want
to have backups only for `fbsource` not for `fbsource` and `fbsource2`).
Before this diff cleanup commands were send for every backup.
This diff makes them send only if backup state file is present.

Test Plan: arc unit

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: durham, mjpieters

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

Signature: t1:4929489:1493075761:a408300338a10864043b538540d03880a49c4e1a
2017-04-25 01:09:28 -07:00
Stanislau Hlebik
c15b2d9958 infinitepush: read backup state file from real repo not from shared working copy
Test Plan: arc unit

Reviewers: #mercurial, ikostia

Reviewed By: ikostia

Subscribers: mjpieters

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

Signature: t1:4929323:1492785417:609a5569ad49f1f9e938908c30214a7b0a89ffb6
2017-04-24 01:07:20 -07:00
Stanislau Hlebik
b6eb201c3f infinitepush: fix backup of commits with removed files
Summary:
There was a bug that caused commits with file deletions to not be backed up.
This diff fixes it by first checking if file exists in the commit and only
then downloading context of the file.

Note:
In tests I had to ignore stdout of `hg pushbackup` because the output was
different on macs and linux.
On linux there was an additional line

  remote: abort: data/committostripfirst.i@091b63e5e4: no match found!

Probably mac's remotefilelog closes stdout/stderr earlier, but I wasn't
able to find a root cause.

Test Plan: Run unit tests

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: quark, mjpieters

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

Tasks: 15389402

Signature: t1:4929244:1492791804:77b2baa9eb54a53120a955e72e6c132be5db6b44
2017-04-21 10:24:14 -07:00
Stanislau Hlebik
da24919aa2 infinitepush: handle old changegroup format correctly server-side
Summary:
`exchange.readbundle()` can return bundle2 unbundler or changegroup cg1unpacker.
In case of cg1unpacker let's just read it from the stream

Test Plan: arc unit

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: quark, mjpieters, #sourcecontrol

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

Tasks: 15389402

Signature: t1:4913313:1492623174:72abe4d1e449ae31d78a6c98b554c0406e8a2ea2
2017-04-20 07:30:51 -07:00
Stanislau Hlebik
928a96b602 infinitepush: use ui.debug() instead of ui.warn()
Summary: To avoid spamming users

Test Plan: Run tests

Reviewers: #mercurial, rmcelroy

Reviewed By: rmcelroy

Subscribers: mjpieters, #sourcecontrol

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

Signature: t1:4883447:1492088221:3649b14ff514957d2f412aae2647ca1b20ef5fea
2017-04-17 23:44:26 -07:00
Stanislau Hlebik
57dc185f42 infinitepush: don't make separate backups for different working copies
Summary:
Previously we had separate backup per working copy. That's very confusing
since all these working copies shares the same repo. This diff fixes it and
also adds config option to clean unnecessary working copy server-side.

Test Plan: Run infinitepush unittest

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: rmcelroy, quark, mjpieters, #sourcecontrol

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

Signature: t1:4876230:1492025747:3579e5046efc2ed309044fc3335c36ac4f7bdd04
2017-04-13 04:58:11 -07:00
Stanislau Hlebik
efbec7652d infinitepush: fix security concern
Summary: Check owner of a log file before writing to it. See comments for details

Test Plan: arc unit

Reviewers: #mercurial, simpkins

Reviewed By: simpkins

Subscribers: net-systems-diffs@fb.com, mjpieters, #sourcecontrol

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

Tasks: 17155924

Signature: t1:4842933:1491861137:e8a027fb7a930c0c5f553c75cb84214d24f66ce3
2017-04-12 01:12:23 -07:00
Stanislau Hlebik
9878a16264 infinitepush: do not rebundle if not necessary
Summary:
Profiles show that rebundling is the slowest part in infinitepush that can
take up to 10 secs to run. In many cases rebundling is not needed at all.
For example, if bundle contains only one head and that head was requested
during pull then rebundling can be avoided at all.

Test Plan: arc unit

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: quark, mjpieters, #sourcecontrol

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

Tasks: 15389402

Signature: t1:4834982:1491450862:fe6984e6384676bcbab1c3fb9f0a47cb93902d0d
2017-04-06 02:53:28 -07:00
Stanislau Hlebik
a50af234cb infinitepush: run backup check before backup from time to time
Summary:
It's a good way to check if backup is consistent. If backup is not consistent
then we set special exit code that will be logged. It let's us easily find users
with inconsistent backups and fix it.

Test Plan: arc unit

Reviewers: #mercurial

Subscribers: mjpieters, #sourcecontrol

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

Tasks: 15389402
2017-04-05 00:56:28 -07:00
Stanislau Hlebik
233dca479c infinitepush: variable renaming and refactoring
Summary:
Give better names to the variables to underline what these variables really
store. And a bit of code movement.

Test Plan: arc unit

Reviewers: #mercurial

Subscribers: mjpieters, #sourcecontrol

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

Tasks: 15389402
2017-04-05 00:56:28 -07:00
Stanislau Hlebik
a1efbe09d2 infinitepush: remove useless checks from _filterbookmarks()
Summary:
`headstobackup` won't point to bad nodes and they are only draft.
No need to check one more time

Test Plan: arc unit

Reviewers: #mercurial

Subscribers: mjpieters, #sourcecontrol

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

Tasks: 15389402
2017-04-05 00:56:28 -07:00
Stanislau Hlebik
12a13d9b3a infinitepush: do not backup extinct heads
Summary:
Previously we backed up extinct node if bookmark pointed to them. But this not
is not present in the bundle because `findcommonoutgoing()` intentionally skips
extinct and secret commits. In this case we'll have infinitepush bookmark that
points to non-existent infinitepush commit. To fix it let's filter extinct heads

Test Plan: arc unit

Reviewers: #mercurial

Subscribers: mjpieters, #sourcecontrol

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

Tasks: 15389402
2017-04-05 00:56:28 -07:00
Stanislau Hlebik
8c7c7319dd infinitepush: record nodesmetadata
Summary: Let's add a table that will store metadata about infinitepush nodes.

Test Plan: arc unit

Reviewers: #mercurial

Subscribers: mjpieters, #sourcecontrol

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

Tasks: 16899722
2017-03-30 02:07:30 -07:00
Stanislau Hlebik
526184c5c4 infinitepush: pass reponame to 'DELETE from bookmarkstonode...' query
Summary:
I forgot to insert it, fixing it now. It didn't cause problems before because
we delete bookmarks only during backups and backups usually have different
bookmark names

Test Plan: arc unit

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: mjpieters, #sourcecontrol

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

Tasks: 15389402

Signature: t1:4795310:1490810441:0a044ebe776c65b03c633017c33771d32bfa3e77
2017-03-30 01:16:06 -07:00
Stanislau Hlebik
d01476eccd infinitepush: remove unused method
Test Plan: arc unit

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: mjpieters, #sourcecontrol

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

Signature: t1:4795296:1490810421:d9489ffd1b251906d39920a008b00e2e5b72fd84
2017-03-30 01:16:06 -07:00
Stanislau Hlebik
1c556e7a8c infinitepush: move sql schemas to schema.sql file
Summary: Let's avoid copy-paste.

Test Plan: arc unit

Reviewers: #mercurial, rmcelroy, quark

Reviewed By: rmcelroy, quark

Subscribers: rmcelroy, quark, mjpieters, #sourcecontrol

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

Signature: t1:4778949:1490700154:51f6144cdb7682d03c0f6af88691fd907178319c
2017-03-29 03:21:30 -07:00
Stanislau Hlebik
2387e4a4ae infinitepush: remove unused tests
Summary:
Real infinitepush tests are in fb-hgext/tests. These tests are useless and we
never run them. Let's remove them.

Test Plan: arc unit

Reviewers: #mercurial, rmcelroy

Reviewed By: rmcelroy

Subscribers: mjpieters, #sourcecontrol

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

Signature: t1:4778858:1490700082:69bcd2adee2a93ec5d3886747d47bc30b18f8944
2017-03-29 03:11:26 -07:00
Stanislau Hlebik
e094644fb2 infinitepush: wrap findcommonincoming if nodes are requested
Summary:
Previously we don't set findcommonincoming to True, and that bug was unnoticed
because we send this info anyway in server-side `getbundlechunks()` function.

But next diff in the stack uses a fast path server-side which won't work if
fincommonincoming is not set to True.

Test Plan: arc unit

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: durham, mjpieters, #sourcecontrol

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

Tasks: 15389402

Signature: t1:4770830:1490719209:c251002d992e244580b7dbfeca0c30dff95734d2
2017-03-29 03:10:12 -07:00
Stanislau Hlebik
099ba152f5 infinitepush: add getavailablebackups command
Summary:
Command to list available backups for the user.
--json will be used by automation

Test Plan: arc unit

Reviewers: #mercurial, simonfar

Reviewed By: simonfar

Subscribers: mjpieters, #sourcecontrol

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

Tasks: 15389402

Signature: t1:4728729:1490005762:41b9683cb7dfc9d84ae1032c807d1f0c3fe60dbf
2017-03-29 03:00:46 -07:00
Stanislau Hlebik
44997262d3 infinitepush: call util.shortuser() directly
Summary:
ui.shortuser() doesn't call util.shortuser() if ui.verbose equals to True.
But in our case it's very important to always use short username because
we'll get broken backups otherwise. Let's call util.shortuser() directly.

Test Plan: arc unit

Reviewers: #mercurial, mjpieters

Reviewed By: mjpieters

Subscribers: mjpieters, #sourcecontrol

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

Tasks: 15389402

Signature: t1:4721949:1489717973:b7e59929f530578e060b8cdef94ef92b54fa2647
2017-03-20 01:38:06 -07:00
Jun Wu
5404cd9a3c codemod: get rid of ui.backupconfig
Summary:
The upstream will remove `ui.backupconfig` soon(tm). Let's migrate our code
to `ui.configoverride` to avoid future breakages.

Test Plan: `arc unit`

Reviewers: #sourcecontrol, simonfar

Reviewed By: simonfar

Subscribers: simonfar, mjpieters

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

Signature: t1:4734300:1489803960:a4101d6bc95ab62af67f0076b8e21f57cf926e13
2017-03-17 19:42:50 -07:00
stash@fb.com
d36fb477cb infinitepush: fix the build
Summary:
On macos sshpeer flushes remote output later and it causes tests to fail. Let's
add a call to cleanup() to make sure the output is flushed.

This diff also makes remotefilelog test more robust.

Test Plan: Run tests on macos

Reviewers: #mercurial, tja, mitrandir

Reviewed By: mitrandir

Subscribers: mjpieters, #sourcecontrol

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

Tasks: 15389402

Signature: t1:4721276:1489669109:4ce59f4a1d224d57dbb7c1eb341c4e6a659d2e8c
2017-03-16 08:35:15 -07:00
Stanislau Hlebik
6b7e94a53f infinitepush: add --all option to debugcheckbackup
Summary:
By default debugcheckbackup checks only one backup for the user.
With --all option it checks all backups for the user from all host/reporoots

Test Plan: arc unit

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: durham, mjpieters, #sourcecontrol

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

Tasks: 15389402

Signature: t1:4700993:1489548921:800d08f420acc8ef4f807ffd17b31837dbb3fe82
2017-03-16 02:22:39 -07:00
Stanislau Hlebik
3553b5e9bb infinitepush: do not restore bookmark if node is not present
Test Plan: arc unit

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: mjpieters, #sourcecontrol

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

Tasks: 15389402

Signature: t1:4700979:1489548965:bab126d96adc827be84a2fc8939f6c03b0ef6599
2017-03-16 02:22:39 -07:00
Stanislau Hlebik
280028dd61 infinitepush: add maxheadstobackup option
Summary:
Backing up very big repo can cause problems. And very often old commits are
not necessary at all. Let's add a config option to limit the number of heads
that are being backed up.

Test Plan: arc unit

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: durham, mjpieters, #sourcecontrol

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

Tasks: 15389402

Signature: t1:4700965:1489549163:4e2c121f01debd7b495486a1f3b062926873399d
2017-03-16 02:22:39 -07:00
Stanislau Hlebik
2faa6709ca infinitepush: change backup state file format
Summary:
Previously we saved bookmark hash and revision number as state of
the last backup. Storing last backed up revision is error-prone. I saw
a few corrupted backups where bookmarks pointed to non-backed up
nodes. Also this approach puts more pressure on mysql bundle index.
On every backup it first deletes all existing backup bookmarks and then it
writes new bookmarks. Even if user changed one head or one bookmark
(and that is the usual case) current approach still deletes bookmarks first
and then rewrites them.

Instead let's store all backed up heads and bookmarks locally in json format.
Json was chosen because it's simple and human-readable. Then during backup
let's compare last backed up state to the current state of the repo, and send
to the server only the difference.

Test Plan: arc unit

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: durham, mjpieters, #sourcecontrol

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

Tasks: 15389402

Signature: t1:4700930:1489613249:a34369bf53e0718c22258304493dfa27b578857f
2017-03-16 02:22:39 -07:00
Stanislau Hlebik
897faf2d06 infinitepush: refactor and rename _getbackupstate
Summary:
Let's rename _getbackupstate() to _downloadbackupstate() because it actually
downloads it from the server. Also return class instead of tuple

Test Plan: arc unit

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: mjpieters, #sourcecontrol

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

Tasks: 15389402

Signature: t1:4713633:1489612870:3439a6a99ef311bf96784b3b1e53d7e9b94c0713
2017-03-16 02:22:39 -07:00
Stanislau Hlebik
5ee9ad7feb infinitepush: add timestamp to the logs
Test Plan: arc unit

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: durham, mjpieters, #sourcecontrol

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

Tasks: 16474976

Signature: t1:4700897:1489550188:1c6346ff158cec32df92934b585fc9cb983397c6
2017-03-16 02:20:02 -07:00
Stanislau Hlebik
314a434baf infinitepush: better client-side logging
Summary: New logging will have rotation and will separate different users and repos

Test Plan: arc unit

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: durham, mjpieters, #sourcecontrol

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

Tasks: 16474976

Signature: t1:4689191:1489172091:d304d4b19ae6cf52f86c11f442fa760b50d1fdf9
2017-03-14 02:13:16 -07:00
Stanislau Hlebik
ddf10d0f6e infinitepush: add debugwaitbackup command
Summary:
For now these command will be used in test because
`wait_for_background_backup.py` tied to the backup state file. And every change
to this file requires change to wait_for_background_backup.py. Let's create
simple internal backup command.

Test Plan: arc unit

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: durham, mjpieters, #sourcecontrol

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

Tasks: 15389402

Signature: t1:4667056:1489024344:6c43241e42b7c418baa4e1542f303239ba887c45
2017-03-13 01:35:30 -07:00
Stanislau Hlebik
af7ad809cc infinitepush: add lock for backup command
Summary:
There can be multiple backup processes running at the same time. Since these
processes can be quite heavy it makes sense to limit them. Let's use lock file
to do that.

Test Plan: arc unit

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: durham, mjpieters, #sourcecontrol

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

Tasks: 15389402

Signature: t1:4667020:1489170813:f2a685b1c224c553d3ee004d89d3eeeca816e824
2017-03-13 01:32:32 -07:00
Stanislau Hlebik
2d7e54cf5a infinitepush: rename nodes to hexnodes
Summary: These are actually hexnodes

Test Plan: arc unit

Reviewers: #mercurial, simonfar

Reviewed By: simonfar

Subscribers: mjpieters, #sourcecontrol

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

Tasks: 15389402

Signature: t1:4667011:1488991240:e0ba5e0bd58f753235e600ed31858bb565c62e73
2017-03-11 09:22:50 -08:00
Stanislau Hlebik
4c84f339fa infinitepush: add debugcheckbackup
Summary:
Command that checks that every head and bookmark node is present in the
bundlestore

Test Plan: arc unit

Reviewers: #mercurial

Subscribers: #sourcecontrol

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

Tasks: 15389402
2017-03-07 01:21:44 -08:00
Stanislau Hlebik
fcf0eb5724 infinitepush: move common restore functionality from pullbackup
Summary: This functionality will be used in command to check backup consistency

Test Plan: arc unit

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: mjpieters, #sourcecontrol

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

Tasks: 15389402

Signature: t1:4658433:1488828061:49aa5bfeba922d617cf1aab393f5e9f598aa33a4
2017-03-07 01:21:44 -08:00
Stanislau Hlebik
e3fa685103 infinitepush: rename node* to hexnode*
Summary: These are actually hexnodes, not nodes

Test Plan: arc unit

Reviewers: #mercurial, durham, mjpieters

Reviewed By: durham, mjpieters

Subscribers: mjpieters, #sourcecontrol

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

Tasks: 15389402

Signature: t1:4658432:1488828083:957018757fbe7031183bd54734702d4b67465fd8
2017-03-07 01:21:44 -08:00
Stanislau Hlebik
71158d5a7f infinitepush: first ask for hostname, then for reporoot
Summary:
This small change makes a way better user experience. Users usually have one
big repo per host, but they may have many hosts (for example, laptop and
devserver). If we ask for reporoot first then it's very likely that next
`pullbackup` invocation will fail because there will be ambigious hosts.
Let's switch the order.

Test Plan: arc unit

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: quark, mjpieters, #sourcecontrol

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

Tasks: 15389402

Signature: t1:4649946:1488561645:330590fcf1dcd4af7fb572c5d4ccfd8a5ab78c60
2017-03-06 00:56:18 -08:00
Stanislau Hlebik
1aa37581ea infinitepush: pass dest to pull function
Summary: Previously dest wasn't passed to pull command. This diff fixes it.

Test Plan: arc unit

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: mjpieters, #sourcecontrol

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

Tasks: 15389402

Signature: t1:4643461:1488501956:4684805c618d55edcf4ee1ae13d34a87e92150e6
2017-03-06 00:50:30 -08:00
Stanislau Hlebik
9a343a289b infinitepush: add user cmd-line option
Summary: Option to specify whose backup to restore

Test Plan: arc unit

Reviewers: #mercurial

Subscribers: #sourcecontrol

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

Tasks: 15389402
2017-03-06 00:44:18 -08:00
Stanislau Hlebik
6218797f5c infinitepush: pass username instead of ui
Summary:
Next diff will add special option to specify whose backup to restore.
This diff does a necessary refactoring

Test Plan: arc unit

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: mjpieters, #sourcecontrol

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

Tasks: 15389402

Signature: t1:4650282:1488562203:632a8c84d6d537663bd7d94ce9dfd18a4498ccfb
2017-03-06 00:44:18 -08:00
Stanislau Hlebik
666f7299d3 infinitepush: reuse bundlerepo
Summary:
This diff is part of the series to avoid downloading the same bundle
a few times.

Finally reuse the same bundlerepo.

Test Plan: arc unit

Reviewers: #mercurial

Subscribers: mjpieters, #sourcecontrol

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

Tasks: 15389402
2017-03-06 00:40:49 -08:00
Stanislau Hlebik
29031ff4a1 infinitepush: close all bundlerepos at once
Summary:
This diff is part of the series to avoid downloading the same bundle
a few times.

Now close all bundlerepos at once not one by one. This is necessary because
bundlerepos will be reused.

Test Plan: arc unit

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: durham, mjpieters, #sourcecontrol

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

Tasks: 15389402

Signature: t1:4612089:1488501776:e9fc2863adebc69bf44fa5dcb1610612027508f6
2017-03-06 00:40:49 -08:00