Commit Graph

43154 Commits

Author SHA1 Message Date
Durham Goode
fa84b05e94 backout: backout lock change that broke a bunch of tests
Summary: Commit 23f4cd4264ef broke a bunch of tests. Let's back it out.

Reviewed By: singhsrb

Differential Revision: D7646736

fbshipit-source-id: ace9b7be2c50f64ea382eaa72a350ead67b2a2a6
2018-04-16 16:21:52 -07:00
Martijn Pieters
b31ce422e2 sparse: provide sensible __repr__ strings for the custom matchers.
Summary: These matchers provide better values than the default now provided by mercurial.match.basematcher.

Reviewed By: quark-zju

Differential Revision: D7635868

fbshipit-source-id: c826390b3a5e3a2da897eeb54be22850e14403f6
2018-04-16 12:53:41 -07:00
Durham Goode
914d474bbf hg: add back flakey test lines
Summary:
A previous diff (143ad029b) lost these lines due to run-tests.py -i overwriting
them. We're seeing flakey test failures, so let's add them back.

Reviewed By: singhsrb

Differential Revision: D7641613

fbshipit-source-id: 4f0807ae88f442cfa3c84106e800ce9eba81e99e
2018-04-16 12:53:41 -07:00
Kostia Balytskyi
d8780740bd hg: make sure debuglock knows about malformed locks and undolog lock
Summary: Let's report that this lock cannot be read by Mercurial

Differential Revision: D7617178

fbshipit-source-id: 23f4cd4264ef6c685762d8f89e2c24ed2f224211
2018-04-16 12:53:41 -07:00
Kostia Balytskyi
aee6f00b5a hg: print an actionable error message if the lock file is malformed
Summary:
The recent changes to Mercurial made us less tolerant to wrongly-formatted
lock files.

Reviewed By: farnz

Differential Revision: D7586684

fbshipit-source-id: d7fa2151b8bb20f49c83941f7d3ef751fdbab2de
2018-04-16 12:53:41 -07:00
Liubov Dmitrieva
0cb0fd8709 improve smartlog for Commit Cloud user
Summary:
{F123775861}

Improve smartlog extension for Commit Cloud Users.

The difference with the current smartlog implementation is that in Commit Cloud world
a commit can be modified by a sequence of operations on another host and smartlog doesn't handle it.

After `hg cloudsync` run command we should be able to 'explain' in smartlog what has happened

this is important for user who opt out from 'updateonmove' feature because they will see two version of their stack all the time.

Reviewed By: DurhamG, quark-zju

Differential Revision: D7492969

