Commit Graph

45023 Commits

Author SHA1 Message Date
Jun Wu
89882201b0 posix: detect fuse.ntfs on Linux
Summary:
On linux, ask /proc/self/mountinfo for the block device information, and then
ask udev for the filesystem type. It works for block devices, and is what
util-linux tools like findmnt, lsblk do.

This detects ntfs-3g mounts of block devices as `fuse.ntfs`.

Reviewed By: DurhamG

Differential Revision: D13982877

fbshipit-source-id: eacea6a949b54d9a6483f2c55c437718eb89c243
2019-02-06 18:34:30 -08:00
Jun Wu
efba35645a osutil: detect fuse on Linux
Summary:
The constant is not exposed in linux/magic.h, perhaps because fuse is an
optional feature. It's unlikely to be changed. Define it so fuse fstype
can be detected.

Reviewed By: DurhamG

Differential Revision: D13969640

fbshipit-source-id: 5084bdacf193261a187a74546a82995f2dd2d7c6
2019-02-06 18:34:30 -08:00
Stefan Filip
162f93f205 Remove argparse from the lib cargo workspace
Summary: `lib/argparse` fails to build with cargo. Removing the crate from the workspace to unblock building with cargo.

Reviewed By: quark-zju

Differential Revision: D13969332

fbshipit-source-id: 0299f74e6aa81632ce64005d91fa2c30a32f5b96
2019-02-06 16:42:23 -08:00
Jun Wu
54d5d24c00 test-convert-svn-branches: rewrite parts related to named branch
Summary:
Change the test to test extras instead of branches so it could still work
once `hg branches` gets removed.

Reviewed By: phillco

Differential Revision: D13934439

fbshipit-source-id: 60860936f60e177e12547345cbbd7591b1161a6f
2019-02-06 14:43:37 -08:00
Jun Wu
8a72b3e097 test-convert-svn-move: rewrite part related to named branch
Summary:
Change the test to test extras instead of branches so it could still work
once `hg branches` gets removed.

Reviewed By: phillco

Differential Revision: D13934445

fbshipit-source-id: e15c5b652481fcf95df851cdda8998764a98660c
2019-02-06 14:43:37 -08:00
Jun Wu
c54158e546 test-convert: remove part related to named branch
Summary: Named branch is going away globally.

Reviewed By: phillco

Differential Revision: D13934441

fbshipit-source-id: 74802d7bc118b8a379a9fde3b7ac74dfc4627cac
2019-02-06 14:43:37 -08:00
Jun Wu
a6a3bea200 test-fb-hgext-tweakdefaults: remove part related to named branch
Summary: Named branch is going away globally.

Reviewed By: phillco

Differential Revision: D13934434

fbshipit-source-id: c66f3370c09967d152524148f5ba403a7cecd928
2019-02-06 14:43:37 -08:00
Jun Wu
d0ec549a08 test-fb-hgext-treemanifest-treeonly-copyamend: stabilize the test
Summary:
Not sure why it's unstable. But the fetch stat gets printed sometimes. Add it
as an optional line.

Reviewed By: phillco

Differential Revision: D13934444

fbshipit-source-id: 3c39737fe95b1572ffcf672a7d8d431218202402
2019-02-06 14:43:37 -08:00
Jun Wu
515d86cdd7 test-issue842: remove the test
Summary:
The test was about warning of "heads". We allow multiple heads and have already
disabled some checkheads code paths (ex. D8148016). With commit cloud multiple
heads are a norm and not something that should be warned.

Reviewed By: phillco, singhsrb

Differential Revision: D13934438

fbshipit-source-id: e2e4971e05c5e0ca3ed4a5160c16d90f4f847e5f
2019-02-06 14:43:37 -08:00
Jun Wu
3febfb99dc test-issue619: remove the test
Summary:
The test was testing "fast-forward" merge, like:

  b
  |
  a (working copy, run "hg merge b && hg ci -m merge")

It's a no-op without branches. But if "a" and "b" have different branches, the
merge would do something and create a merge commit.

Without named branches, fast-forward merge would always be a no-op. Therefore
remove the test.

Reviewed By: phillco, singhsrb

Differential Revision: D13910539

fbshipit-source-id: 9f5a7817a3ff012d429810da3d54ab2174371bd0
2019-02-06 14:43:37 -08:00
Jun Wu
f48c2ace51 test-histedit-outgoing: drop branch related test cases
Summary: Branches will be disabled. Remove usage of them.

