Commit Graph

13521 Commits

Author SHA1 Message Date
Jun Wu
5a3842e136 hgsql: add a test demonstrating issues we saw with treeonly pushrebases
Summary:
This happens if during prepushrebase hook, a hgsql repo sync (db -> local)
is completed by another process. `repo.manifestlog` does not get invalidated
correctly if it's treeonly.

The issue was partially detected by a C program modified from fanotify (2)
manpage example monitoring `00manifesttree.i` changes:

  [00:32:35.780] pid 7734 opens 00manifesttree.i (size 1000264)                       # First open.
  [00:32:35.930] pid 7734 reads closes (no write) 00manifesttree.i (size 1000264)
  [00:32:38.685] pid 9175 opens 00manifesttree.i (size 1000264)
  [00:32:38.885] pid 9175 reads 00manifesttree.i (size 1000264)
  [00:32:38.886] pid 9175 closes (no write) 00manifesttree.i (size 1000264)
  [00:32:39.235] pid 9175 opens 00manifesttree.i (size 1000264)
  [00:32:39.235] pid 9175 closes (no write) 00manifesttree.i (size 1000264)
  [00:32:39.236] pid 9175 opens 00manifesttree.i (size 1000264)
  [00:32:39.236] pid 9175 modifies closes 00manifesttree.i (size 1000328)             # Appended by another process.
  [00:32:41.169] pid 10759 opens 00manifesttree.i (size 1000328)
  [00:32:41.355] pid 10759 reads 00manifesttree.i (size 1000328)
  [00:32:41.355] pid 10759 closes (no write) 00manifesttree.i (size 1000328)
  [00:32:41.537] pid 10759 opens closes (no write) 00manifesttree.i (size 1000328)
  [00:32:41.537] pid 10759 opens 00manifesttree.i (size 1000392)
  [00:32:41.537] pid 10759 modifies closes 00manifesttree.i (size 1000392)            # Appended by another process.
  [00:32:44.930] pid 7734 opens closes (no write) 00manifesttree.i (size 1000392)     # Main process picked up changes.
  [00:32:44.930] pid 7734 opens 00manifesttree.i (size 1000392)
  [00:32:44.930] pid 7734 reads 00manifesttree.i (size 1000392)
  [00:32:44.930] pid 7734 modifies closes 00manifesttree.i (size 1000456)             # Main process wrote data.
  [00:32:45.275] pid 7734 opens 00manifesttree.i (size 1000456)
  [00:32:45.459] pid 7734 reads 00manifesttree.i (size 1000456)
  [00:32:45.459] pid 7734 closes (no write) 00manifesttree.i (size 1000456)
  [00:32:45.550] pid 7734 opens closes (no write) 00manifesttree.i (size 1000456)
  [00:32:45.550] pid 7734 opens 00manifesttree.i (size 1000264)
  [00:32:45.550] pid 7734 closes 00manifesttree.i (size 1000264)                      # Main process truncated to the wrong position.

Pid 7734 had "IntegrityError: 1062 (23000): Duplicate entry" error. The
fanotify log showed it truncated the revlog to a wrong location, indicating
an outdated revlog was kept in memory.

The C program was sent as D10418991.

Reviewed By: DurhamG

Differential Revision: D10417797

fbshipit-source-id: 7ccc0a976d05efbca5b3ed6fb5ff7886766d06d2
2018-10-17 20:07:47 -07:00
Mark Thomas
1bf045df79 help: implement configurable documentation for aliases
Summary:
Aliases can be additionally configured with documentation by adding an entry of
the form:

```
[alias]
aliasname:doc = help text
```

The help text for the alias will be displayed if the user runs `hg help
aliasname`, and in the list of commands when the user runs `hg help commands`.

Reviewed By: phillco

Differential Revision: D10428399

fbshipit-source-id: 14338902fce6efab4c8d3b2541cdcf5b15385784
2018-10-17 12:22:53 -07:00
Mark Thomas
1cc0fedc1c help: reorganise help commands
Summary:
Reorganise the top-level help commands to more useful categories, allowing them
to be listed in a custom order.

Reviewed By: phillco

Differential Revision: D10423184

fbshipit-source-id: 17f02ae201493397a448d108e781eca28a7b1d44
2018-10-17 09:58:06 -07:00
Kostia Balytskyi
c46886e415 obsshelve: remove dummy extension
Summary: After D10407265 this is no longer needed.

Reviewed By: quark-zju

Differential Revision: D10407826

fbshipit-source-id: 5291981637d940a6d19cda1b814b81b745d9ca92
2018-10-16 14:27:29 -07:00
Kostia Balytskyi
427c7f2835 sparse: default missingwarning to false
Summary:
This message as a warning is not actionable. wez, philco, markbt and
mitrandir77 seem to agree that this is a good approach.

Note that this message is still printed in debug mode.

Reviewed By: farnz

Differential Revision: D10336756

fbshipit-source-id: ea55d298569787d2e19eb1ffcfe6ff75935fb650
2018-10-16 14:27:29 -07:00
Kostia Balytskyi
db59aa8bfc sparse: rename tests from test-fb-hgext-sparse-smth to be test-sparse-smth
Summary: As a signal that sparse is cleaned up.

Reviewed By: phillco

Differential Revision: D10335537

fbshipit-source-id: 773a12a00cfe040f08871bf14423faa5eae9bdad
2018-10-16 14:27:29 -07:00
Kostia Balytskyi
6d171b17c6 sparse: move bits of perftweaks into sparse directly
Summary: No point in tweaking it externally if we can just add relevant stuff.

Reviewed By: phillco

Differential Revision: D10335080

fbshipit-source-id: 47c009bf820f8f41f586b714181e82bea88dfa49
2018-10-16 14:27:29 -07:00
Kostia Balytskyi
86f07601f7 sparse: rename fbsparse into sparse in tests
Reviewed By: phillco

Differential Revision: D10335084

fbshipit-source-id: 91e0a17957561410e397a006f99ebf549d34e1e4
2018-10-16 14:27:29 -07:00
Phil Cohen
7bf2e9105a tweakdefaults: port allowbranches to core
Summary:
Note that this is more aggressive than the tweakdefaults version; it doesn't allow named branches to be created or listed at all with the config set. As we want to delete named branches entirely, this seems reasonable.

I ported the `--new` flag, but made it optional, to make it easier to support both the core and tweakdefaults callers.

Saurabh Singh and I chatted with the releng team (Craig).

**tldr:** we can remove named branches from the UI but should keep the innards for now

Today the releng team doesn't make any branches (#continuous), but in the near-term future, they might either:

- create remote bookmarks in hg (similar to fbsource)
- create branches in SVN (which are then synced as hg branches by hgsubversion)
  - We'll leave all the hgsubversion code to do this alone, just remove user-facing entry points
  - They'll also need to be able to query for a commit's branch (`hg log -T '{branch}'` will still work)
  - Once www is on hg, this possibility goes away and we can kill named branches for good

Reviewed By: ikostia

Differential Revision: D10401485

fbshipit-source-id: 6f2f3ae28af249bae1fdf782eb14fe7bfc472bb7
2018-10-16 09:25:04 -07:00
Kostia Balytskyi
e69f2795e4 obsshelve: add dummy extension file as a temporary workaround
Reviewed By: kulshrax

Differential Revision: D10401200

fbshipit-source-id: dc855cfedcba46575f4616a331a5cf8551e27055
2018-10-16 05:33:13 -07:00
Phil Cohen
ab78b85a3a tweakdefaults: move empty update logic to core
Summary:
Alas, it has to be config-gated for now, because a number of core tests depended on the empty-destination update behavior (which is sophisticated).

I'll send a followup diff to remove them.

Reviewed By: kulshrax

Differential Revision: D10376546

fbshipit-source-id: 2ac79e03a91551f96cf8e743c0ee9719557c4fbe
2018-10-16 05:17:39 -07:00
Mark Thomas
ced2b923b9 absorb: rename absorb tests
Summary: Remove `fb-hgext` from absorb test filenames.

Reviewed By: ikostia

Differential Revision: D10382215

fbshipit-source-id: 97546b47e19558d9ba6fcf6aab594c51fc6d472f
2018-10-16 03:03:02 -07:00
Mark Thomas
5163cf7430 absorb: exit if there are no changes that can be absorbed
Summary:
The new hg absorb UX still prompts if there is nothing to be absorbed.
Instead, detect this condition and just exit with a message.

Reviewed By: ikostia

Differential Revision: D10382216

fbshipit-source-id: 5cd1aa9de457cc3475bcda064e8761b3ddf1ad40
2018-10-16 03:03:02 -07:00
Phil Cohen
ce1ac26a21 perftweaks: move update --inactive to core
Summary:
This greatly simplifies the implementation, too.

*updatetotally() change:*

`hg up` now passes a brev of `None` if the `--inactive` flag was passed. This avoids activating the bookmark if one was passed. However, it still needs to deactivate the active bookmark, if there was one. After looking at the existing code, I think it was just wrong.

The rest of this is just cleanup.

Reviewed By: markbt

Differential Revision: D10376544

fbshipit-source-id: e5ad8aa01acab906db4d3fc09c6450e3c48b59fb
2018-10-15 16:55:34 -07:00
Phil Cohen
1f4999ec75 tweakdefaults: move book -D to core
Summary: Continue to move tweakdefaults functionality to core.

Reviewed By: ikostia

Differential Revision: D10376327

fbshipit-source-id: 79a9d08c74e6ec14c83ae641fa2c3a6619da2f76
2018-10-15 10:34:00 -07:00
Phil Cohen
1d8a354bfb tweakdefaults: move commit -M to core
Summary: Clean it up a bit too.

Reviewed By: ikostia

Differential Revision: D10359624

