Commit Graph

12877 Commits

Author SHA1 Message Date
Jun Wu
68e346c962 fsmonitor: send state about filemerge
Summary:
The merge process could be interactive, and tools like Hack wants to
scan changed files when the user is resolving conflicts. There is a
"hg.update" watchman state and "state-enter", "state-exit" events that help
detect the "update" process. However, the interactive "ui.merge" process is
inside the "update" process and cannot be easily decoupled confidently (i.e.
hard to end "update" state before doing the merge).

It's also hard to have a general "merge" state due to the current watchman
design. Because a merge might be across multiple hg processes (ex.
non-interactive ui.merge, hg exits, returns to the shell, and the user invokes
`hg resolve --mark` to end the merge state), and the current watchman
implementation will force end all states associated with a watchman socket
connection. If a hg process exits, it will disconnect from the watchman socket
and the merge state will be forced terminated, although there is still
unresolved conflicts.  Previous attempt on this is D7286181.

This patch adds a "hg.filemerge" watchman state that could make watchman
users aware of ongoing interactive merge resolutions. The event fires when an
external merge tool is called, per conflicted file. It is strictly a sub
interval of an "update" state, which is within a single process. So it does not
have the problem that a "merge" state has.

Differential Revision: D7648929

fbshipit-source-id: 858beba1bff261e8da5bd4d8b08a388dcbc8a9ef
2018-04-19 13:17:08 -07:00
Jun Wu
50fc1b7bc6 tests: add a utility to sort dict outputs
Summary:
Python dict is unordered. This is a naive filter that helps stabilizing the
test output. It's used in the next patch.

Reviewed By: mjpieters

Differential Revision: D7648927

fbshipit-source-id: ad51f83c6f8d3a29cc0ee26afef73669302632c3
2018-04-19 13:17:08 -07:00
Alexandre Marin
537f9b9887 p4fastimport - remove comment/dead code
Summary:
This has been commented out for ages
It is not needed, and it refers to self._parsed which does not exist.

Differential Revision: D7625105

fbshipit-source-id: 908809b5b31e104b01b49558febed5adbfdcd143
2018-04-19 12:21:25 -07:00
Kaley Huang
2b4ab46876 p4syncimporter: fix minors in tests
Summary: D7676184 changes the sync importer tests to use `p4seqimport` instead of `p4fastimport`, but there's one left. This fixes the leftover one.

Differential Revision: D7687451

fbshipit-source-id: a7f4c4fa93f5a2a52a99cd1d8263718fc656f683
2018-04-19 12:21:25 -07:00
Liubov Dmitrieva
0074c0eb26 commitcloud: improve user facing message if there are unbackup changes
Summary: Improve message to suggest user to run the right command

Reviewed By: markbt

Differential Revision: D7668587

fbshipit-source-id: 903d9fc62fb2018847d81112ff62a76f337cdd18
2018-04-18 17:05:32 -07:00
Kaley Huang
97e9e5fa6a p4syncimporter: use p4seqimport instead of p4fastimport in tests
Summary: Since `p4seqimport` reaplces `p4fastimport`, the test for `p4syncimport` (which currently uses `p4fastimport`) should be updated to use `p4seqimport` as well.

Differential Revision: D7676184

fbshipit-source-id: 4273975159190933a71a1fe538dfddfbe4eb8a91
2018-04-18 17:05:32 -07:00
Durham Goode
a4d4fb3e29 metrics: rename logblockedtimes to logmeasuredtimes
Summary:
In an upcoming diff I want to add more timing measurements for various
parts of the Mercurial code (like how long status takes, vs checkout, vs
prefetch, etc). Let's rename the logblockedtimes logic to be more generic, since
it is doing basically the same thing.

Reviewed By: singhsrb

Differential Revision: D7676406

fbshipit-source-id: 9aa8c90ce562fa3ad5b654f7b3191b2c16a440c2
2018-04-18 17:05:32 -07:00
Martijn Pieters
f07e9c14b6 fbsparse: add hint to sparse explain about the verbose flag
Summary:
```
$ hg sparse explain some/profile
[...]
hint[sparse-explain-verbose]: use 'hg sparse explain --verbose some/profile' to include the total file size for a give profile
hint[hint-ack]: use 'hg hint --ack sparse-explain-verbose' to silence these hints
```

Differential Revision: D7669896

fbshipit-source-id: c700fbc2f42044a9b15371278305f03e9e6c989f
2018-04-18 10:38:35 -07:00
Martijn Pieters
0b9356d3f2 sparse: update all subcommands with proper arguments / synopsis info
Summary: Tweak the help output to reflect the now-complete subcommand information.

Differential Revision: D7667900

fbshipit-source-id: a5a04e8bcbfe4a90266c30e25ffd705de0bdc8a9
2018-04-18 10:38:35 -07:00
Kostia Balytskyi
cb1179cccb locks: make sure debuglocks knows about malformed locks and undolog lock
Summary: Let's report that this lock cannot be read by Mercurial

Reviewed By: markbt

Differential Revision: D7653196

fbshipit-source-id: c5b7889cdde9c0ecc03a8c961aeba92f426648b1
2018-04-17 17:42:26 -07:00
Jun Wu
c5985f2ec0 setup: drop install_requires
Summary:
`install_requires` is not well supported. And the subverty detection is not
meaningful - it checks at package build time, not package install time.

```
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
  warnings.warn(msg)
```

Reviewed By: markbt

Differential Revision: D7626055

fbshipit-source-id: 061147f02698ad46561c95d2039f0a8ad26182d2
2018-04-17 16:35:25 -07:00
Jun Wu
2bfa2520b7 test-lock-badness: stabilize the test
Summary: `hg status` won't always take wlock. So let's use `hg add` instead.

Reviewed By: phillco

Differential Revision: D7658239

fbshipit-source-id: c54b1aea61610e605c2967ccabcf594d5cb5b77f
2018-04-17 13:35:24 -07:00
Liubov Dmitrieva
520ffc0cef infinitepush: add unit test for pullbackup when hostname and reporoot are provided together
Summary: The test covers recent bug fix with --reporoot option for hg pullbackup

Reviewed By: ikostia

Differential Revision: D7652464

fbshipit-source-id: 1884d0f3112a7dd1d7b2b0df29738b8760a5697b
2018-04-17 05:55:40 -07:00
Jun Wu
857e9aa714 blackbox: append "\n" automatically
Summary:
Some log messages might not end with "\n". Append it automatically so it
looks good in blackbox.log.

Reviewed By: singhsrb

Differential Revision: D7648930

fbshipit-source-id: f5262e0c77a3bde952c3963ac5298b850f38d9db
2018-04-16 20:53:58 -07:00
Jun Wu
40dd438fc8 blackbox: do not log if msg is empty
Summary:
There are certain code paths that passes an empty `msg` that would crash
blackbox code:

```
error in exit handlers:
Traceback (most recent call last):
  File "mercurial/dispatch.py", line 73, in _runexithandlers
    func(*args, **kwargs)
  File "hgext/sampling.py", line 118, in telemetry
    generaldelta=str('generaldelta' in repo.requirements).lower())
  File "hgext/blackbox.py", line 170, in log
    formattedmsg = msg[0] % msg[1:]
IndexError: tuple index out of range
```

Fix it by ignoring those messages.

Reviewed By: singhsrb

Differential Revision: D7648932

fbshipit-source-id: be9f8327fd476399e4b762c92ea5f31cb174e189
2018-04-16 20:53:58 -07:00
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
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
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
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
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
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
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
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
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
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
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
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