Reviewed By: phillco

Differential Revision: D13910540

fbshipit-source-id: 9d9c778afcb585197134adfa173103e81ae9ddcd
2019-02-06 14:43:37 -08:00
Jun Wu
15fd077a20 test-histedit-commute: avoid using branches
Summary: Branches will be disabled. Remove usage of them.

Reviewed By: phillco

Differential Revision: D13909733

fbshipit-source-id: 38c0dd487fa0756413d21de2990e76c5a6d321f7
2019-02-06 14:43:37 -08:00
Jun Wu
82116cc8ef test-verify: avoid using branches
Summary: Branches will be disabled. Remove usage of them.

Reviewed By: phillco

Differential Revision: D13910538

fbshipit-source-id: 971484beb7788d827892da958873f455b1ee34a3
2019-02-06 14:43:37 -08:00
Jun Wu
518db59b95 test-bundle: avoid using branches
Summary: Branches will be disabled. Remove usage of them.

Reviewed By: phillco, singhsrb

Differential Revision: D13909728

fbshipit-source-id: 2a4ae06f012e79979f6bebc285e841a88d5dc3a1
2019-02-06 14:43:37 -08:00
Durham Goode
af61927d32 remotefilelog: add documentation for remotefilelog.getfilesstep
Summary:
This is breaking the tests. It has existed for years, so not sure why
the recent reformatting broke it now.

Reviewed By: quark-zju

Differential Revision: D13976462

fbshipit-source-id: 08f3a9f08ec54449b4554017ea9806f3ee51afcb
2019-02-06 13:02:59 -08:00
Jun Wu
ac67645de2 ignore: stop using "{}" patterns
Summary:
Those are treated differently in eden or git vs ripgrep's ignore crate.
Tracking issue: https://github.com/BurntSushi/ripgrep/issues/1183

Change the gitignore rule to ignore `{}` patterns to solve the issue.

Reviewed By: sfilipco

Differential Revision: D13924426

fbshipit-source-id: 910bfff159509f2840ddcd4b4351577629228257
2019-02-06 13:02:59 -08:00
Aida Getoeva
562b9d1884 prefetch: remove check misses after fetching from server
Summary: We don't really need to check misses here as neither of request fucnctions return misses after fetching from the server. They raise exception if there are any misses.

Differential Revision: D13908252

fbshipit-source-id: 80b6e4fb79b419b5e6d3b343b3bd46d3f8dc7d3c
2019-02-06 10:43:15 -08:00
Aida Getoeva
996ac6da37 prefetch: add requestpacks
Summary: Implemented logic for fetching data from the scmmemcache and the server in pack files format. By default `prefetch` will still use loose files, unless the `remotefilelog.fetchpacks` config flag will be set to true.

Differential Revision: D13905733

fbshipit-source-id: cc559f5bc600067199a91efe6cf44b1bde6bf69b
2019-02-06 10:43:15 -08:00
Aida Getoeva
d853db727d prefetch: add get/set for pack files and remove hitcount
Summary: New get/set protocols for pack files. Also removed hitcount from `receive` method, because it is not used.

Differential Revision: D13924759

fbshipit-source-id: 1382b6f2bc865a19125f3ccd17a779cd16f08b50
2019-02-06 10:43:15 -08:00
Aida Getoeva
2b23a376f6 prefetch: get packs' paths after fetching from server
Summary: To add the data fetched from the server to the scmmemcache, we need to know pasths to the packfiles created.

Differential Revision: D13905734

fbshipit-source-id: 7c470b560e32e63e7df4f960be92bc9b6da9de3d
2019-02-06 10:43:15 -08:00
Aida Getoeva
3ea6881ea7 prefetch: move "fetch from server" code to the requestloose
Summary: Moved fetching loose files from the server to the separate function

Reviewed By: DurhamG

Differential Revision: D13855807

fbshipit-source-id: 39821644abcdc7375ba1b9ef9519fd2083eb0a71
2019-02-06 10:43:15 -08:00
Aida Getoeva
e218de341c prefetch: add set and get request
Summary: Move scmmemcache set/get commands protocol to the cache wrapper to isolate it from the main logic

Reviewed By: DurhamG

Differential Revision: D13855809

fbshipit-source-id: 95b70f7f9d10d97beff107f9f6e5e4f5a8a307c1
2019-02-06 10:43:14 -08:00
Aida Getoeva
79a1bd7770 prefetch: return set of misses instead of list
Summary: List of missed files is converted to a set many times. So changing the type to a set.