fbshipit-source-id: 287bd9013fdd6eb33304def7e4f6afdd9f618ef0
2018-10-15 10:34:00 -07:00
Mark Thomas
f18bd9714d help: improve some help messages
Summary: Make a few help messages clearer.

Reviewed By: phillco

Differential Revision: D10356915

fbshipit-source-id: 277d4cecbd17b647d6dd01209ff6f93a926d37d4
2018-10-15 09:37:19 -07:00
Mark Thomas
36c697f8e0 help: new default help
Summary:
Replace the default help for Mercurial with a curated list of interesting
commands, categorized by their use case.

Reviewed By: phillco

Differential Revision: D10356916

fbshipit-source-id: 65e578a4bfde7b0ad04e7107f4e77d8ea882d78a
2018-10-15 09:37:18 -07:00
Phil Cohen
0e9d69b41e tweakdefaults: move allowtags to core (as ui.allowtags)
Summary: NB: `hg tags` still prints out all tags, just with a warning first. Maybe we could disable that entirely too while we're here.

Reviewed By: ikostia

Differential Revision: D10314175

fbshipit-source-id: 603a4dc46e05337189934803a18eef1188a02272
2018-10-15 08:05:13 -07:00
Phil Cohen
23eb56f4a5 tweakdefaults: replace allowrollback with core implementation
Summary:
It turns out core already implemented this, so let's just use their version.

Switch the facebook.rc config to it.

Reviewed By: ikostia

Differential Revision: D10306234

fbshipit-source-id: b0ee5e865ec4e0d8412dbd310a7e5017399b48c9
2018-10-15 08:05:13 -07:00
Phil Cohen
24275c4f80 tweakdefaults: move allowmerge to core
Summary:
Let's start moving tweakdefaults things into core.

Since we set the config in our rc files, I've renamed it.

Reviewed By: ikostia

Differential Revision: D10306236

fbshipit-source-id: 9a6b3bf7e22d8faf7b53446021660bb0923cf666
2018-10-15 07:28:22 -07:00
Saurabh Singh
814d5760cf test-fb-hgext-dialect-backups: fix test
Summary: This tests works with `run-tests.py` but fails with buck.

Reviewed By: mitrandir77

Differential Revision: D10378486

fbshipit-source-id: 7112560a2d6b05b0a39f3df423ccac52bdc5202c
2018-10-15 05:26:04 -07:00
Mark Thomas
613561b5e7 absorb: display affected commits and prompt user to confirm
Summary:
Update hg absorb to use the templater and display the first line of the
description of the affected commits.

Also change the default behaviour to display the changes and prompt the user to
confirm that absorb is going to do what they want.  Use the new `-a` option to
get the old behaviour.

Reviewed By: quark-zju

Differential Revision: D10366510

fbshipit-source-id: 23df2e5ab2d21a0805a16e7118686a29634d2918
2018-10-13 01:02:10 -07:00
Jun Wu
fcf535a3e5 fsmonitor: do not set watchman clock to None
Summary:
There are some code paths (ex. "purge --all") that sets watchman clock to None
unexpectedly. That makes the next command slow. Bypass it by detecting the case
and avoid setting clock to None.

Reviewed By: DurhamG

Differential Revision: D10188143

fbshipit-source-id: 4c35dfcee658ca2075d686da7d886e4b3a352b5a
2018-10-12 19:23:01 -07:00
Jun Wu
3f866b49cf tests: add a test demonstrating watchman clock gets reset after purge --all
Summary:
With treestate, watchman clock is not expected to be reset. But `purge --all`
bypasses some fsmonitor code paths and manages to reset the clock. Add a test
to show that.

Reviewed By: DurhamG

Differential Revision: D10188142

fbshipit-source-id: 4524979fb96d41fab881b7ee44ad9fa854081b26
2018-10-12 19:23:01 -07:00
Saurabh Singh
3d88ec0346 record: move extension into core
Summary:
This extension exposes only the `record` command which can be easily
moved to core. This commit achieves the same.

Reviewed By: ikostia

Differential Revision: D10360759

fbshipit-source-id: 25f0c46aa3fa9b19ab8ba03a6b4e8598bc003c7a
2018-10-12 11:16:46 -07:00
Durham Goode
c8a916a4a6 dirstate: move some untrack() use cases into delete()
Summary:
dirstate.untrack is used in two cases. Let's move the case where the
file is known to be actually deleted from disk to its own function. This allows
the treestate implementation to actually remove the entry from the structure,
which solves some case sensitivity issues.

Reviewed By: quark-zju

Differential Revision: D10317737

fbshipit-source-id: 09bc35d01cf5e52fdcbf45ea39c5d2f85fa39949
2018-10-12 09:38:25 -07:00
Durham Goode
d7c8bc2083 dirstate: introduce test that demonstrates case sensitivity bug
Summary:
There's a treestate bug on case insensitive filesystems where updating
across a case rename can cause junk to show up in hg status. A future diff fixes
this, but let's add a test first.

Reviewed By: ikostia

Differential Revision: D10317739

fbshipit-source-id: c1aa274cb55dd64cdb54ceadbd3c306151bd84d6
2018-10-12 09:38:25 -07:00
Durham Goode
a0fdd80720 dirstate: rename drop to untrack
Summary:
dirstate.drop() is used in two different situations. 1. To make a
tracked file become untracked, and 2. To remove a file from the dirstate
entirely. In the treestate case, this difference matters, so let's split drop
into two functions, one to mark something as untracked, and the other to remove
it entirely.

In this first patch we just rename drop to untrack. The next patch will
introduce the new delete function.

Reviewed By: ikostia

Differential Revision: D10317738

fbshipit-source-id: 85950ab1b1a10cd481edcfbba6da445b3dbf6397
2018-10-12 09:38:25 -07:00
Saurabh Singh
cd49463e2c show: move the extension into core
Summary:
The extension only offers one command i.e. `show` which can move into
core.

Reviewed By: ikostia

Differential Revision: D10302192

fbshipit-source-id: 9473ec8c80e52506e1b7de62b2c90a51c29419c1
2018-10-12 07:03:11 -07:00
Saurabh Singh
d0d21c955f show: replace with the fbshow extension
Summary:
The functionality we care about is provided by the `fbshow` extension.
Therefore, lets replace the `show` extension with the `fbshow` extension.

Reviewed By: ikostia

Differential Revision: D10302193

fbshipit-source-id: e6d137f52427d5e6f124714d06b5b55ef0db7c3c
2018-10-12 07:03:11 -07:00
Saurabh Singh
7e44f44298 show: remove the extension
Summary:
This commit just removes the `show` extension.

This commit was split out of D10302193 to address the review comment in that
diff.

Reviewed By: ikostia

Differential Revision: D10359525

fbshipit-source-id: b77a08a7efbaa56eb5a4ceb2dbb3fecaba35f58b
2018-10-12 07:03:11 -07:00
Kostia Balytskyi
40991e7fe6 shelve: fix tests that rely on traditional shelve
Summary: Traditional shelve did not require `obsstore` to be enabled, which means that `saved bundle` messages were printed a lot. This change fixes all tests that expect these messages.

Reviewed By: singhsrb

Differential Revision: D10261258

fbshipit-source-id: 2b4b10ee94ae9b5723cb69fc8f7c29bc65613774
2018-10-12 06:30:04 -07:00
Kostia Balytskyi
7068d0d8fb shelve: move obsshelve into shelve and fix a bug
Summary:
The bug:
This happens because `repo['']` resolves to a `wctx`. This might be undesirable
in its own right, but before we fix that, we can work it around here.

Reviewed By: singhsrb

Differential Revision: D10261261

fbshipit-source-id: 8cb0e96762ffba24030f9e6bae8b0d0c108e3938
2018-10-12 06:30:04 -07:00
Kostia Balytskyi
aaf4ffbdfa shelve: remove the original shelve extension
Summary: This is a first step towards making `obshelve` a real `shelve`.

Reviewed By: singhsrb

Differential Revision: D10261262

fbshipit-source-id: 7dccfbd7958cdf674c33c8ead73dcd279cebade6
2018-10-12 06:30:04 -07:00
Saurabh Singh
6317ba0ca2 amend: replace with the fbamend extension
Summary:
The functionality we care about is provided by the `fbamend`
extension. Therefore, lets replace the `amend` extension with the `fbamend`
extension.

Reviewed By: farnz

Differential Revision: D10320739

fbshipit-source-id: 5700d39f488777fcc4033f60ce0a51cda15ef2ad
2018-10-11 06:59:23 -07:00
Jun Wu
4f1f17133d sparse: do not ignore root directory ""
Summary: `repo.dirstate._ignore("")` should return False.

Reviewed By: DurhamG

Differential Revision: D10316447

fbshipit-source-id: df0ee2c5474784532280b7031623c135a784a196
2018-10-10 16:42:41 -07:00
Jun Wu
617cafd8a2 treestate: add "dirfilter" parameter to "walk" API
Summary: This allows fitlering a large ignored directory quickly.

Reviewed By: markbt

Differential Revision: D10281987

fbshipit-source-id: 026887beea2cf5adfcfa498baf8c9b05a84f4424
2018-10-10 11:36:26 -07:00
Saurabh Singh
f6e0d2d1ee inhibit: remove the extension
Summary:
The logic we care about has been moved to core so we can delete the
`inhibit` extension.

Reviewed By: markbt

Differential Revision: D10276448

fbshipit-source-id: 44cabe5d561344cf8f196127ce52491e4654b598
2018-10-10 10:01:45 -07:00
Mark Thomas
5351ce3851 treestate: implement debugpathcomplete fastpath
Summary:
Treestate is missing its pathcomplete fastpath.  This makes tab completion for
filenames slow on large repositories.

The Rust implementation already supported the feature, it just needs to be
called from the debugpathcomplete commands.

Reviewed By: quark-zju

Differential Revision: D10259633

