Commit Graph

44376 Commits

Author SHA1 Message Date
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
294884234e shelve: fix configs after renaming obsshelve as shelve
Summary: See title.

Reviewed By: singhsrb

Differential Revision: D10261259

fbshipit-source-id: 24df3f7f337da8bbf982fc3cb849fe5ba7dab5a3
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
Jun Wu
c03ff848a1 setup: add missing module
Summary: Python modules should be listed in `setup.py`

Reviewed By: singhsrb, HarveyHunt

Differential Revision: D10277040

fbshipit-source-id: 1247a90b1883d26e675720654b59ba849bec86ee
2018-10-09 15:25:08 -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
Mark Thomas
1dd98fc926 namespaces: fetch template columns names when creating namespace
Summary:
The `columns` attribute of the `namespaces` module calls
`templatekw.getlogcolumns()` when the `namespaces` module is loaded.  This can
sometimes be too soon (it depends on demandimport), which means it can be loaded
before the translations are loaded.

Delay loading the column names until the namespace is actually created.

Reviewed By: singhsrb

Differential Revision: D10257778

fbshipit-source-id: 5babd06036f91c06de4d5804eb888c525aa34ae1
2018-10-09 09:03:14 -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
Saurabh Singh
ec574e09dd doc: fix Makefile for doc after commands.py to commands/__init__.py
Summary:
Recently we moved commands.py to a folder structure which broke `make
doc`. This commit fixes the same.

Reviewed By: ikostia

Differential Revision: D10255835

fbshipit-source-id: e0bdc6ce58fd8a5bf55a5f5e5b8bb361cb85f660
2018-10-09 07:54:35 -07:00
Saurabh Singh
1ffa44eae3 zstd-sys: update the package version
Summary: The old version cannot be found and its making the build fail.

Reviewed By: markbt

Differential Revision: D10255834

fbshipit-source-id: d14572885423622ecfe3730bbda07ae1bee7363a
2018-10-09 07:26:31 -07:00
Mark Thomas
43c0f83739 revset: fix gendoc for ancestorsaged
Summary:
The ancestorsaged revset documentation is invalid as it attempts to use a
literal block, which can't be used in doc comments.  Change it to use a bullet
list for now.

Reviewed By: singhsrb

Differential Revision: D10255821

fbshipit-source-id: 6f75b5ba22899d938cdf585fc87082372468e352
2018-10-09 06:59:27 -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
Lukas Piatkowski
d01ebe2166 rust-crates-io: add crossbeam to tp2
Reviewed By: ikostia

Differential Revision: D10244968

fbshipit-source-id: 8d06bb64b6a1227ae589caf0588a1f3657603ce9
2018-10-08 21:32:00 -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
Liubov Dmitrieva
562512c791 move commands.py to a separate folder for future split up
Reviewed By: ikostia

Differential Revision: D10239826

fbshipit-source-id: 19f7aa3455ac64a84153619dd1a1aaf38b71ad35
2018-10-08 10:32:37 -07:00
Saurabh Singh
2def7c19e2 packaging: back out D10213071 to fix continuous build
Summary: D10213071 broke the continuous build. Therefore, backing it out.

Reviewed By: ikostia

Differential Revision: D10238353

fbshipit-source-id: 0b387f6dd802614112cdc969944cbe4c40582b3d
2018-10-08 08:54:08 -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
1cde64ae27 rustlib: move Cargo.toml to top-level
Summary:
This makes all crates' cache shared and unifies Cargo.lock, which
is used by the next diff.

Reviewed By: ikostia

Differential Revision: D10213071

fbshipit-source-id: 48a979c41423a8e8a9795ff102646cce13c39ff4
2018-10-05 16:43:47 -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
Jacob Bower
a2c598e9ba Fix handling of --rev when using hg diff --since-last-submit-o2
Summary: Second-order diff was hardcoded to use "." even if another rev was specified on the CLI.

Reviewed By: shashkambh

Differential Revision: D10212547