Differential Revision: D13924760

fbshipit-source-id: 65fe52ff6113724d8f7f7a8d5b3c1501f245eedc
2019-02-06 10:43:14 -08:00
Aida Getoeva
494608cf81 prefetch: add receive
Summary: Move scmmemcache receive logic to the cache wrapper to isolate it from the main prefetch logic

Reviewed By: DurhamG

Differential Revision: D13855808

fbshipit-source-id: d0da84857797e3e155507fcf284b39a146677e54
2019-02-06 10:43:14 -08:00
Durham Goode
b7e3b68374 packaging: include edenscm/__init__.py in packages
Summary:
On windows we use zip files to load the mercurial packages, but this
was failing because the edenscm module did not have an __init__.py file. Let's
include that in the build.

Reviewed By: singhsrb

Differential Revision: D13974190

fbshipit-source-id: 90e2cc5256fa08281202e11292e3ddf4cc000c01
2019-02-06 10:35:50 -08:00
Durham Goode
163704f80a disablesymlinks: add extension to disable symlinks
Summary:
In some cases we are mounting ntfs in a linux host using ntfs.3g and we
want to prevent it from writing symlinks that can't be read from Windows.

Some background, ntfs.3g supports symlinks, but it produces IntxLNK which cause
problems when mounted into a real Windows machine. We don't support symlinks on
Windows anyway, so we want to just disable this. Unfortunately it's difficult to
detect if we're on a ntfs.3g fuse mount, so instead we're just going to have the
machine set up the repo with this extension enabled.

Differential Revision: D13964546

fbshipit-source-id: 7545538e51be4c986a50161165d7cc2e64280555
2019-02-06 08:41:34 -08:00
Arun Kulshreshtha
8aaab173c0 bindings: convert to Rust 2018
Summary: Convert crate to Rust 2018.

Reviewed By: quark-zju

Differential Revision: D13963023

fbshipit-source-id: f81a1ecd505d3bdc70c41f5272f861fdd737a8fc
2019-02-05 21:22:48 -08:00
Arun Kulshreshtha
bdecba1c92 edenapi: enforce HTTP/2 prior knowledge
Summary: Ensure that Hyper uses HTTP/2, since we'd like to support connection reuse and multiplexing.

Reviewed By: DurhamG

Differential Revision: D13925320

fbshipit-source-id: 0f39e66fe35a0dc95966d16772d1ab8988067c11
2019-02-05 21:22:48 -08:00
Arun Kulshreshtha
5f6998719e edenapi: add static builder() method to get a client Builder
Summary: In Rust it is typically more idiomatic to have a static method on a struct to produce a builder, since this means the builder doesn't need to be explicitly imported to construct a new instance of the struct.

Reviewed By: DurhamG

Differential Revision: D13925323

fbshipit-source-id: c06d5d42ba941dbbb2c619f9470e79fa23f35f68
2019-02-05 21:22:48 -08:00
Arun Kulshreshtha
70aff50986 edenapi: rename mononokeapi to edenapi
Summary: Rename Mononoke API to Eden API, per war room discussion.

Reviewed By: quark-zju

Differential Revision: D13908195

fbshipit-source-id: 94a2fe93f8a89d0c5e9b6a24939cc4760cfaade0
2019-02-05 21:22:48 -08:00
Arun Kulshreshtha
6eab7a5222 mononokeapi: use auth section for TLS configuration
Summary:
Use the hgrc auth section to configure HTTP data fetching. For example:

```
[mononoke-api]
enabled = true
url = https://mononoke-api.internal.tfbnw.net

[auth]
mononoke-api.prefix = mononoke-api.internal.tfbnw.net
mononoke-api.schemes = https
mononoke-api.key = /var/facebook/credentials/$USER/x509/$USER.pem
mononoke-api.cert = /var/facebook/credentials/$USER/x509/$USER.pem
```

Reviewed By: DurhamG

Differential Revision: D13907185

fbshipit-source-id: 3b607f25912a85438b56c4ea7ab9cfed91ab7e85
2019-02-05 21:22:48 -08:00
Jun Wu
eaebf8d02d commands: drop unnecessary "config(..., default=...)"
Summary:
The default value is specified in configitems.py. Remove the `default`
argument.

Reviewed By: phillco

Differential Revision: D13909730