fbshipit-source-id: f918d55c5bcd21805615710c0eb6302f8ea4b15c
2018-10-10 06:49:05 -07:00
Mark Thomas
f47bd8c33d treestate: move treedirstate to core
Summary:
Parts of the treedirstate implementation were left in the extension.  Since
treestate is now in core, and the two are intertwined, treedirstate should be
in core, too.

In doing so:
- Change the garbage collection behaviour to match that of treestate.
- Use the treestate config options for configuring repacking and garbage
  collection.
- Make more of the code common.

Reviewed By: quark-zju

Differential Revision: D10258265

fbshipit-source-id: 89e82bc7662a3d1251fa9886751897cfc46cd66a
2018-10-10 03:53:20 -07:00
Durham Goode
e696863ba6 tests: update tests
Summary: D10244968 changed the parser output but missed this test case.

Reviewed By: quark-zju, singhsrb

Differential Revision: D10261202

fbshipit-source-id: f3b6a4429b792e413f285fb33dfd6b64934ec477
2018-10-09 11:57:44 -07:00
Durham Goode
589f254150 treemanifest: strip trees from revlog even in treeonly mode
Summary:
On the server, once we enter treeonly mode we still want to be able to
strip trees from the revlog.

Reviewed By: quark-zju

Differential Revision: D10248895

fbshipit-source-id: 15faec870370d4c28f6a83058eb1bf19cb414d29
2018-10-09 07:58:11 -07:00
Durham Goode
6370e8882b treemanifest: add test to demonstrate strip bug
Summary:
There's a bug where strip in a treeonly server will not strip the tree
revlogs. Let's add a test so a later fix can show the impact.

Reviewed By: quark-zju

Differential Revision: D10248897

fbshipit-source-id: f45e5abc59eeb9398ba17dd927a5f8eb50bc51af
2018-10-09 07:58:11 -07:00
Durham Goode
dd89e315f1 treemanifest: add hook to ensure commit/manifest integrity
Summary:
As we transition to treeonly, let's be sure every push contains a
manifest for every commit. To do so, let's add a hook that checks this.

Reviewed By: quark-zju

Differential Revision: D10244912

fbshipit-source-id: 6c2023b1cba5663ed386888a2007a005bc02f688
2018-10-09 07:58:11 -07:00
Durham Goode
64b35bdc40 treemanifest: add test to demonstrate broken push behavior
Summary:
There's an issue now where if a client is treeonly but does not have
sendtrees enabled, it could push commits to the server without manifest data.
Let's add a test for this.

The next commit will introduce a hook to catch this case.

Reviewed By: quark-zju

Differential Revision: D10244913

fbshipit-source-id: 2d6c3081c7190831e0368b0dab472d14e893471f
2018-10-09 07:58:11 -07:00
Lukas Piatkowski
b1b8fd73e1 hg tests: fix test-config.t after upgrading pest and adding EOI to grammar
Summary: pest was upgraded by me to version 2.x which introduced the concept of End Of Input in the parsin rules. Modify the test case to be aware of this.

Reviewed By: singhsrb

Differential Revision: D10255598

fbshipit-source-id: 31ecf56f5cf75a16c799a93aefe7df9a3837b902
2018-10-09 05:11:14 -07:00
Aida Getoeva
6657b619f0 create pack files for local data
Summary: Create pack files instead of loose files for local data. Now this feature is under the config flag.

Reviewed By: DurhamG

Differential Revision: D9700992

fbshipit-source-id: b1ee897ac6fd2fe208f54f999b230353aebaca5b
2018-10-09 04:19:46 -07:00
Mark Thomas
f353521eb9 revset: move age extension to core
Summary:
The age extension provides a couple of revsets relating to commit ages.  Move
these to core.

Differential Revision: D10239000

fbshipit-source-id: 6ebf3aa263b72e4bbbe25bd516f77b17145e6e7f
2018-10-08 12:01:44 -07:00
Aida Getoeva
346ddf5248 bisect: don't test empty commits in sparse profiles
Summary:
Currently `hg bisect` asks to run test on all commits it picked as a result of bisection, even if the changes between last checked nodes and chosen one relate to the files, which are not in the sparse profile.
And so it updates to the one of such commits, shows that "0 files were updated" and asks to run tests.