fbshipit-source-id: b9867ba3e2141ee3c9a8c67a83e9c039da2abf41
2018-10-04 19:03:09 -07:00
Durham Goode
c1729ce764 sampling: don't execute reposetup for peer repos
Summary:
The sampling logic can't work on peer repos, so let's not run it's
reposetup on them. This can happen if the sampling extension is enabled
globally, or gets enabled via a command line flag.

Reviewed By: quark-zju

Differential Revision: D10184240

fbshipit-source-id: db1bec17836dc672454a5390209ac1ded538e8b0
2018-10-04 11:59:14 -07:00
Liubov Dmitrieva
06d5f3aa9c commitcloud: add more imformation to the commit message
Summary: this will allow advanced user to check manually what's wrong with the command

Reviewed By: mitrandir77

Differential Revision: D10192629

fbshipit-source-id: 4073525e3a31b59e841e13900db363e6f23c85e3
2018-10-04 05:21:44 -07:00
Jun Wu
100c360e54 indexedlog: mark block as non-code
Summary:
The code block is not a valid Rust program. Mark it as "plain".
This fixes `cargo doc`.

Reviewed By: markbt

Differential Revision: D10137806

fbshipit-source-id: 1197d3a2ebc1450a0738686fa6cfa7c7b79dcb0d
2018-10-03 18:19:27 -07:00
Jun Wu
7752e9e81f rustlib: move Node to a separate "types" crate
Summary:
The `Node` type will be used in multiple places. Let's move it to a standalone
crate so new libraries depending on it won't need to pull in all of
revisionstore's dependencies.

Note: I'd also like the `types` create to only define clean types. Given the
fact NULL_ID is not a great design in Mercurial (`Option<Node>` is a better
choice in Rust), it probably does not belong to the formal Rust `Node` type.
This diff is merely about moving things with minimal changes. NULL_ID will
be decoupled from `Node` in a follow-up.

Reviewed By: markbt

Differential Revision: D10132047

fbshipit-source-id: 5d05c5e0ac06a2d58556c4db11775503f9495626
2018-10-03 18:19:27 -07:00
Jun Wu
ad910092e1 pushrebase: fix None handling for ontoctx
Summary:
`ontoctx` could be `None`. In that case `.hex()` will fail.
Fix it by recording `ontorev` as `None` in that case.

Reviewed By: liubov-dmitrieva

Differential Revision: D10178579

fbshipit-source-id: e7fdcfe1bc59043685b6da790c28c4a83c514043
2018-10-03 13:32:56 -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
43c0f47cf5 treemanifest: don't fallback to flat manifests on a treeonly server
Summary:
This flow shouldn't ever be hit, but it was exposed by the bug fixed in
the previous patch. Let's go ahead and make this code path not fall back to flat
manifests if the server is treeonly.

Reviewed By: quark-zju, singhsrb

Differential Revision: D10156426

fbshipit-source-id: c766bca318712b61fd1b851990849f3d93362c2e
2018-10-03 08:52:19 -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
Anastasiya Zhyrkevich
738ff52979 attempt to get rid of duplicates during getfiles
Summary:
*Symptom:*
I have taken requests with longest time completion on Mercurial.
According to args logged in the request, remotelogfileserver was processing files with duplicates (same path and same filenodeid), which were going one by one.

*Investigations:*
According to some requests, duplicates among files are files of large size (> 1158513 bytes).
I have made a separate 'getfiles' request from local machine with the changed prefix_key for cacheprocess, to make sure, that remotefilelog.cacheprocess does not duplicate file_ids.
The changed key is required to get cache miss.

hg --config remotefilelog.cacheprocess=scmmemcache changed_prefix_key

I did not managed to simulate the case, with large file chunk cache miss.

*Solution*
To get rid of duplicates before running to server. Make a devel.warn if duplicates appear.

Reviewed By: quark-zju

Differential Revision: D10108311

fbshipit-source-id: e21ae4f8feab94a6762d53a74b503bb469783f60
2018-10-01 05:58:03 -07:00