fbshipit-source-id: ca45c63be7d48e04e71a6f5b3b682f625a3030f6
2019-02-05 20:36:03 -08:00
Jun Wu
50932456ad tests: drop experimental.single-head-per-branch feature
Summary:
This reverts the upstream changeset:

  changeset:   66ecde8a704d9fa92bd99720923524c4bd3f315b
  user:        Boris Feld <boris.feld@octobus.net>
  date:        Wed, 15 Nov 2017 18:52:42 -0800
  summary:     server: introduce a 'experimental.single-head-per-branch' option

Named branches are going to be removed. Remove experimental dependent feature.

Reviewed By: phillco

Differential Revision: D13909727

fbshipit-source-id: 3baf101e5a038b58bc01506826b631a2a58a7782
2019-02-05 20:36:03 -08:00
Jun Wu
57079875b1 tests: remove tests mainly related to named branches
Summary: Named branches are going to be removed. Remove directly related tests.

Reviewed By: phillco

Differential Revision: D13909726

fbshipit-source-id: 6f7f39b4129bb5840a90501ef251b3f5971c82fe
2019-02-05 20:36:03 -08:00
Jun Wu
eb0ce36ac2 util: make timer return constant on tests
Summary:
Lots of places use it to print some thing like "fetched x files in y seconds (1KB/s)".

In tests, these have to be manually replaced to "* (glob)" patterns.

This diff makes test output static without using globs. So `run-tests.py -i` would just fix things.

Reviewed By: phillco

Differential Revision: D13954456

fbshipit-source-id: d139c7c5e268d3bab562c266335d740986780924
2019-02-05 20:36:03 -08:00
Jun Wu
f8f8e3962a status: add a way to log more details about why hg thinks a file was modified
Summary:
We're seeing issues where a file show up as "M" while it isn't expected so. When
running "hg status" again, the file disappeared. Existing logs suggest that
watchman does not think anything has changed between the two "status" commands.
Therefore add more logs of the internals to try to get more insights.

Differential Revision: D13954209

fbshipit-source-id: 0b89a6da5e8702e707440ef2e1823eb4968c10be
2019-02-05 19:41:35 -08:00
Durham Goode
3309a8090a pushrebase: read the manifest before looping through files
Summary:
pushrebase has logic that loops through all the files and builds a list
of what has changed. Unfortunately, Mercurial has some optimizations where if
the manifest isn't loaded already, it tries to only load the manifest delta, and
checks if this might be a good idea by first checking if the file is in the
commit metadata file list. The commit metadata is a list, which makes it a O(n)
scan to check containment. Since we do this for every file, it becomes O(n^2).

To avoid this, let's just make sure the actual manifest is loaded.

Once every repo is a tree repo, we can get rid of the manifest delta
optimization and get rid of the need to prefetch here.

Reviewed By: singhsrb

Differential Revision: D13944829

fbshipit-source-id: c0f33ca650b7956a1f39e961c94678a6f7f380b6
2019-02-05 16:05:50 -08:00
Durham Goode
f3a5d55c2b changelog: cache commit files list
Summary:
During pushrebase there is code that says 'for each file, do some work
that involves listing the changed files'. Because we reparse the list each time,
this becomes n^2 behavior. Let's cache the list to avoid this.

Reviewed By: singhsrb

Differential Revision: D13944830

fbshipit-source-id: 4fd0dbf26b6cee9d0c01879cafb9837262f7afa0
2019-02-05 15:52:00 -08:00
Stanislau Hlebik
ff74d1cc82 remotefilelog: add an option to verify all the hashes
Reviewed By: DurhamG

Differential Revision: D13838772

fbshipit-source-id: e7220ba8a0e07f3003693199086e3a3512023857
2019-02-05 15:03:24 -08:00
Michael Bolin
55e1814f4d Move the DotSlash build process out of scm/hg/setup.py and into hgbuild.
Summary:
As requested by DurhamG, bundle DotSlash in the same way that scmtelemetry
is bundled rather than as directly part of the Mercurial package.
This approach makes it possible for DotSlash to leverage Hg's contbuild
while still being in its own package.

To implement this, I copypasta'd scmtelemetry's setup and modified it
for DotSlash, as appropriate.

Although I tried to port the Windows configuration over in addition to
Mac and Linux, I'm going to disable it for now because I want to limit
how many things I'm going to try to get working on the initial rollout.

Reviewed By: singhsrb