In this diff I check next potential node (result of bisecting) if there are changes between last good commit/last bad commit and the node. And go further to the next bisection iteration if the node can be skipped (nothing was changed since last good commit in sparse profile's files, so we can assume that the node is good as well).

If there are changes on both sides: between bad and the node, good and the node, I ask to run tests.

Reviewed By: markbt

Differential Revision: D9629683

fbshipit-source-id: f8c5d82f7b44ac14a9190c846ee65d635e447af1
2018-10-08 06:16:19 -07:00
Jun Wu
03e4494e3d lfs: verify sha256 before writing them to local store
Summary:
Verify SHA256 before writing content to the local blob store. This avoids
issues when the remote store does not response with the correct content.

Differential Revision: D10212567

fbshipit-source-id: 5683058670487df53fb14653d83c27da11367e76
2018-10-04 19:49:44 -07:00
Jun Wu
7f10a74837 lfs: add a test demostrating SHA256 hash check does not happen
Summary: As the title.

Differential Revision: D10212568

fbshipit-source-id: 3ad60f93909f5f76c07489bcb046a32f2f93d8f8
2018-10-04 19:49:44 -07:00
Mark Thomas
171b310857 fbamend: move predecessor/successor revsets to core
Summary:
Move the `predecessors` and `successors` revsets to core, and unify the
variants as a single revset.

Before:
* `predecessors` (provided by fbamend) only returned the immediate
  predecessors.
* `successors` (provided by core) returned the given commit and all eventual
  successors.
* `allpredecessors` and `allsuccessors` (provided by fbamend) returned all
  eventual predecessors and successors, not including the original commit.

Now all these revsets work like the old core `successors`, and additionally
have `depth` and `startdepth` parameters which can be used to customize the
behaviour.  This makes them analogous to `ancestors` and `descendants`.

To maintain compatibility with existing users of `allpredecessors` and
`allsuccessors`, these revsets default to a start depth of 1, so they
do not include the original commits.

Reviewed By: quark-zju

Differential Revision: D10028043

fbshipit-source-id: e006700ccf430b7c5d6bd9588253872bce9a18ed
2018-10-03 13:32:56 -07:00
Durham Goode
b3e328c903 treemanifest: don't store repo objects in the manifestrevlogstore
Summary:
Previously the manifestrevlogstore kept a copy of the changelog, the
store, and the svfs from the initial repo object. It's possible that these will
change or be replaced over time, so it's not safe to cache them. Instead let's
just fetch them again each time we need it.

Reviewed By: quark-zju

Differential Revision: D10156425

fbshipit-source-id: ac1e310b51be0377ba9bea75aa1806d256cc5b87
2018-10-03 08:52:19 -07:00
Durham Goode
85a676e406 treemanifest: add test for pushing treeonly commits to a treeonly repo via pushrebase
Summary:
This flow has a bug, so let's introduce a test to expose the break. The
next diff will fix the bug.

Reviewed By: quark-zju, singhsrb

Differential Revision: D10156424

fbshipit-source-id: 51d1d8da6728ee930dc1440cd3e685d7c5b5df2a
2018-10-03 08:52:18 -07:00
Stanislau Hlebik
d93c5269be pushrebase: record pushrebases failed on hooks
Summary:
At the moment they are not recorded because setrecordingparams may not be set
before hooks are called.

Also hooks weren't recorded because pushrebasereplacements weren't correctly
set and KeyError was thrown. This diff fixes it

Reviewed By: quark-zju

Differential Revision: D10147933

fbshipit-source-id: ef33d3e4efa7f3c42e7fcc22ee5f6e54068bf1dc
2018-10-03 04:20:22 -07:00
Stanislau Hlebik
056dad1e1b wireproto: log reponame
Summary:
Let's log reponame as well so that we can tell requests to different repos
apart.

I named config value `common.reponame` so that we can start using it in different extensions that also need reponame (for example, hgsql and infinitepush)

Reviewed By: farnz

Differential Revision: D10127734

fbshipit-source-id: 031c7393dfce43bf47474ac0878c1e68ddabec50
2018-10-02 05:05:41 -07:00
Stanislau Hlebik
96510842e5 clienttelemetry: use clienttelemetry when recording wireproto requests
Summary:
It's useful to know because we can track down slow requests and potentially fix
them on the client.

Reviewed By: farnz

Differential Revision: D10127735

fbshipit-source-id: d21088b50065f322b0c312f048f5828b3d96f99f
2018-10-02 05:05:41 -07:00
Mark Thomas
06a462bb89 fbsparse: add switchprofile command
Summary:
Add the `sparse switchprofile` command, which lets users specify a set of
sparse profiles they would like to switch to.  This is equivalent to `hg sparse
reset` followed by `hg sparse enableprofile`, but in a single step.

Reviewed By: farnz

Differential Revision: D10141938

fbshipit-source-id: 5a1e547d21e3246237fffb17f3b512da18fac804
2018-10-02 03:35:49 -07:00
Zsolt Dollenstein
64d45ccdb6 Format with black 18.9b0
Summary: Reformat all opted-in python code with version `18.9b0` of Black.

Reviewed By: ambv

Differential Revision: D10126605

fbshipit-source-id: 82af0d645dd411ce8ae6b8d239e151b3730cd789
2018-10-01 07:21:42 -07:00
Mark Thomas
c6703f295a fbamend: show a hint when split commits have the same Phabricator Diff
Reviewed By: quark-zju

Differential Revision: D10105739

fbshipit-source-id: 7f2c7664a2e8eb4704ff2e5800c1c24cbedb3fdc
2018-10-01 06:21:59 -07:00
Stanislau Hlebik
5b12e92cc2 pushrebase: record failed pushrebase conflicts
Summary:
In D10023543 stackpush was added, and conflict check can happen earlier. In
that case failed pushrebase wasn't recorded. This diff fixes it.

Reviewed By: quark-zju

Differential Revision: D10119679

fbshipit-source-id: ef12e00a43375151f81a95eec2d9f02db0a9b12b
2018-10-01 04:05:57 -07:00
Jun Wu
df06404eb0 hgsql: correct sqlstrip
Summary: When stripping rev x, revlog revisions with linkrev >= x should be deleted.

Reviewed By: phillco

Differential Revision: D10108592

fbshipit-source-id: 2f9f5663327c4494bd7e836ab24ffc7e507530f4
2018-09-28 16:58:37 -07:00
Jun Wu
d0d8a6a74b hgsql: rename variables to make things more obvious
Summary:
* Rename takelock to dbwritable
  The word "lock" is unclear what lock (local or SQL) it is. Make it clear it's
  all about database writes.

* Rename waitforlock to enforcepullfromdb
  Again, unclear what lock it is. It's also unclear what it does. Rename to
  "enforce pull from db" to make it obvious.

* Rename syncdb to pullfromdb
  "sync" is unclear about what direction to sync. Use "pullfromdb" to make it
  clear.  The hook name is unchanged for compatibility.

Reviewed By: phillco

Differential Revision: D10108594

fbshipit-source-id: fff405e2df9e926f5db436ef74cb5a9aacaebdb4
2018-09-28 16:58:36 -07:00
Mark Thomas
a77d98c8c9 obsshelve: update after shelve transaction has completed
Summary:
Delay updating the working copy until after the transaction that created the
obsshelve commit has completed.  This means we won't update away from the
user's changes until after their work is safe, so if the update is interrupted
for any reason, the user will be able up do a clean update and then unshelve to
get their work back.

Reviewed By: liubov-dmitrieva

Differential Revision: D10102089

fbshipit-source-id: 5709d3915a6c458ba7cfb37ba5e0be5c6e8fcbb2
2018-09-28 09:50:10 -07:00
Mark Thomas
3bfae82702 obsshelve: add test demonstrating dataloss in interrupted shelve
Summary:
If the `update` step is interrupted, then the transaction that created the
obsshelve commit is rolled back, but the update can't be rolled back, so the
files that have been shelved are lost.

Reviewed By: liubov-dmitrieva

Differential Revision: D10102088

fbshipit-source-id: f5bcac5c92069cc6ff3d1d9b7fb7ee507003d8eb
2018-09-28 09:50:10 -07:00
Liubov Dmitrieva
f4858c3c1c add to commit and amend commands ability to show information about the
Summary:
This is for sandcastle and other automated tools.

They will not need to run extra commands like hg log after amend to learn new
hash.

Reviewed By: markbt

Differential Revision: D10101887

fbshipit-source-id: 7c9931776a03f4335bdfe0a19e7d569e3dc4c4ba
2018-09-28 07:23:03 -07:00
Mark Thomas
78e2b44b06 localrepo: devel-warn when accessing repo.vfs directly
Summary:
Callers should prefer repo.localvfs (or perhaps repo.sharedvfs) rather than
calling repo.vfs directly.  Warn when repo.vfs is accessed directly.

Reviewed By: quark-zju

Differential Revision: D9699167

fbshipit-source-id: 83b43fd347da6e68376eaab081b7f6e2d8c5d044
2018-09-28 07:23:02 -07:00
Mark Thomas
372aef5b2d hgsubversion: util develwarn should work without config key
Summary:
In the hgsubversion tests, a develwarn from another component (which doesn't
have a `config` key) crashes with a `KeyError`.  Change to `get` so that
it doesn't crash.

Reviewed By: quark-zju

Differential Revision: D9699155

fbshipit-source-id: c360d5fb5ab7daf7f609d41e0ddfb7456b022666
2018-09-28 07:23:02 -07:00
Mark Thomas
99b3d7c398 share: remove shareutil and _sharedprimaryrepo
Summary:
These are no longer necessary.  Callers should use the sharedvfs to access the
shared repo's .hg directory.

Reviewed By: quark-zju

Differential Revision: D9699163

fbshipit-source-id: 9b9cd584d721c174a7eab06f6abcedc3a943233b
2018-09-28 07:23:02 -07:00
Mark Thomas
b439719a17 hgsubversion: use repo.sharedvfs instead of srcrepo.vfs
Summary:
Update hgsubversion to consistently use repo.sharedvfs, rather than using the
vfs of the srcrepo.

Reviewed By: quark-zju

Differential Revision: D9699165

fbshipit-source-id: 1f4dacdd23ebc3baaa0d09b65e45d4ceeb067559
2018-09-28 07:23:01 -07:00
Mark Thomas
483e3a915c hg: use repo.localvfs instead of repo.vfs
Summary: Update references in core mercurial to use repo.localvfs instead of repo.vfs.

Reviewed By: quark-zju

Differential Revision: D9699162

fbshipit-source-id: 0401677d2b0a1340e66cffb7ee907a0d93aa6717
2018-09-28 07:23:00 -07:00
Mark Thomas
29c915a4c1 bookmarks: use repo.localvfs and repo.sharedvfs instead of repo.vfs
Summary:
Update bookmarks to work correctly when shared.  Rather than copying the
bookmarks file over after transaction handling, update the file in both
locations when bookmarks are shared.

Reviewed By: quark-zju

Differential Revision: D9699158

fbshipit-source-id: 2f75aaac364ffe02e59441ac0f39fb7d8e5d5d2e
2018-09-28 07:23:00 -07:00
Mark Thomas
0b425b5f11 txnutil: add HG_SHAREDPENDING and trysharedpending
Summary:
Add `HG_SHAREDPENDING` which contains the path to the shared primary repository,
similar to how `HG_PENDING` contains the path to the local repository.

Repositories that are not shared check whether either of these refer to the
local repository path.  Repositories that are shared check whether the pending
directory matches their own path, or the shared-pending directory matches their
shared path, via the new `trysharedpending` function.

This fixes the asymmetry in shared repos where pending changes made in a shared
repo were not visible in the primary repo, even though they were visible the
other way around.

Reviewed By: quark-zju

Differential Revision: D9699164

fbshipit-source-id: 31bc5fb2df6e9b9468b6ef39aabf877045c2a011
2018-09-28 07:23:00 -07:00
Mark Thomas
0fa782e83d localrepo: split vfs into localvfs and sharedvfs
Summary:
Split the `repo.vfs` object into two.  When a repo is not shared, these are
both the `.hg` directory of the repo.  When it is shared:

* `repo.localvfs` represents the `.hg` directory of the local repository.
* `repo.sharedvfs` represents the `.hg` directory of the shared primary
  repository.

The old `vfs` is an alias for `localvfs`.  In the future, access through
this name will be deprecated to force callers to think whether they want
the local or shared hg directory.

Reviewed By: quark-zju

Differential Revision: D9699160

fbshipit-source-id: 6600df855c59b6df13e919399192789a873231c6
2018-09-28 07:23:00 -07:00
Jun Wu
77f7a24e4f statprof: stop early if profiling ends early
Summary:
Previously, statprof uses a naive `time.sleep`, which cannot be interruptted
easily (considering Windows compatibility). Change it to `threading.Event.wait`
so it can end early without waiting for the full cycle of the sampling period.

Reviewed By: wez, kulshrax

Differential Revision: D10067234

fbshipit-source-id: 24e5fc0ab05491cb3e7ff34024402842ac3d7d44
2018-09-26 17:52:27 -07:00
Jun Wu
9cf0c87149 hgsql: log rows read and write
Summary:
This gives us more information about how large the hgsql operation is.

As we're here, move `sqlwriteunlock` to an earlier place so the logging is outside
the sql lock. Also document `unbundle` a bit so it's clear `repo.transaction()` only
takes sql lock in `unbundle` context.

Reviewed By: phillco

Differential Revision: D10056307

fbshipit-source-id: 5d3361b4044e6fcf01e60409ef1ecb34da34ccac
2018-09-26 16:35:14 -07:00
Jun Wu
4ddedaf7d2 tests: remove most rocksdb test cases
Summary:
RocksDB and InnoDB are highly compatibile. There is no need to test RocksDB
engine for every hgsql related tests. Only use rocksdb for 2 of the tests.

Reviewed By: phillco

Differential Revision: D10055068

fbshipit-source-id: f9b7ef546fe7d457b0390e49014ebbe56d3c12c1
2018-09-26 14:20:15 -07:00
Phil Cohen
5f9bd1a7da pushrebase: run hgsql sync after running prepushrebase hooks
Summary:
Our hypothesis is that if the prepushrebase hooks take a significant amount of time, the repo state will get out date, causing hgsql to degrade under load.

This uses the previous test to simulate new commits coming in to the database while a single server is busy running prepushrebase hooks. The new code causes a second sync to occur just after running the hooks.

Reviewed By: quark-zju

Differential Revision: D9999683

fbshipit-source-id: 43d2390b476d090a66353555247c9a623386e75a
2018-09-25 18:23:12 -07:00
Phil Cohen
95a45ebb7c pushrebase: refine the "cannot rebase public changesets" test
Summary:
This test case is a bit simpler given the problem -- there's no need for the holding push hook.

Instead, you just need a server that's missing a public commit. (Simulate an `hg strip` on one of the servers. `hg strip` isn't allowed, so create another repo with the extra public commit instead.)

Reviewed By: quark-zju

Differential Revision: D10043378

fbshipit-source-id: 532d8a2791abe5aaa6b6932747c7e0145202e8fe
2018-09-25 18:23:11 -07:00
Jun Wu
83559cfb29 pushrebase: introduce a stackpush fast path
Summary:
The fast path avoids recreating the bundlerepo in the critical section, which
is like a reliable 0.8s win.