fbshipit-source-id: 9ac2180f9abaa9ae596620b7f25d9ad8212deb28
2018-04-16 12:53:41 -07:00
Durham Goode
d0f5ffed67 hg: use ancestory for base tree finding
Summary:
Previously, when searching for base trees (i.e. trees that we already
have that we can tell the server so it can send us only parts we don't have) we
did a naive changelog scan for public commits. If the phases were messed up and
a local commit was marked public, this would result in us sending the server a
base commit it didn't have which would error out.

Let's make two changes to fix this.

1. Let's scan by history instead of by revision number.  This will
work in the future when we don't have rev numbers, and will hopefully also get
us closer base trees. It should also mean that if we fetch a server commit we
are less likely to encounter a local accidentally-public commit.

2. Let's only use commits that are ancestors of a remotename. This will help us
avoid local accidentally-public commits as well.

Reviewed By: quark-zju

Differential Revision: D7593363

fbshipit-source-id: 1df8f4fbc56a4c11ccb6d444c3d08297206ad91f
2018-04-16 12:53:41 -07:00
Jun Wu
29ea02db78 hint: silence all hints by HGPLAIN=hint
Summary: `HGPLAIN` could specify features. Let's use it.

Reviewed By: farnz

Differential Revision: D7639140

fbshipit-source-id: 5e9215221a8eb6a6a14f2eaba326c19feb114811
2018-04-16 10:35:15 -07:00
Liubov Dmitrieva
803d42b447 infinitepush: fix removal boolkmarks bug
Summary:
Currently if there is a bookmark ends with *, adding and removal such
a bookmark, removes all the bookmark with the same prefix from the table.

I made similar url encoding encode.

Reviewed By: StanislavGlebik

Differential Revision: D7631967

fbshipit-source-id: 607a37bd7761d65e0f3a21c44fb137a98a79a1bf
2018-04-16 10:35:14 -07:00
Liubov Dmitrieva
6f9fa2f143 infinitepush: do not expose word 'infinitepush' to users and make it clear that all that messages are about autobackup (in background)
Summary:
Make it clear that all that messages are about autobackup (in background)

Even if it is disabled, manual `hg pushbackup` works

Also, since we announced publicly about renaming infinitepush we should not use it in user facing messages.

Also, that commands enable/disable background cloudsync, probably later we should check if cloudsync is enabled and improve messages to be more precise.

Reviewed By: StanislavGlebik

Differential Revision: D7635640

fbshipit-source-id: 2461b1b45e181c6e24b59f707a17f2fd60d4bb0e
2018-04-16 10:35:14 -07:00
Mark Thomas
2bb3129118 commitcloud: cloudsync instead of pushbackup
Summary:
Replace the background `hg pushbackup` with a background `hg cloudsync` when
the repo is connected to a workspace.

Reviewed By: StanislavGlebik

Differential Revision: D7586412

fbshipit-source-id: 667ce46ffe83c654b642872633d9b86f29a2d788
2018-04-16 10:35:14 -07:00
Mark Thomas
88b23256ca commitcloud: push commits when syncing
Summary:
Make commitcloud push unsynced commits to the server before modifying the cloud
state.

At the moment, this uses an infinitepush push, calling the underlying push
functions directly (since commitcloud knows exactly which commits to push,
there is no point performing discovery to calculate them).  Infinitepush pushes
require the full draft stack to be included, but in the future, this will be
replaced with an even smaller push of just the changed commits to Mononoke.

The re-use of infinitepush's internal functions is a bit hacky.  Later on I
will refactor the common functionality out to a utility library.

Reviewed By: StanislavGlebik

Differential Revision: D7535890

fbshipit-source-id: 975028a63bd6d9377a37e224a0cfd95ae1f1e16d
2018-04-16 10:35:14 -07:00
Stanislau Hlebik
007636e77b add an option to disable remotefilelog shared cache updating
Summary:
We may want to use an experimental store for remotefilelog data. This store may
return incorrect data, and cache is going to be poisoned. To prevent it from
hapenning let's add an option that makes it possible to prevent cache
poisoning.

Reviewed By: farnz

Differential Revision: D7615453

fbshipit-source-id: 0ade7407b92a3a32c841f6f0214dc353c30bff59
2018-04-16 10:35:14 -07:00
David Lai
a2411f090d - Fix unused parameter warnings
Summary:
The changes in this diff comments out unused parameters.
This will allow us to enable -Wunused-parameter as error.

Reviewed By: yfeldblum

Differential Revision: D7634823

fbshipit-source-id: fed215b805e9396d14feada19a6e959a180218d4
2018-04-16 10:35:14 -07:00
Jun Wu
824875b403 matcher: define __repr__
Summary:
fsmonitor relies on `repr(match)` to check ignore changes. `__repr__` is not
defined by `negatematcher`. That leads to unnecessary fsmonitor state
invalidation.

This diff fixed that by defining `__repr__` on the base matcher class.

Reviewed By: singhsrb

Differential Revision: D7619774

fbshipit-source-id: df55390411cdb2d8e22e65efdeeb3b1db3bfa284
2018-04-13 21:51:55 -07:00
Jun Wu
5973652ce9 cleanup: remove perftweaks.disableheaddetection config
Summary: It is no longer used after D6745865. This diff removes it from the test.

Reviewed By: singhsrb

Differential Revision: D7619689

fbshipit-source-id: 0b023eb210a92ab132ad4e5df7a30af8a7f30e45
2018-04-13 21:51:55 -07:00
Jun Wu
de6194c103 setup: fix subversion help packaging
Summary: Make sure `help/subversion` gets copied into the package.

Reviewed By: ryanmce

Differential Revision: D7605690

fbshipit-source-id: c37271648e08dccd51b7f8dc410b833a170b0b99
2018-04-13 21:51:55 -07:00
Liubov Dmitrieva
10e9ded689 infinitepush: fix wrong message for hg getavailablebackups command
Summary: infinitepush: ugrent message fix for `hg getavailablebackups` command

Reviewed By: ryanmce

Differential Revision: D7620029

fbshipit-source-id: 8297ac4ae9c906a3aa3ae40a73186a86b25b38d9
2018-04-13 21:51:55 -07:00
Kaley Huang
a04a126324 seqimport-cl-outside-client test: use glob instead of "p4" for src
Summary: As title

Differential Revision: D7619022

fbshipit-source-id: 4ce8b5ed6131258ddd8b062d1597f9577cf47de5
2018-04-13 21:51:55 -07:00
Durham Goode
241ab4bdad hg: add hggit.disallowinitbare config option
Summary:
The hg servers were having trouble bootstrapping the .hg/git directory
because hggit was creating a bare repo and then later git fetches were super
slow. Those .hg/git directories should be managed by infra outside of hg, so
let's add a config knob to prevent hggit from creating a .hg/git repo.

Reviewed By: quark-zju

Differential Revision: D7586441

fbshipit-source-id: 7c2578123428aadaa6a94484e45dda6bd6b5a42d
2018-04-13 21:51:54 -07:00
Mark Thomas
e8908fa603 clienttelemetry: announce remote hostname only when stderr is a tty
Summary:
Some tools parse the output of hg, and the addition of the `connected to
hostname` line breaks them.

Fix this by changing the default behaviour of clienttelemetry to output
to stderr, but only when plain and quiet are not set, and when stderr
is a tty.

Differential Revision: D7616326

fbshipit-source-id: 6eb329c75a7e8cf6e5ab43aa5ac36be82d1d2e7d
2018-04-13 21:51:54 -07:00
Liubov Dmitrieva
b97248ebe0 Improvement for pullbackup, make filtering on mysql side rather then post
Summary:
filter host/reporoot in mysql if they are explicitly defined

With OnDemand developers often change hosts,
so it is better to return only revevant backups if options are provided

Reviewed By: StanislavGlebik

Differential Revision: D7604500

fbshipit-source-id: 4fdde451c4c99e3ebbaecb142c353d820c0214a1
2018-04-13 21:51:54 -07:00
Mark Thomas
c6e77dbb8f infinitepush: add --remote option to isbackedup
Summary:
Add a new `--remote` option to `hg isbackedup`.  If the commit is recorded as
backed up locally, this additionally checks the server to see if the commit is
available there.

Reviewed By: mjpieters

Differential Revision: D7599763

fbshipit-source-id: d344f187d6f8989f7b4dcd9fa47c1ec99e68d7d5
2018-04-13 21:51:54 -07:00
Martijn Pieters
926a3c222b fbclone: silence check-code test failure
Summary: Yes, the path to the script is hardcoded, because we want to make sure we test the right version, and not anything else found on the path.

Reviewed By: DurhamG

Differential Revision: D7600431

fbshipit-source-id: d08a2e98fa40823412e3d2925a3b2862ffb0f1a2
2018-04-13 21:51:54 -07:00
Mark Thomas
b3035ab1ef treedirstate: verify treedirstate after writing it
Summary:
Add a new config option `treedirstate.verify`, which, when set to true,
verifies the treedirstate tree after each update by re-opening it.

Differential Revision: D7599546

fbshipit-source-id: f4101a1eba1fc46dd08d8886918417520b7fbf53
2018-04-13 21:51:54 -07:00
Mark Thomas
b6bdd61b72 treedirstate: sync all data and metadata when flushing
Summary:
When appending to the dirstate tree file, treedirstate flushes all data, and
then calls `sync_data` to ensure the data has made it to the disk.  This ought
to be sufficient, as the data won't be used until the dirstate file has been
updated to include the new root, which happens via atomic rename later on.

We've seen some cases where the dirstate file contains an invalid root id.
Attempt to mitigate this by syncing all data when we flush the dirstate.  There
is a performance penalty to this, but it shouldn't be too much.

Differential Revision: D7599547

fbshipit-source-id: 9d55b80d04833d2a73f058487a62eab2da802214
2018-04-13 21:51:54 -07:00
Mateusz Kwapich
e846e43ff2 print the former bookmark target when removing bookmark
Summary: This makes it much easier to restore it manually.

Reviewed By: ryanmce

Differential Revision: D7585131

fbshipit-source-id: f7ee14b2411a73ab51563653932c48d29b36e7a3
2018-04-13 21:51:54 -07:00
Mateusz Kwapich
c74ac7db7f print the first line of hidden commit message
Summary: This way it's even more clear

Reviewed By: ryanmce

Differential Revision: D7585130

fbshipit-source-id: ce9e535f88f794fd19d7fd3db5171263fcd7865a
2018-04-13 21:51:54 -07:00
Adrian Catană
4bfc90f422 hg: log generaldelta and remotefilelog in sampling
Summary: Mercurial adds new requirements (generaldata + remotefilelog) to the temp file created by the wrapper. Needed for Rust migration

Differential Revision: D7586451

fbshipit-source-id: d9c3454055a76cafa7a0f93238bc837eba8e4a48
2018-04-13 21:51:54 -07:00
Martijn Pieters
1e0608239d fbclone: add sparse stats output
Summary:
These stats are hard-coded for now but will in a future diff be fetched from a regularly-updated source.

```
fbclone fbsource --dry-run
usage: fbclone REPO [options]
fbclone: error: fbsource is too large to clone without a sparse profile
Please use one of the following profile switches:

--fbandroid: The full FBAndroid profile, for general development on Android apps.
    file count: 644324 (35.83%)  size 10.3 GB

--fbcode: The full FBCode profile, for general development on backend code.
    file count: 950490 (52.85%)  size 14.8 GB

--fbobjc: The full FBObjC profile, for general development on iOS apps.
    file count: 620154 (34.48%)  size 9.18 GB

--xplat: The base profile for xplat development, separate from other profiles that include xplat
    file count: 269858 (15.01%)  size 4.41 GB

Or use --everything to get a full-size working copy
```

Differential Revision: D7502448

fbshipit-source-id: e37e4e31d355251e9dd2c390e3de7643fa38b80b
2018-04-13 21:51:54 -07:00
Martijn Pieters
abd2175e71 hg: actually run the tests in fb/tests
Summary:
There are tests in fb/tests we don't run as part of the test suite. Update the makefile and add buck infrastructure to run them.

 - Update the test-common-commands-hg.t test
 - Re-generate the fbcode/.hgignore file from the updated .gitignore

Reviewed By: quark-zju

Differential Revision: D7584511

fbshipit-source-id: d85800dccf0eb569a68db4b9e1d9796e3d7ac957
2018-04-13 21:51:54 -07:00
Phil Cohen
487a3fb991 repogenerator: add new files and directories over time
Summary:
The megarepo generator now adds new directories and files automatically. We now pick folders and paths randomly, with a configurable number of subdirectories and a configurable length for the leaf filename, and a fixed alphabet.

The array of directories and leaf filenames are prorated: they start out constrained and grow as we approach our desired number of commits to generate (`repogenerator.numcommits`), so as not to be too sparse initially.

The directory array is randomized initially, so the above proration doesn't lead to a trivial edit pattern (e.g. everything in a/* initially.)

Lastly, we now stop generation when we hit our goal.

Reviewed By: quark-zju

Differential Revision: D7572968

fbshipit-source-id: b60d60b6262962ee114cb19b0989e6a1af8c0549
2018-04-13 21:51:54 -07:00
Durham Goode
3e7392d050 hg: fix authormap name corruption in hgsubversion
Summary:
The AuthorMap in hgsubversion is currently derived from BaseMap which
has some strange behavior. During long running conversions, this caused some
names to be mangled.  For instance, if a long running conversion encounter a
commit with author 'abc' with converted name 'abc@uuid' and then later an author
'abcx' came along, it would convert the later name to 'abc@uuidx' because
BaseMap would match the prefix 'abc' with the beginning of the author name and
then reuse 'abc@uuid'. It then swapped the substring 'abc' from 'abcx' with
'abc@uuid' which resulted in the corrupt 'abc@uuidx'.

The fix is to add beginning and end markers to the regex name. The regex support
seems to be based around the ability to define custom regular expressions in
files to manipulate author/branch/tag names. In those cases the dictionary
__setitem__ call is passed a regular expression as a value. Since this patch
only affects the case where a string is passed, the regular expression scenario
will still work.

Reviewed By: singhsrb

Differential Revision: D7592383

fbshipit-source-id: 250b32d56782a6ec905cbd6620e0289fbdb523f0
2018-04-13 21:51:53 -07:00
Durham Goode
c679adb7d0 hg: remove bundlev1 from the supported outgoing versions
Summary:
Removes bundlev1 from the supported outgoing versions, but keeps a flag
around to force enable it if tests need it.

Reviewed By: quark-zju

Differential Revision: D7591176

fbshipit-source-id: 280cbbbe87848e3d6c9d448ce4f87c5eadeff720
2018-04-13 21:51:53 -07:00
Durham Goode
0f716a4f57 hg: remove test dependency on bundle1
Summary:
Bundle1 is being deprecated. These tests use it but don't need to, so
let's change them to use bundle2.

Reviewed By: quark-zju

Differential Revision: D7591178

fbshipit-source-id: 3fd46d3bbab9f7acd2f63dfb4f10c21b6d2c35e9
2018-04-13 21:51:53 -07:00
Durham Goode
a2f2208f71 hg: update commit interactive test to not use bundle1
Summary:
The commit interactive test was creating a bundle to test committing
binary files. It had no reason to need bundle1, so let's update it to bundle2.

Reviewed By: quark-zju

Differential Revision: D7591170

fbshipit-source-id: 964cd2cfc4368a89c956b30389ca74ab0b87a486
2018-04-13 21:51:53 -07:00
Durham Goode
6750ab25b0 hg: allow bundle1 for hg web tests
Summary:
These tests use hard coded url's that don't include bundlecaps, so it's
difficult to convert them to use the right bundlecaps for bundle2.

Reviewed By: quark-zju

Differential Revision: D7591165

fbshipit-source-id: 3424c448be8c713cac5b876438745414a59b7230
2018-04-13 21:51:53 -07:00
Durham Goode
f96219ef87 hg: update test-patchbomb to not use bundle1
Summary: We're deprecating bundlev1, so let's update this test to not use it.

Reviewed By: quark-zju

Differential Revision: D7591169

fbshipit-source-id: c3bd3496e46c57365beb6cc8380ed6d13110f7b3
2018-04-13 21:51:53 -07:00
Durham Goode
a54b05ee58 hg: use bundle2 for treemanifest backfill
Summary:
We weren't passing bundlecaps to the backfill pull, so we were getting
bundle1. Let's fix that

Reviewed By: quark-zju

Differential Revision: D7591167

fbshipit-source-id: 111e2967190dca17764c84e6d7be850644f222fd
2018-04-13 21:51:53 -07:00
Durham Goode
ba5c4cc4e9 hg: update tests to not use bundle1
Summary: We're deprecating bundle1, so let's update some tests.

Reviewed By: quark-zju

Differential Revision: D7591173

fbshipit-source-id: 806dfab377d2416e9fc8fe34bfebcaaf854e5c11
2018-04-13 21:51:53 -07:00
Durham Goode
db081e2c0c hg: update test-bundle2-format to not use bundlev1
Summary: We're deprecating bundlev1. Let's update this test.

Reviewed By: quark-zju

Differential Revision: D7591171

fbshipit-source-id: 0f840d318937016bec22d42577ab882eef9bedc9
2018-04-13 21:51:53 -07:00
Durham Goode
0ae182a740 hg: default to using bundle2 for pushrebase parts
Summary:
Pushrebase previously defaulted to bundlev1. Now that the server can
support v2, let's default to v2.

Reviewed By: quark-zju

Differential Revision: D7591174

fbshipit-source-id: bc5448490ff319543baedf3f5a1aab160a73ed27
2018-04-13 21:51:53 -07:00
Durham Goode
e02f8031d7 hg: change default bundle version to v2
Summary:
Bundlev1 is old and really shouldn't be used anywhere. Let's default to
v2.

Reviewed By: quark-zju

Differential Revision: D7591172

fbshipit-source-id: 2699e0b4dd8d1c1951f9dd92f0d9d300d935a04b
2018-04-13 21:51:53 -07:00
Durham Goode
24653e5e32 hg: add develwarn for bundle1 format
Summary:
We want to deprecate the bundlev1 format, so let's start by adding a
develwarn. Later diffs will update the tests to not use v1, then remove v1 as a
supported outgoing bundle entirely.

Reviewed By: quark-zju

Differential Revision: D7591166

fbshipit-source-id: 143ad029bfe4d141f91d6d5077342dfa44ad2944
2018-04-13 21:51:52 -07:00
Jun Wu
8e1acfaaa4 sshaskpass: disable echo more aggressively
Summary: Disable echo for "Enter passphrase for key".

Reviewed By: phillco

Differential Revision: D7592208

fbshipit-source-id: 79afb7bb49d952239571c1ddb8d3f5c32071d49b
2018-04-13 21:51:52 -07:00
Liubov Dmitrieva
4affcfaa2a infinitepush: MRU order of listing hosts and repo roots
Summary:
infinitepush: MRU order of listing hosts and repo roots to show host/repos with most recent first

this is for improving ux for those who have a lot of backups (T27713908)

Reviewed By: StanislavGlebik

Differential Revision: D7568128

fbshipit-source-id: 65bb6a4759298268fbd3109df57a2b9e198bd4c0
2018-04-13 21:51:52 -07:00
Mateusz Kwapich
e6ed96017c add --cleanup option
Summary:
This is meant to replace `arc cleanup`. Normally the commits corresponding
to landed Differential Revisions disappear on `hg pull` unless:
 * there's a bookmark pointing to a commit
 * the commit is currently checkout out

This command makes it easy to deal with such commits. Just run `hg hide -c`

Reviewed By: ryanmce

Differential Revision: D7350794

fbshipit-source-id: 3b77acbca01edc5bffda53023687f268dc8edb08
2018-04-13 21:51:52 -07:00
Mateusz Kwapich
323157e712 add a hint about hg undo to hide
Summary:
I know that `hg undo` is useful for undoing most of the commands
but hide is the one that a bit more sensitive because it's
the command to remove commits from your smartlog.

Also I'm planning on introducing additional, more powerful options
for hide and that could be useful for undoing them.

Reviewed By: ryanmce

Differential Revision: D7350795

fbshipit-source-id: fbc42674fe0ca4ac6300c08095897f624d41a2f3
2018-04-13 21:51:52 -07:00
Mateusz Kwapich
d2c8503e6f make hide more verbose
Summary:
Users would feel more comfortable using this command if they knew what it's
doing for them. Use `--quiet` to disable verbosity

Reviewed By: quark-zju

Differential Revision: D7380617

fbshipit-source-id: 0de46a858ec9c1c4a8cd9a55a5760bdcd8723424
2018-04-13 21:51:52 -07:00
Liubov Dmitrieva
e745c7b870 commitcloud: add config option that enables logging of requests
Summary:
add config option for very verbose output (print the requests)

this option is intended for troubleshooting

and it can greatly simplify troubleshooting

Reviewed By: StanislavGlebik

Differential Revision: D7572794

fbshipit-source-id: c0c5cfcc22ebc7799b02abd7bb08dc6a9bc4c6cd
2018-04-13 21:51:52 -07:00