Differential Revision: D13950939

fbshipit-source-id: 5d8393d756e23f1ac228c7315a4b95a36288ac3a
2019-02-05 10:51:39 -08:00
Michael Bolin
8e8365cc04 Move DotSlash out of scm/hg.
Summary:
Ran `hg mv ../hg/exec/fb/dotslash ../dotslash` and edited
`fbcode/scm/hg/setup.py`.

Reviewed By: singhsrb

Differential Revision: D13950938

fbshipit-source-id: 2cd68e9704121623881c575ac27cc6d4d7de3740
2019-02-05 10:51:39 -08:00
Jun Wu
452e2bd5d6 commandserver: import mercurial.__version__ from the right place
Summary: It was moved to edenscm.

Reviewed By: singhsrb

Differential Revision: D13955193

fbshipit-source-id: 79ec1a314398813de4f686f104b17cda0f43a92d
2019-02-05 09:47:34 -08:00
Fatih Aydin
64bd91b7f4 commands: add option to disable the outgoing command
Summary: Extend the option to disable `incoming` to also disable `outgoing`.

Reviewed By: markbt

Differential Revision: D13877971

fbshipit-source-id: c4f994d536dda5db7c0e9f14656be48fc757c237
2019-02-04 14:25:27 -08:00
Mark Thomas
f402b4f525 lfs: include name of file being downloaded in progress bar
Summary:
When doing lfs prefetch, pass the filenames that correspond to each oid to lfs
so that it can include them in the progress bar.

Reviewed By: DurhamG

Differential Revision: D13716078

fbshipit-source-id: c91eca6b342996c0c3d1ee43f3b1e98db4ed64d4
2019-02-04 11:44:28 -08:00
Durham Goode
5eced4c533 watchman: canonicalize repo root before querying watchman
Summary:
If the repository was mounted into a different directory than the
source of truth, our watchman integration would not work. To fix this, Mercurial
now applies the same canonicalization logic to the path before passing it to
watchman. This logic is stolen verbatim from watchmans integration test path
utility.

This also requires updating our copy of pywatchman to match the upstream
pywatchman.

Reviewed By: quark-zju

Differential Revision: D13886207

fbshipit-source-id: ea72166edf2eb30f2bee992d9aa936e2e9729e63
2019-02-04 10:34:08 -08:00
Xavier Deguillard
747cc15fbf revisionstore: remove Rc from UnionDataStore and UnionHistoryStore
Summary:
The Rc is required by the c_api, but there is no longer a reason for
UnionDataStore and UnionHistoryStore to use an Rc, so let's move the Rc into
c_api.

Reviewed By: DurhamG

Differential Revision: D13928332

fbshipit-source-id: a93b54e022d539dc4df9144a8c59e9ffbe3453e0
2019-02-04 09:30:23 -08:00
Xavier Deguillard
f11c7fbf26 revisionstore: remove Clone requirement from UnionStore
Summary:
By specifying the IntoIterator differently, we can avoid the clone requirement.
Since Clone isn't implemented on either DataPack or HistoryPack, this will
simplify the callers a bit

Reviewed By: DurhamG

Differential Revision: D13928274

fbshipit-source-id: f0261c50d73868689ebb3ae226f84d41c4c40925
2019-02-04 09:30:23 -08:00
Xavier Deguillard
82af74b019 revisionstore: add blanket HistoryStore implementation Rc, Arc and Box
Summary: This way, HistoryStore type constraint will work with these types.

Reviewed By: DurhamG

Differential Revision: D13928128

fbshipit-source-id: aaa9f2633166c137dca5fc2b1f44caab92b57a80
2019-02-04 09:30:23 -08:00
Xavier Deguillard
fb2b0f48d3 revisionstore: add blanket DataStore implementation for Rc, Arc and Box
Summary: This way, DataStore type constraint will work with these types.

Reviewed By: DurhamG

Differential Revision: D13928090

fbshipit-source-id: 1567556e3ffea2901acbc754b3bd67491e23056b
2019-02-04 09:30:23 -08:00
Xavier Deguillard
4c4e2a6909 revisionstore: remove RefCell from UnionStore
Summary: The UnionStore doesn't need internal mutability, so let's simplify it.

Reviewed By: DurhamG

Differential Revision: D13928058

fbshipit-source-id: f0ba085ff8401dcc99fc69c3eb6f5e20c071d650
2019-02-04 09:30:23 -08:00