See the docstring in stackpush.py for details. It does not replace all use cases
that the old code path supports. So the old path is preserved.

Since it's a drop-in replacement, make it the default.

Reviewed By: phillco

Differential Revision: D10023543

fbshipit-source-id: eaceb9ae5067ab9040aa10cc65170ae54abd3331
2018-09-25 16:06:21 -07:00
Jun Wu
f7475e03c2 globalrevs: wrap repo.commitctx instead of wrapping extensions
Summary:
The next patch will change pushrebase code path so it does not have to go
through pushrebase._commit. Change globalrevs to wrap the lower-level
repo.commitctx to make sure commits have global revs assigned. Pushrebase
and hgsubversion wrappers are removed accordingly.

This also affects "hg commit" running in the server-side repo. Therefore
the test is changed to keep the change minimal.

It's also incorrect to reset the next revision counter at `repo.invalidate`.
It should only be reset at transaction abort. The original concern was
to get an up-to-date view of the revision number. Doing it in `repo.invalidate`
is risky. Enforce hgsql lock when reading the number to make it safer.

As we're here, change the transaction code so it does not wrap `_abort`
unnecessarily for nested transactions.

Reviewed By: singhsrb

Differential Revision: D10023541

fbshipit-source-id: 82d4b57dc2eafa8bc3cdf553e891db6e8c5ff741
2018-09-25 16:06:21 -07:00
Jun Wu
3311dab0ec hgsql: implement a faster version of needsync
Summary:
Inside the critical section, "needsync" runs twice and each time it scans
O(bookmarks + heads), which could be slow.

If the repo is actually up-to-date, there could be a faster path for testing -
just hashing all bookmarks and tip. Note: "heads" is skipped to save some time.
Since commits are append-only, "heads" change implies "tip" movement. So
checking "tip" is enough.

As we're here, fix the empty repo case so syncing is skipped for an empty repo.

Since this is a drop-in replacement for `needsync()[0]`, turn it on by default.

Reviewed By: phillco

Differential Revision: D10022866

fbshipit-source-id: f9e304865db3575515d66444762f21071d5665a3
2018-09-25 16:06:21 -07:00
Jun Wu
3ee1c205cd hgsql: sync repos before acquiring the SQL write lock
Summary:
When entering the critical section (creating a transaction), hgsql might wait
for SQL lock for a long time (minutes). And it currently does nothing during
that wait time. If the lock was acquired after a long time, the work of
catching up with what the database already has might be too much. That is a
waste within the precious hgsql lock held critical section.

Instead of waiting for the lock for N seconds and doing nothing, wait for k
(k < N) seconds and also try to sync with SQL periodically. This makes the
repo closer to what the database has and can reduce work needed to pull from
the database in the critical section.

This adds CPU pressure to the MySQL tier. I added a config option to control
it.  Worse case, we can change `hgsql.syncinterval` to make the sync less
frequent.

As we're here, try document the configs.

Reviewed By: phillco

Differential Revision: D10002578

fbshipit-source-id: bd72d8225c919aa2bc62743de1e1d3f27cba606a
2018-09-25 16:06:20 -07:00
Phil Cohen
a8879d2b36 pushrebase: add a test case demonstrating the "cannot rebase public commit" issue
Summary: We want to add a test for this case before fixing it.

Reviewed By: quark-zju

Differential Revision: D10034448

fbshipit-source-id: 9244c57311d71a0bf1d75643caa31960a2f3519f
2018-09-25 13:21:45 -07:00
Phil Cohen
25bb829e65 pushrebase: add a new test for hgsql cached manifest reads
Summary: We need an in-depth test that tests both pushrebase and hgsql and shows how often we are reading uncached manifests. This is such a test.

Reviewed By: quark-zju

Differential Revision: D10023492

fbshipit-source-id: cf9e76e505c3bc478a7fc13d8d1adf1adeb6c1e4
2018-09-25 13:21:44 -07:00
Mark Thomas
08567ee311 localrepo: don't add storerequirements by default
Summary:
This allows versions that don't know about storerequirements still access newly
created repos with this version.  We will turn this on at a later date.

Reviewed By: singhsrb

Differential Revision: D10033964

fbshipit-source-id: e1065e05c33544d0287eda5eb852baff07c13147
2018-09-25 12:37:57 -07:00
Mateusz Kwapich
28fefbaa65 abstract the write lock
Summary:
I want to centralize knowledge about specific sqllocks so I can change the
locking mechanism in the next commits of this stack

Reviewed By: quark-zju

Differential Revision: D9993477

fbshipit-source-id: 9398476b0ba8c3175ce84a7e0a809bbb8e60b7df
2018-09-25 11:07:04 -07:00
Jun Wu
99245c48eb hgsql: add hgsql.verbose for printing what the server is doing
Summary:
With hgsql.verbose turned on, print useful messages like how many commits the
server is syncing, how long the lock was held or waited, to stderr so they are
visible to the client.  This is useful for the client to understand why the
server "hangs" for a couple of seconds, and is useful in tests.

As we're here, drop no-flake8 comment.

Enable the flag for the hgsql-sync test to verify it.

Reviewed By: phillco

Differential Revision: D10019937

fbshipit-source-id: 8d304ce5208dbc5b92ed20f69daba02e9040c73f
2018-09-24 20:53:08 -07:00
Jun Wu
051e7a99f0 fsmonitor: limit file list being logged to blackbox
Summary:
Sometimes watchman can return a very long list of files. That would make
blackbox rotate too frequently. Truncate that list.

Reviewed By: phillco

Differential Revision: D9997658

fbshipit-source-id: 1314b7c299a5f50ed344e0b85befd4c0525b1da7
2018-09-21 16:51:44 -07:00
Jun Wu
d9394d90ff profiling: allow profiling config to be specified by other sections
Summary:
Previously, the `[profiling]` config section defines the profiler. Now it can be
defined by other sections, `[profiling:1]`, `[profiling:2]`, etc. Those sections
are sorted by name, and the first one with `enabled = true` is effective.

This makes it possible to specify secondary profiling configs, like having a
low-overhead profiler to be always enabled and logged if the command exceeds
certain threshold:

  [profiling:background]
  enabled = 1
  freq = 1
  minelapsed = 30
  output = blackbox
  type = stat

The config will only be used when the primary profiling (`--profile`, or
`profiling.enabled`) is disabled.

Reviewed By: markbt

Differential Revision: D9828548

fbshipit-source-id: 301a2b049d569d6fc065d05ab5b02e85b4ea8cc5
2018-09-21 14:37:23 -07:00
Jun Wu
27c2bc6c0b profiling: make the section name a variable
Summary:
Make "profiling" a variable. No logic change.

The next patch changes the config section name dynamically.

Reviewed By: markbt

Differential Revision: D9828551

fbshipit-source-id: b6b76012462f2dc1a76cd162381d949a94dc498b
2018-09-21 14:37:23 -07:00
Jun Wu
d61bfcb84f legacyui: remove it since the Rust config parser is working fine
Summary:
The Rust config parser is working well. Therefore remove the legacy config
support.

Reviewed By: markbt

Differential Revision: D9840431

fbshipit-source-id: cebb98f74f60a1848dacf9622607249efc7d2099
2018-09-21 14:37:22 -07:00
Jun Wu
1a9c73c079 profiling: add minelapsed config option
Summary:
This config allows us to only log the profiling result if it exceeds a given
threshold. It's helpful for always enabling profiling and only log meaningful
data.

Reviewed By: markbt

Differential Revision: D9828549

fbshipit-source-id: f7e8f7e1e1f834d980519c2a639f3c7fd02f7f42
2018-09-21 14:37:21 -07:00
Jun Wu
8c33c0736a pushrebase: handle tree commits correctly for merges and renames
Summary:
In pushrebase code path, `_getmanifest` needs to be used to obtain the manifest
correctly for pushes from treeonly repos. The merge commit code path missed this
change. Fix it.

Besides, the rename checking code patch can also hit flat manifest errors via
repo.commitctx -> ... -> fctx._copied -> ctx.filenode -> ctx._fileinfo. Patch
that path too.

Reviewed By: phillco

Differential Revision: D9977904

fbshipit-source-id: 8c51aa9cc6bd85b0147d88c61a5af074e36cdb61
2018-09-21 10:26:40 -07:00
Phil Cohen
580e131809 merge: print conflicting paths when rejecting update
Summary: Part of tech debt week; let's make it so any time we reject an update due to conflicts, we print what the conflicts are.

Reviewed By: quark-zju

Differential Revision: D9784659

fbshipit-source-id: 1ee232b728bb602dbeaa4d2ecbc11016edd48dce
2018-09-20 17:21:37 -07:00
Saurabh Singh
a72db7de63 globalrevs: add a configuration option to run in read only mode
Summary:
This commit adds a way to run the `globalrevs` extension only in read
only mode. This is useful in cases where repository `x` pulls from repository
`y`, both the repositories have `globalrevs` and `hgsql` enabled, we only
want to embed `globalrevs` in the commits for repository `y`, and we want to be
able to read the `globalrevs` in repository `x`.

Reviewed By: phillco, quark-zju

Differential Revision: D9978146

fbshipit-source-id: b9530e8e9cfadc28e2cd30e51649cee9e6e144bf
2018-09-20 14:28:07 -07:00
Mark Thomas
d2c1764909 store: encode even longer names further
Summary:
The long filename encoding method introduced in D8527475 is insufficient for
files that have very long names that include some underscores.

For these files, we encode the underscores as `:`.  This character is valid for
filenames on Linux, but won't work on Windows.

Reviewed By: mitrandir77

Differential Revision: D9967059

fbshipit-source-id: 67ea662f48f9fcc40e00b36c86697f3be6aac978
2018-09-20 08:35:09 -07:00
Liubov Dmitrieva
75817a809e commitcloud: make port and TLS options configurable to connect to Commit
Reviewed By: markbt

Differential Revision: D9942698

fbshipit-source-id: b0426498d67cea84d3831ee46a29b32145edb46e
2018-09-20 05:50:53 -07:00
Harvey Hunt
b9debb9853 Add python bindings to BookmarkStore
Summary:
Create Python bindings so that the BookmarkStore can be interacted with
from Python.

Reviewed By: quark-zju

Differential Revision: D9768565

fbshipit-source-id: 00d75b5250d8bc7dbeddd90d80ff4a23c60d00f9
2018-09-20 05:05:08 -07:00
Mark Thomas
a533c07518 commitcloud: revive commits that are visible in the cloud
Summary:
When syncing with the commit cloud, if we have commits that are hidden locally,
but visible in the cloud workspace, and no local obsmarkers waiting to be
synced, revive the cloud-visble commits.

This prevents two repos from oscillating between two views when they have
a conflicting set of obsolescence information that has not been cloud shared.

Reviewed By: liubov-dmitrieva

Differential Revision: D9845984

fbshipit-source-id: 2f44ff8dbc636e2afa56d5efbb3ea5114472c41c
2018-09-19 02:34:56 -07:00
Mark Thomas
216c7fc2c5 commitcloud: add test demonstrating workspace oscillation
Summary:
If two repositories have conflicting obsmarker information that has not been
shared through commit cloud, then they can enter a state where they fight over
the visibility of the commit, and the cloud workspace oscillates between two
views.  This adds a test to demonstrate this occurring.

Reviewed By: quark-zju

Differential Revision: D9845983

fbshipit-source-id: d5c74bed25da5721f273e53df10bf7b88efe2850
2018-09-19 02:34:56 -07:00
Saurabh Singh
c1e276b215 globalrevs: do not wrap extensions if hgsql is bypassed
Summary:
In the current implementation, the `globalrevs` extension complains if
the `hgsql` extension is enabled but bypassed. This creates issues in cases
where the `hgsql` extension is bypassed intentionally as in D5012225. This
commit changes the logic in `globalrevs` extension to not wrap any extensions
if the `hgsql` extension is bypassed intentionally instead of raising an
exception.

Reviewed By: quark-zju

Differential Revision: D9883231

fbshipit-source-id: c57eaad4f661b69752a6457e6ecdd43f377285c1
2018-09-17 13:22:05 -07:00
Mark Thomas
ab55bd31c6 newdoc: fix test failures and warnings
Summary:
Remove newdoc from test-check-code - it's a Sphinx project, so MiniRST
checks don't apply.  Also remove the unused imports from the Sphinx config
file.

Reviewed By: farnz

Differential Revision: D9851834

fbshipit-source-id: c17e83fd96d39423eeedfb8a6cfae382f88c4d5f
2018-09-17 08:56:40 -07:00
Mark Thomas
0ca4acd250 localrepo: add storerequirements feature
Summary:
Add the `storerequirements` feature to the repo.  This means the store may have
a `requires` file, and clients must check it for any store features that they
may be missing.  This allows new requirements to be added that affect the store
when the repo is shared.  Currently there are no store features.

This commit adds support for the feature, and only new repos have the
requirement added.  A future commit will optimistically upgrade repos to
include the requirement.

Reviewed By: quark-zju

Differential Revision: D9699156

fbshipit-source-id: 95c1ab6973d44c02abc69b78a15311fe6a8696fd
2018-09-15 03:22:34 -07:00
Mark Thomas
1b115babba share: add a test demonstrating bad behaviour with requirements
Summary:
The share extension doesn't currently check the requirements of the shared
repo.  This means the shared repo's requirements can't be used to stop older
versions of Mercurial modifying future store versions that they don't
understand.

Reviewed By: quark-zju

Differential Revision: D9699169

fbshipit-source-id: 5a3a6d3389ecd682168f2660b425f4d762771f99
2018-09-15 03:22:34 -07:00
Jun Wu
a9ed32f839 tests: set maxdifflines to 1000 for buck test
Summary:
Buck test does not print outputs directly to the terminal. So it's better to
not limit the diff size.

Reviewed By: singhsrb

Differential Revision: D9842709

fbshipit-source-id: f17c7321d75761fdac21b9def52dec38f7e0b60c
2018-09-14 19:05:35 -07:00
Jun Wu
fb02b06bab fsmonitor: add 'debugrefreshwatchmanclock' command
Summary: See the command docstring for the use-case.

Reviewed By: phillco, strager, singhsrb

Differential Revision: D9836447

fbshipit-source-id: 22ff603ce3e0cd95ea4e400ed24a96c0ea636e6b
2018-09-14 18:25:52 -07:00
Saurabh Singh
e6f4ea31d3 namespaces: make specifying namespace priority mandatory
Summary: This would lead to less surprises than using the default priority.

Reviewed By: quark-zju

Differential Revision: D9818647

fbshipit-source-id: 59214eff84ea0b485ab8ff42b86df1c605a319f5
2018-09-13 16:53:54 -07:00
Saurabh Singh
1030d2b7e5 namespaces: remove redundant name specification in namespace object
Summary:
This is unnecessary after the recent modifications in the namespace
code.

Reviewed By: quark-zju

Differential Revision: D9815973

fbshipit-source-id: d7c6b07226be35ebbbe5354d5c520c9807cc0aa6
2018-09-13 13:59:38 -07:00
Jun Wu
a58e75fae8 lock: unlink temporary symlink placeholder on POSIX
Summary:
On POSIX, a lock is created in these steps:

  1. Take the directory lock to make "test stale lock & unlink" atomic.
  2. Test and remove stale lock.
  3. Create a legacy symlink (placeholder) lock.
  4. Create a temporary file, flock it.
  5. Rename the temporary file to override the symlink lock.

Step 3 is to be compatible with legacy hg programs. However, the error handling
is not great - in case 4 or 5 errored out (ex. Ctrl+C), the symlink file is left
untouched. This diff removes it.

Reviewed By: ikostia

Differential Revision: D9770936

fbshipit-source-id: a004d6326381e304552088bcf322c052254321dd
2018-09-13 12:20:50 -07:00
Mark Thomas
4df24e1861 treemanifest: don't truncate list of candidate manifests
Summary:
`treemanifest._generatepackstream` truncates the list of possible base
manifests to length 2, because `cstore.treemanifest.walksubdirtrees` can only
support two base trees to compare against.  However, it does this too soon, we
can select a different 2 base manifests for each comparison out of the possible
pool.

Reviewed By: quark-zju

Differential Revision: D9788298

fbshipit-source-id: 4ba8753ccc34e09563bebdf90602211a999a02ea
2018-09-13 03:51:34 -07:00
Mark Thomas
361c96f1d3 treemanifest: add test demonstrating compare trees problem
Summary:
This test arranges it so that `treemanifest._generatepackstream` is called with
three possible base manifests, each of which is appropriate for a different
commit.  Because this function truncates the list of candidate base manifests
too soon, we end up with too much data in the bundle.

Reviewed By: quark-zju

Differential Revision: D9788299

fbshipit-source-id: 2147a63108e11750083862abc73c386867549ba2
2018-09-13 03:51:34 -07:00
Jun Wu
1b3e623616 entrypoint: add missing "#!" header
Summary: Otherwise `./entrypoint.py` will be executed as a shell script.

Reviewed By: singhsrb

Differential Revision: D9800130

fbshipit-source-id: 656fb37aae97f1d5757a3f5bba0af701abc84d03
2018-09-12 16:44:28 -07:00
Jun Wu
67db9ced8b test-check-execute: make it a fast test
Summary: `hg files .` is fast. Therefore use it.

Reviewed By: singhsrb

Differential Revision: D9800126

fbshipit-source-id: d22c42599f7a4e923d0261f6cd670dd111965ef9
2018-09-12 16:44:27 -07:00
Jun Wu
aab14173e3 helpers-testrepo: fix the script
Summary:
Broken by D7563731.  Running `exec` in a test will replace the test process.
That means the tests are basically doing nothing. Wrap `exec` in a subshell to
fix it.

Reviewed By: singhsrb

Differential Revision: D9800124

fbshipit-source-id: d4f7f29502dcd2db542f5dd03827a06cc9abd783
2018-09-12 16:44:27 -07:00
Saurabh Singh
6187668183 globalrevs: add namespace to lookup based on global revision numbers
Summary:
We need to look up commits in the repository based on the strictly
increasing global revision numbers. This commit adds the following way of doing
so:

 - `m<number>`: `hg log -r m<number>` would match the commit having `number` as
   the strictly increasing global revision number.

Reviewed By: quark-zju

Differential Revision: D9764819

fbshipit-source-id: b9d3a80852c7acebd0c939a4d4f43c3c9a6cb0ab
2018-09-12 15:09:30 -07:00
Alexandre Marin
cdd06e9ef2 importer - correctly deal with p4 changelist description encoding
Summary:
This fix uses mercurial's encoding.tolocal on the Perforce changelist description
instead of trying to decode it as ascii and ignoring/throwing away non-ascii
characters.

Reviewed By: singhsrb

Differential Revision: D9777614

fbshipit-source-id: 713bd63831c965687b7328de06016b4f351b0469
2018-09-12 14:21:48 -07:00
Jun Wu
b398eaaa6e namespaces: define builtin namespaces with priorities
Summary:
Migrate builtin namespace definition to use the registrar. So we can deprecate
`addnamespace`.

`after` is not expressive enough in certain cases, although it's easier to
understand. Add a `priority` parameter for more explicit ordering handling.

Reviewed By: singhsrb

Differential Revision: D9780363

fbshipit-source-id: 85b9cfb91a7c937eea95f2a279a43c11e561b5fc
2018-09-12 12:35:28 -07:00
Jun Wu
acc7039436 configparser: permit spaces in more cases
Summary:
Be more permissive about spaces. Namely:
- Spaces after a section name like `[foo]    ` are allowed.
- Spaces in config names are allowed.
- Spaces at trailing lines are ignored and no longer insert an `\n` to the previous config.

This makes it closer to the older config parser behavior. But it's still
different on some cases, like `[foo]]`, `[foo] # bar`, `[foo]]` still do not
parse.

Benchmark shows no obvious (within 10%) slowdown. So this is probably fine.

Reviewed By: strager

Differential Revision: D9620253

fbshipit-source-id: 8489ef8e83606d0557db56e8da0a017d55ff1514
2018-09-12 12:05:32 -07:00
Jun Wu
1dc9519dda registrar: add a namespace predicate
Summary:
Previously, there is no easy API to add a namespace with desired order. There
is `extensions.afterloaded`, but that only works for `ui/extsetup`, not for
`reposetup`.

This diff add a namespace predicate so registering a namespace is similar to
registering a revset. It also provides an optional `after` parameter to define
the desired order, like:

  from mercurial import registrar, namespaces

  namespacepredicate = registrar.namespacepredicate()

  namespacepredicate("svn", after=["remotenames"])
  def svn(repo):
      return namespaces.namespace("svn", ...)

Existing namespaces will be migrated by upcoming changes.

This is useful for things wanting to resolve custom names, like globalrevs and
commit cloud.

Reviewed By: singhsrb

Differential Revision: D9775703

fbshipit-source-id: f15827b042d605b9cebc1ee1af6479903f47ee9c
2018-09-11 19:51:56 -07:00
Jun Wu
8a42f77192 test-pushvars: add a test about Python hook
Summary:
The Python hook got "kwargs" without "HG_" prefix. Add an explicit test for it.

Also remove unnecessary configs and change the shell to bash, since we don't
run tests using vanilla "sh".

check-code is updated so it no longer complains about the use of `bash`.

Reviewed By: markbt

Differential Revision: D9561962

fbshipit-source-id: 76a190dde1b0aeb0032a65c173ce6368a28e8cf6
2018-09-11 18:06:13 -07:00
Jun Wu
02ea73b1d5 test-fileset: fix the test on Windows
Summary:
The previous pattern coverts "\\" to "/" too aggressively. Fix the following
test:

  --- test-fileset.t
  +++ test-fileset.t.err
  @@ -50,7 +50,7 @@
     a2
     $ fileset 'a_b'
     $ fileset '"\xy"'
  -  hg: parse error: invalid \x escape
  +  hg: parse error: invalid /x escape
     [255]

Reviewed By: markbt

Differential Revision: D9550579

fbshipit-source-id: db3e32ba90f0c356e5837c692528d546fdd57be4
2018-09-11 18:06:12 -07:00
Saurabh Singh
b0e2154df6 globalrevs: add revsets to look up based on global revision numbers
Summary:
We need to look up commits in the repository based on the strictly
increasing global revision numbers. This commit adds two ways of doing so:

 - `globalrev(number)` revset: `hg log -r 'globalrev(number)'` would match the
   commit having `number` as the strictly increasing global revision number.
 - `m<number>` stringset: `hg log -r m<number>` would also match the commit
   having `number` as the strictly increasing global revision number.

Reviewed By: quark-zju

Differential Revision: D9756146

fbshipit-source-id: db9ecf8f8244634d71957ddb645dfda675cab662
2018-09-11 15:22:26 -07:00
Jun Wu
6f58fc79d4 resolve: enable --root-relative if HGPLAIN is set
Summary:
Some automation actually reads `hg resolve -l` output. D9607987 caused surprise
for them.

Reviewed By: singhsrb

Differential Revision: D9693108

fbshipit-source-id: 68b6efe26d184391924219d56d05f06032441bd2
2018-09-06 16:48:49 -07:00
Phil Cohen
7409181240 tests: remove test-platform.t
Summary: It's still been failing and we probably don't need to worry about maxrss failing any time soon.

Reviewed By: singhsrb

Differential Revision: D9671400

fbshipit-source-id: e847a240285c2aa2fa15d49ec4fb010483278e9d
2018-09-05 19:35:33 -07:00
Liubov Dmitrieva
e638e652e9 commitcloud: add option to select only commits related to the user in the default workspace
Summary:
this is usefull when a user have a lot of other users commits in the default workspace

the set of commits includes all the stacks where at least one commit is user's own

the option is for the default workspace only, it doesn't apply for other workspaces a user may collaborate in

the idea is that the client code will never offer other user's commits to sync, so cloud sync will perfectly work with some extra commit might present on any machine.

this allow users to continue have other users commits in their workspace for review or other purposes even if it is very very large, but provides reliable backup and sync solution for user's own work.

the option works for all commands `hg cloud join` `hg cloud rejoin` `hg cloud sync` and `hg cloud recover`

Reviewed By: simpkins

Differential Revision: D9645571

fbshipit-source-id: 9adb68568083c87c22bb86c19fb7a5bb0f639265
2018-09-05 17:39:31 -07:00
Phil Cohen
a0358711b6 tests: try to make test-platform a bit less flaky
Summary: This test fails from time to time. Let's widen the upper bound for maxrss a bit. If it continues to fail we can just delete the test.

Reviewed By: quark-zju

Differential Revision: D9659411

fbshipit-source-id: ef65d96919ddc809a29c5cd811dfa0bec780e722
2018-09-05 12:10:12 -07:00
Phil Cohen
e5f1622604 tests: add glob to test-fb-hgext-obsshelve.t
Summary:
This test has been flaking out and breaking the build when the shelve was made >1s ago.

cc @[1266426728:Kostia Balytskyi]

Reviewed By: singhsrb

Differential Revision: D9645529

fbshipit-source-id: 575cb4272710d60c27e61aa519da32f4d2291eff
2018-09-04 13:36:25 -07:00
Kostia Balytskyi
4a7c319c2e hg: make shelve not abort on every transaction with treemanifest
Summary:
Before this commit, `treemanifest` registered a post-transaction hook to
prefetch data for the parents of new commits. Shelve produces a hidden
commit, so this logic failed, since it used a filtered repo instance.

Let change it to use unfiltered repo and remove all of the hidden commits
from the revset to avoid surprises.

Reviewed By: markbt

Differential Revision: D9613454

fbshipit-source-id: 5caddd2948e5d2e982462bebdb950b359995baa1
2018-09-03 04:51:49 -07:00
Ryan McElroy
5edc0d3281 resolve: use relative paths with option to override
Summary:
Previously, we would show root-relative paths. Now we show cwd-relative
paths unless the --root-relative flag is passed.

Reviewed By: phillco, farnz

Differential Revision: D9607987

fbshipit-source-id: 6c24c05317c165f88d2a83d6921d1520044a9b6e
2018-09-03 03:05:10 -07:00
Ryan McElroy
92e30ff38c merge: allow "always" continuing when on-failure=prompt
Summary:
When I first rolled this feature out, many people liked it but enough
people complained that it would prompt after EVERY file when sometimes they
wanted to always continue (although they were fine with the initial prompt).

This adds the new "always" option to the prompt.

Reviewed By: quark-zju

Differential Revision: D9607680

fbshipit-source-id: 76989b346ed9dd88048a37bcad6dcddd8325f314
2018-09-03 03:05:10 -07:00
Matt Glazar
aa0316fa51 Fix test-lfs-test-server.t
Summary:
test-lfs-test-server.t is failing because of spurious output from Bash:

```
======================================================================
FAIL: test_lfs_test_server_t (scm.hg.tests.unittestify.hgtests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/users/strager/fbsource/fbcode/buck-out/dev/gen/scm/hg/tests/hg_run_tests#binary,link-tree/scm/hg/tests/unittestify.py", line 96, in runsingletest
    raise self.failureException(err + out)
AssertionError:
 --- test-lfs-test-server.t
+++ test-lfs-test-server.t.err
@@ -158,6 +158,7 @@
 (Restart the server in a different location so it no longer has the content)

   $ $PYTHON $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
+  $TESTTMP.sh: line 116: 2128544 Terminated              lfs-test-server &>lfs-server.log
   $ rm $DAEMON_PIDS
   $ mkdir $TESTTMP/lfs-server2
   $ cd $TESTTMP/lfs-server2
@@ -187,3 +188,4 @@
 Clean up:

   $ $PYTHON $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
+  $TESTTMP.sh: line 140: 2130121 Terminated              lfs-test-server &>lfs-server.log  (wd: ~/lfs-server2)

ERROR: test-lfs-test-server.t output changed
!
Failed test-lfs-test-server.t: output changed
```

If this this test wasn't broken, it would have caught a bug introduced by D9478744 (fixed by D9619464). Fix the failures to make the test pass again.

Reviewed By: quark-zju

Differential Revision: D9619647

fbshipit-source-id: 989db431a28ab2d491ced70dc9113998b0ddb5f5
2018-09-01 13:20:34 -07:00
Jun Wu
610acb415f directaccess: fix revset travesal
Summary:
Previously, revset like

  ('or',
   ('list',
    ('string', '00ff93e1af4dc4ce7effb69afd0b91551cf1fe72'),
    ('func', ('symbol', 'smartlog'), None)))

won't be processed because len(tree) == 2. Change the logic to recursively
enter the tree. I think this is a regression since [revset: remove order information from tree](mercurial-scm.org/repo/hg/rev/1b28525e66982a50c33a7163228afdc785e8ca58).

Reviewed By: ryanmce

Differential Revision: D9615771

fbshipit-source-id: ea3c11b291743ade32357652f3c6790d65b83e5d
2018-08-31 14:36:36 -07:00
Kostia Balytskyi
e86c24cc01 hg: make shelve --patch work without arguments
Summary: Seems like a sensible thing to do

Reviewed By: lukaspiatkowski

Differential Revision: D9613215

fbshipit-source-id: ed7bfa436edcaa988e77c568a3a5c74bacff63a8
2018-08-31 08:20:57 -07:00
Stanislau Hlebik
782da103f1 fix pushrebase recording
Summary:
It was trying to add a recording for non-pushrebase pushes. It did not result
in failure, but it did result in an annoying warning.

Reviewed By: farnz

Differential Revision: D9570530

fbshipit-source-id: de999a60c146cc49a1a5fd057b6037cf9f73e367
2018-08-31 03:52:07 -07:00
Jun Wu
1782010568 directaccess: also deal with strings
Summary:
In revset AST, there are 2 types - string and symbol.

We had users hitting filtered node error by using revset like:

  'only('\''83f5'\'','\''a9ee'\'')'

The extra quoting made the commit hashes "string" instead of "symbol",
and directaccess didn't handle them.

As we're here, also clean up the comments to make it easier to understand.

Reviewed By: singhsrb

Differential Revision: D9564685

fbshipit-source-id: 567e3a1d0b88c3aab269a537f2db6671c4dda95d
2018-08-29 19:20:45 -07:00
Jun Wu
20a01dee08 run-tests: improve reliability killing hang tests
Summary:
Write a test that hangs forever, like:

  $ hg init
  $ hg serve -p 0

`run-tests.py --timeout 3` cannot handle it (on both Windows and Linux). It
only tries to kill the bash process, and the `hg serve` process stays running.

For some reason, existing tests are more likely hang on Windows. Therefore we
need a way to reliably kill processes and their descendants. Windows provides
Job Object [1] which reliably solves the problem.

On POSIX, process group is used. It's less reliable because processes can
escape from the group by using setpgid, etc. But it's already better than
before.

[1]: https://docs.microsoft.com/en-us/windows/desktop/procthread/job-objects#managing-processes-in-jobs

Reviewed By: phillco

Differential Revision: D9516042

fbshipit-source-id: 970fce7ba24d0e9bafd66438354de2e6df761edf
2018-08-27 13:05:30 -07:00
Jun Wu
1fe370b4f9 run-tests: add progress bars
Summary:
Similar to buck. Show progress for running tests.

This also improves Ctrl+C handling. It's now more
responsive since we no longer wait for the entire
output.

Reviewed By: phillco

Differential Revision: D9516040

fbshipit-source-id: 98b29228177510855e29da341198697da940884c
2018-08-27 13:05:30 -07:00
Jun Wu
b14232f56c run-tests: truncate diff output
Summary:
`.t` tests are stateful. This means if some early parts do not execute
as the test expect, the the remaining parts can break in funny ways,
and generate lots of uninteresting output.

Limit the length of the diff output so the "likely" boring parts won't show
up by default. The change can be overridden by `--maxdifflines`.

Reviewed By: phillco

Differential Revision: D9516041

fbshipit-source-id: 6c998cdc73ae4a45e2f4167c22c04df51392da29
2018-08-27 13:05:30 -07:00
Jun Wu
783b7ae902 windows: use MSYS binaries to support run-tests.py
Summary:
MSYS provides binaries that tests need so we no longer
depend on system binaries, which might be broken.

MSYS can provide `make.exe` to make `make local` working,
so we don't depend on other things to provide `make`.

As we're here, change `run-tests.py` to use the right Python
interpreter and escape Windows paths.

Reviewed By: phillco

Differential Revision: D9505926

fbshipit-source-id: f17e77dfc599069d4fe849057b7a198758c2dd42
2018-08-27 11:36:42 -07:00
Liubov Dmitrieva
b4b2a00950 diff allow remote obsoleted revisions to be pulled if missing
Summary:
The goal is to improve backup experience, make repo after recovery to behave as it was for the most popular commands.

This is only if backup is backed by cloud sync because we have more meta information in the repo.

the commands:

`hg diff --since-last-submit`
`hg log -r 'lastsubmitted(.)'`
`hg unamend`

for example, are not working for fresh repos that are recloned because the repo will only contains the latests snapshot of commits and also all obsmarker history but not obsoleted commits.

those are popular commands, so let's make them work.

the standard error there is 'unknown revision' and it is very confusing for users

there is no reason not to pull a remote obsoleted revision into the repo if needed, and there is no reason to ask user to do that manually.

the obstore is still lazy loaded, so shouldn't be perf problems

this diff supports good range of commands, so should make experience for our backup use case users significantly better.

pulling the hidden revisions is also relatively fast and doesn't affect commit cloud state of the repo in any way

Reviewed By: quark-zju

Differential Revision: D9437518

fbshipit-source-id: 01065c642aa9a194f2d321f03c1bd747f57c74b1
2018-08-24 05:51:45 -07:00
Jun Wu
a987ecb9b2 ui: use Rust config parser in Mercurial
Summary:
Switch `ui.load` and `ui.readconfig` to use the Rust config parser.
`ui` now no longer depends on `config.config` or `rcutil`.

Pest's error messages are fancier, thus most test changes.

For the fbsource repo, debugshell shows the new code is 10+x faster:

On laptop:

Before:

  In [1]: %timeit m.ui.ui.load()
  10 loops, best of 3: 27.8 ms per loop

After:

  In [1]: %timeit m.ui.ui.load()
  100 loops, best of 3: 1.85 ms per loop

On devserver:

Before:

  In [1]: %timeit m.ui.ui.load()
  100 loops, best of 3: 16.8 ms per loop

After:

  In [1]: %timeit m.ui.ui.load()
  1000 loops, best of 3: 1.28 ms per loop

Since `ui._rcfg` is no longer copy-on-write, there is concern about `ui.copy()`
performance. It is faster too (on devserver):

Before:

  In [1]: %timeit ui.copy()
  1000 loops, best of 3: 198 µs per loop

After:

  In [1]: %timeit ui.copy()
  10000 loops, best of 3: 157 µs per loop

The old `ui.py` was copied to `legacyui.py` and can replace the new `ui.py` if
a config file exists on the system.  This provides a way to switch back to the
old config parser in case of emergency.

Reviewed By: mitrandir77

Differential Revision: D8887375

fbshipit-source-id: 2951ca622c77bf41187ad5c5cab3445cda0dc519
2018-08-23 17:52:52 -07:00
Jun Wu
07f3d004cc summary: remove branch related logic
Summary:
I noticed `hg summary` takes 32 seconds running in my local repo. Profiling
shows 30 seconds spent on `changelog.findmissing`. We don't use branches and
heavily patched other places to get rid of branch heads logic. So let's remove
them from `hg summary` too.

Reviewed By: phillco

Differential Revision: D9477205

fbshipit-source-id: 17b07190b6dcc96bc3a5f3c2b5ff4aa1366f4904
2018-08-23 17:35:01 -07:00
Saurabh Singh
9f912dccda test-lfs-localstore: make test more robust
Summary:
This test fails on `OSX` with the following error:

```
  $ find $TESTTMP/remote | grep '/../' | sort
+  $TESTTMP/remote
+  $TESTTMP/remote/96
   $TESTTMP/remote/96/85eb765661ea3b95f31e1bb3c3b5501d0c2acdf353feeaa4d8fe32f95f77fb
+  $TESTTMP/remote/ab
   $TESTTMP/remote/ab/861dc170dc2e43224e45278d3d31a675b9ebc34c9b0f48c066ca1eeaed8ee6
```

This commit addresses that issue by only checking for the important paths.

Reviewed By: quark-zju

Differential Revision: D9491589

fbshipit-source-id: 42941b9a7b8ca0f9ac6df1ef85598e78d14e1355
2018-08-23 17:05:39 -07:00
Jun Wu
af0a2ecb8b lfs: add a config to skip writing to localstore
Summary:
We'd like to enable `lfs.url` on hg servers to make blob verification work
without downloading actual blobs. Previously, the LFS local blob store is
always backed by the local filesystem. D6699099 added a simple in-memory store
for another purpose. That in-memory local store fits the
"avoid downloading to disk" purpose. So let's add a config option to use it.

Reviewed By: zhh95

Differential Revision: D9478744

fbshipit-source-id: 69b04cd719cedb77f01b90b4666676c8f38584a1
2018-08-23 11:01:07 -07:00
Jun Wu
d5391483e7 lfs: add a config option to disable LFS object verification
Summary:
The verification also runs client-side and that can cause issues with complex
treemanifest setups.

Therefore turn the verification off by default. It would be enabled on the
server-side.

Reviewed By: phillco

Differential Revision: D9478745

fbshipit-source-id: 299b9180c661023d8e2358eedeae7b5c7d36ab79
2018-08-23 00:35:16 -07:00
Jun Wu
3a1a154516 lock: suggest running debugprocesstree to figure out what's blocking
Summary: This would help people unblock themselves.

Reviewed By: markbt

Differential Revision: D9443602

fbshipit-source-id: f05e2b2390a88a9280149d2164c2d7ab71c29600
2018-08-22 21:35:19 -07:00
Jun Wu
98c4b5d665 debugcommands: add a "debugprocesstree" command
Summary:
Recently there are a trend of questions about repo being locked. People usually
don't have enough debugging skills to find out what's going on. So let's add a
debug command to help them.

The implementation uses `osqueryi`, which perfectly solves the cross-platform
process handling headache. Note the well-known `psutil` Python library does not
seem to provide parent process information on Windows.

The `_rapply` function was backported from upstream mercurial.

Reviewed By: markbt

Differential Revision: D9443601

fbshipit-source-id: d26b3adfde1045ebd5bca1c6b1c93f0db147f9b0
2018-08-22 21:35:19 -07:00
Kaley Huang
61aa294522 fix buck test
Summary: fix flaky buck test

Reviewed By: quark-zju

Differential Revision: D9465687

fbshipit-source-id: d27f1b8ed5d8eb0ffe15aa92400afc92dfd8238a
2018-08-22 12:26:02 -07:00