Commit Graph

47324 Commits

Author SHA1 Message Date
Durham Goode
c2309d853f dirstate: remove dirstate.matches
Summary:
As part of simplifying the dirstate API so we can replace it, let's
drop dirstate.matches

Reviewed By: quark-zju

Differential Revision: D17844150

fbshipit-source-id: 5b8f69fb0e102320af3a083dcaa678a2b81dd953
2019-10-22 18:26:51 -07:00
Durham Goode
bb8d344c48 ssh: improve error message for bad initial connection
Summary:
If hg received bad data in the initial ssh connection, the error
message doesn't provide any information about what the bad data is unless
--debug was passed. In production situations it's hard to add --debug after the
issue has occured, so let's make it print out the bad data with the message.

Reviewed By: sfilipco

Differential Revision: D18076446

fbshipit-source-id: 2be2741a07ce4c78cbde672b7458c115fac43fab
2019-10-22 17:43:56 -07:00
Durham Goode
f44a5d73cf crdump: add config gate for commitcloud backup
Summary:
This had performance implications. Let's gate it so we can roll it out
more carefully.

Reviewed By: quark-zju

Differential Revision: D18063673

fbshipit-source-id: 7911753f9a91bd9224e59d774fcec59e9007434c
2019-10-22 15:12:22 -07:00
Zeyi (Rice) Fan
b830c846f2 eden: make Eden to use the new backingstore crate
Summary: This diff switches EdenFS from using the `revisionstore` crate into `backingstore`

Reviewed By: chadaustin

Differential Revision: D17866320

fbshipit-source-id: f6de1fe568ae893e4c2555039df6edfb0a450885
2019-10-22 15:00:28 -07:00
Zeyi (Rice) Fan
3e42ddb869 phabstatus: increase default timeout to 10
Summary: Increase default for `ssl.timeout` from 5 to 10 seconds.

Reviewed By: quark-zju

Differential Revision: D18056114

fbshipit-source-id: 77b7204e2b2ede48731a0d15ed31f57ee117dc69
2019-10-22 11:05:14 -07:00
Arun Kulshreshtha
7bb63ed73e util: add expand_path function
Summary: Add an `expand_path` function to the `util` crate, similar to the `util.expandpath` Python function. This function is similar to one from the `configparser` crate (which it now replaces). A key difference is that this function is designed to be similar to the Python function in terms of expanding home directory references in environment variables.

Reviewed By: xavierd

Differential Revision: D18050348

fbshipit-source-id: 752d85864eaa4c296ca670089f5de2dc860a5d6a
2019-10-22 10:20:14 -07:00
Arun Kulshreshtha
e09c274ea8 configparser: derive Debug for ConfigMap
Summary: Add the appropriate `#[derive(Debug)]` attributes to allow printing out a `ConfigMap` with `dbg!`.

Reviewed By: singhsrb

Differential Revision: D18050347

fbshipit-source-id: b9fd59bcf063e023487d53c23b65c55a11d6da14
2019-10-22 10:20:14 -07:00
Mateusz Kwapich
2e54f52215 generation of diff header
Summary:
Added function generates a basic diff header. I'll follow up this diff with additions of:
 * git-specific headers (`diff --git`): file modes, copy information
 * no-prefix mode (without `a/` and `b/`)

High-level context: I'm working on adding support for returning diff from the new Source Control Service. We want the generated diff to be a drop-in replacement for the one that we get from hg in SCMQuery so I'm closely following the behaviour of Mercurial's `mdiff.py` so there's no surprises. I'm planning to implement all of the diff features that we'll use in the Service while making the implementation flexible enough that it can be easily extended in the future and dropped into Rust rewrite of Mercurial.

Reviewed By: markbt

Differential Revision: D17764609

fbshipit-source-id: 43cde9ddef86d01fe926adedb3f2ac19b38ffbec
2019-10-22 03:52:19 -07:00
Mateusz Kwapich
34c1ccf778 generation of headerless diff
Summary:
This code, loosely inspired Mercurial's mdiff.py generates the actual "diff"
contents (everything that we can generate just based on the file contents only,
without looking at file metadata such as: filenames, copy information, file
modes etc. Those will follow in separate diffs.

High-level context: I'm working on adding support for returning diff from the new Source Control Service. We want the generated diff to be a drop-in replacement for the one that we get from hg in SCMQuery. I'm planning to implement all of the diff features that we'll use in the Service while making the implementation flexible enough that it can be easily extended in the future and dropped into Rust rewrite of Mercurial.

Reviewed By: krallin

Differential Revision: D17764608

fbshipit-source-id: 4fa3a1afd0547fc512c5e51ed673b1ea007b3245
2019-10-22 03:52:18 -07:00
Tom Hebb
5f06f1f389 Add test for commit parent extraction
Summary:
Make sure our `git cat-file` output parsing gets the list of parents correctly.

Also get rid of an empty expected output file for our test, since empty output is implied if no file exists.

Reviewed By: mwdevine

Differential Revision: D18002081

fbshipit-source-id: da4f7a5eecc876bc180c64c06d4eb98b1178f8ee
2019-10-21 12:50:08 -07:00
Michael Devine
0f7ff848c2 Convert repo source: Fix getchanges() and some cleanup
Summary: We've had a known problem with importing merge commits in the currently landed version of the repo converter source. The problem is that the specification of the source interface is misleading (or perhaps just wrong). We've updated the function to generate changes against all of the parents, not just the first one, and that seems to have fixed our ability to show the head commit of branches.

Reviewed By: tchebb

Differential Revision: D17964281

fbshipit-source-id: 90ae5df7dabaf133612c44d2a41b37200bcdb15f
2019-10-21 12:12:28 -07:00
Saurabh Singh
f4bc8dd779 edenthriftclient: ignore check code naming error
Summary:
It seems the whole file goes against the convention. Rather than
making the linter happy by fixing the only case it cares about, this diff
simply ignores the error.

Reviewed By: xavierd

Differential Revision: D18041569

fbshipit-source-id: 19731a2adee634baf4cf7569c86ab3fbf46624fc
2019-10-21 12:09:17 -07:00
Stefan Filip
55e4edada2 types: add serde rename and alias for Key
Summary:
"node" is used in the wire protocol.
While things are deploying the server needs to receive `node`. For
that we use `serde(rename = "node")`.
Looking forward we will need the server to know how to interpret both
`node` and `hgid` while clients are deploying without
`serde(rename = "node")`. For that we use `serde(alias = "node")`.

Reviewed By: kulshrax

Differential Revision: D18041109

fbshipit-source-id: 06b1568ad010526a53d2ccfd46950211d303250d
2019-10-21 10:49:20 -07:00
Saurabh Singh
68cca6e81c backingstore: explicitly provide dependency version
Summary: This makes `test-check-fix-code.t` happy.

Reviewed By: fanzeyi

Differential Revision: D18039985

fbshipit-source-id: d02bac5d0dd8f62595a2a3aad0f0b43e7e473313
2019-10-21 10:31:51 -07:00
Zeyi (Rice) Fan
eb2d08ec50 backingstore: make backingstore buildable with CMake
Summary: This diff makes the `backingstore` crate buildable with CMake so we can use it in EdenFS's CMake build.

Reviewed By: xavierd

Differential Revision: D17870495

fbshipit-source-id: 69c38cc321024d971ae9ecbf1dc126611d0cd3e9
2019-10-19 18:48:44 -07:00
Zeyi (Rice) Fan
5408a9527d backingstore: strip metadata header from blob retrieved from hgcache
Summary:
For blobs stored in Mercurial's pack/indexedlogdatastore, some of these blobs have a metadata
header at the beginning of the blob for storing copyrev or LFS related
metadata. We do not want to serve this header to the user, and EdenFS does not
need these metadata.

Reviewed By: xavierd

Differential Revision: D17864753

fbshipit-source-id: 91dc47df6ae7f1361cb0869491b4ab855a04cf1b
2019-10-19 18:48:44 -07:00
Zeyi (Rice) Fan
e9e3a153af backingstore: add get_blob
Summary: This diff adds the Rust method needed to read blobs from Hg pack files.

Reviewed By: xavierd

Differential Revision: D17798414

fbshipit-source-id: 81a95d6b73d1517dd73ac12d5408e909c9354317
2019-10-19 18:48:44 -07:00
Zeyi (Rice) Fan
7e110c5cca backingstore: add CBytes for passing Rust bytes to C++
Summary: This diff adds a `repr(C)` Rust struct for passing Rust's `bytes` to C++. See the next diff in the stack for usage.

Reviewed By: xavierd

Differential Revision: D17863809

fbshipit-source-id: e808ab72c75427a91c4181422798a844077c5c5f
2019-10-19 18:48:43 -07:00
Zeyi (Rice) Fan
a045d9538d backingstore: add backingstore struct
Summary:
This diff adds a new crate `backingstore` that is responsible to help Eden to read data from hgcache.

This diff only implements the initialization logic where it loads the path from hg's configuration files. This diff also contains a struct `CFallible` to help us handling errors from Rust in C++.

Reviewed By: xavierd

Differential Revision: D17593226

fbshipit-source-id: 3dfa8b2b13553cf49ecadd2a589f0ce2e25524b5
2019-10-19 18:48:43 -07:00
Zeyi (Rice) Fan
4bf54d3d37 backingstore: introduce CFallible to handle errors from Rust
Summary:
This diff adds a Rust `repr(C)` struct to pass any errors raised in the Rust
code. So the C++ code can handle these errors.

Reviewed By: chadaustin

Differential Revision: D17859953

fbshipit-source-id: 246a913e558b40980c63f62d06961d3dea5c55ef
2019-10-19 18:48:43 -07:00
Zeyi (Rice) Fan
b5360562b6 easy: [hg] backingstore: add crate
Summary: This commit adds the basic required files for a new crate.

Reviewed By: xavierd

Differential Revision: D17859046

fbshipit-source-id: 3b8ab7fb603114597e037bd5ef1efeb57cd7f86b
2019-10-19 18:48:42 -07:00
Stefan Filip
2621d7dfc4 types: rename Node to HgId
Summary:
`Node` is a name that is overloaded. It means that in our conversations
we always have to constantly define which Node we are talking about.
Is it the type in Mercurial or the generic term in graphs/trees.

It is just an identifier so we rename it such.

Note that this doesn't remove the Node term yet. I will take care of the
longtail of uses incrementally.

Things that are not renamed:
* linknode
* nodeinfo
* WireHistoryEntry
* cdatapack

Reviewed By: quark-zju

Differential Revision: D18010149

fbshipit-source-id: 83b3911e231e4544848391cd3deb6e44ec2b809d
2019-10-18 18:13:31 -07:00
Jun Wu
e925225f16 tweakdefaults: remove op-aware wrapping
Summary:
The operation-aware feature is in core. It does not need extra wrapper.

This change was made because the following code will break by function
wrappers:

    origargs = inspect.getargspec(origcmd)
    try:
        repo_index = origargs.args.index("repo")
        ...

Reviewed By: ikostia

Differential Revision: D17972044

fbshipit-source-id: 863fd2bb37c677d4c7de8955538da551084eeb14
2019-10-18 14:50:26 -07:00
Jun Wu
12e114359b test-export: stablize the test
Summary:
Depending on Python random seed, this test might fail with:

  --- test-export-t.py:251 (expected)
  +++ test-export-t.py:251 (actual)
  @@ -1 +1,2 @@
  -
  +abort: foo/1: both added and removed
  +[255]

Fix it by avoiding "rename".

Reviewed By: xavierd

Differential Revision: D18001839

fbshipit-source-id: efde3d9b6734a84a00a46cb00bbf493d64a460b2
2019-10-18 13:29:31 -07:00
Puneet Kaushik
a5e17d48b7 Fetch the eden root and socket path from config
Summary: Eden on Windows store it's socket path in a toml file instead of using symlinks. This diff will fetch the contents from the toml file and populate the root and symlink.

Reviewed By: fanzeyi

Differential Revision: D17912859

fbshipit-source-id: 46d7a7e39ca4d65df55cb6dc7a3d396c82182b32
2019-10-18 12:39:04 -07:00
Jun Wu
e1808b45e6 rage: try to make "sl (unfiltered)" section shorter
Summary:
The "sl (unfiltered)" section can be very long. To make it less noisy, let's
only show commits that are predecessors of the current visible draft. This
removes commits that are landed (and became hidden), and is more friendly
in the narrow-heads=true world.

Reviewed By: singhsrb

Differential Revision: D18000596

fbshipit-source-id: e7ed773fee10c5dc26b810356dd3d25e61da522b
2019-10-18 07:52:27 -07:00
Jun Wu
6a80791e72 rage: remove noise from "local config" section
Summary:
`/default.d/` configs were moved to hard-coded `<builtin>` config string in
D15307750. Change logic in `rage` so we don't list `<builtin>` configs as
"local config".

Reviewed By: singhsrb

Differential Revision: D18000595

fbshipit-source-id: b3ff0bce6dbb3fae442dc07d7453fa63bc624f7b
2019-10-18 07:52:26 -07:00
Jun Wu
18008a9576 rage: remove fsmonitor state section
Summary:
The fsmonitor state section does not work with treestate or edenfs. Replace it
with `debugtree` and `debugstatus` that works with treestate.

Reviewed By: singhsrb

Differential Revision: D18000597

fbshipit-source-id: 4a4e7434f9d340bd3b44f9a8d19b66ed7b6fa3a6
2019-10-18 07:52:26 -07:00
Jun Wu
9df16613b2 cmdutil: fix commit -i -M . -e
Summary:
Right now `commit -i -M rev -e` crashes saying --reuse-message conflicts with
--message. That seems to be caused by `logmessage` being called twice.

Fix it by setting `reuse_message` to False if its side-effect (setting
`message`) is done.

Reviewed By: singhsrb

Differential Revision: D18000594

fbshipit-source-id: 96a3078fc1d66a6786caa709a935e093eaa469ea
2019-10-18 07:52:26 -07:00
Wez Furlong
b1f52df121 hg grep: fix util.pathto parameter order in biggrep integration
Summary:
we were not producing the correct filter expression when
invoking biggrep, which resulted in incorrect (no!) output.

The `normpath` is needed because `util.pathto` can produce paths like `../../.`
which biggrep doesn't like.

Reviewed By: quark-zju

Differential Revision: D17950451

fbshipit-source-id: 6c29c32b6b4b293fbec820fd76dea51adbefca4e
2019-10-18 04:31:47 -07:00
Wez Furlong
ea7dff0318 hg grep: remove svnmeta stuff from biggrep integration
Summary:
Now that svn is no longer part of our infra, we don't
need this bit, and it simplifies things in a later diff.

Reviewed By: singhsrb

Differential Revision: D17933129

fbshipit-source-id: 6bf7a58e2d0e77c7f4621d85d5947b592eccb678
2019-10-18 04:31:46 -07:00
Durham Goode
02f0092268 filesystem: fix callsite to _ischanged
Summary: The `_ischanged` function takes 3 parameters.  This was introduced due to a mis-merge between two of my other commits that landed, and for some reason CI didn't block the land.

Reviewed By: singhsrb

Differential Revision: D17987996

fbshipit-source-id: ff6f766dbe4b7dc91f16182d6c75e5532a4f6e3c
2019-10-17 15:30:02 -07:00
Jun Wu
424b62941d testutil: use multi-line diff if either actual or expected is multi-line
Summary:
The old code only use multi-line diff if "expected" is multi-line.
That can sometimes show a multi-line message in a single line, which is
unreadable.

Improve it by using multi-line diff if either side is multi-line.

Reviewed By: sfilipco

Differential Revision: D17987723

fbshipit-source-id: a04c13d09d463c1397f45ec34682ef1da75889af
2019-10-17 13:55:26 -07:00
Jun Wu
7697be1e32 diff: add an option to ignore copy/renames with deselected sources
Summary:
This makes it possible to `hg export` a subset of the history that can be
imported into another repo. See added tests for an example.

Reviewed By: sfilipco

Differential Revision: D17966341

fbshipit-source-id: a68c3fe8d43c6790eb3667fd43a80a7247358c7d
2019-10-17 13:53:10 -07:00
Jun Wu
8c0bff1054 export: support pattern matching
Summary: This makes it possible to export a subset of file changes.

Reviewed By: sfilipco

Differential Revision: D17963550

fbshipit-source-id: 0641bdab253a51c0e36a973dc22b662739af8eb6
2019-10-17 13:53:10 -07:00
Jun Wu
dfd2285def tests: fix test-export-t.py
Summary: The test now completes in 1 second, down from 9 seconds.

Reviewed By: sfilipco

Differential Revision: D17963549

fbshipit-source-id: 5cfae80dd1e4165c015c6fc5a04cec98bc71cbad
2019-10-17 13:53:10 -07:00
Jun Wu
beb5699d39 tests: auto translate "test-export.t"
Summary:
This is done by running:

  ./translate "test-export.t"

Reviewed By: sfilipco

Differential Revision: D17963548

fbshipit-source-id: 11f997abb375d70e0d6f1a4cdb5d78422b11482f
2019-10-17 13:53:09 -07:00
Xavier Deguillard
7014e34633 amend: fix unamend with no predecessors
Summary:
When mutation is enabled, and no precessors exists, the predecessors can be
None, leading to hg crashing due to:
  TypeError: object of type 'NoneType' has no len()

Reported by sas: P118684245

Reviewed By: quark-zju

Differential Revision: D17960775

fbshipit-source-id: 05488dbc52edbc32c323612ea86fe9e94076a126
2019-10-17 09:02:42 -07:00
Xavier Deguillard
2cd333f0f7 remotefilelog: remove low-level getancestors
Summary:
The getancestors is handled by the metadatastore via the getnodeinfo method,
thus the lower level stores don't need to implement it.

Reviewed By: quark-zju

Differential Revision: D17946853

fbshipit-source-id: b516fdad15c96882f1898eb2e94b6ddff353d2bf
2019-10-17 08:57:36 -07:00
Xavier Deguillard
b5b835c87c remotefilelog: use getnodeinfo in getancestors
Summary:
The store.getancestors is really just a wrapper over getnodeinfo, let's just
use getnodeinfo instead, which would allow us to remove the getancestors from
all the store code.

Reviewed By: quark-zju

Differential Revision: D17946854

fbshipit-source-id: 4cf6b607464f42d573a5911e3975bdd388592c75
2019-10-17 08:57:35 -07:00
Arun Kulshreshtha
3e52c2114a manifest: add comment to BFS prefetch function
Summary: This function was undocumented. Now that we're enabling BFS prefetching for the team, let's add some comments so that if the new functionality causes problems, readers of the code will have some context as to what's going on.

Reviewed By: quark-zju

Differential Revision: D17966978

fbshipit-source-id: 6078d427829d437064cf23b7af2d0cc0fb0a8627
2019-10-16 18:22:44 -07:00
Jun Wu
65fad5e812 rebase: do not crash rebasing -s secret-commit
Summary: Replace the assertion to an actionable error message.

Reviewed By: sfilipco

Differential Revision: D17932927

fbshipit-source-id: e9522a02be9901a9451f1505df6a19d8e35298a6
2019-10-16 18:22:09 -07:00
Durham Goode
376162f3d3 filesystem: move lookup yielding to a batched location
Summary:
In a future diff we'll move lookup resolution into the filesystem
later. To do so, we need to refactor the lookup reporting logic to batch all
lookup reporting into a single place so that later we can insert remotefilelog
prefetches for those files.

This diff moves lookup detection to put them in a list before yielding them. The
next diff will resolve them instead of yielding lookup.

Reviewed By: quark-zju

Differential Revision: D17749375

fbshipit-source-id: 93f383031600525f137039dc955b5e46346754c5
2019-10-16 17:40:13 -07:00
Durham Goode
815b95c925 dirstate: move dirstate old id generation to before status
Summary:
A future diff will change filesystem.pendingchanges to actually update
the dirstate when lookup files are resolved. Because of this, we need to compute
the old dirstate id before pendingchanges is called. Let's do that, and pass it
down into the poststatusfixup for usage.

Reviewed By: quark-zju

Differential Revision: D17749372

fbshipit-source-id: a7698ff1ef4aab2805e19929ac2f70841dd0fc3c
2019-10-16 17:40:12 -07:00
Xavier Deguillard
66213fa0f2 remotefilelog: remove python repack
Summary:
With loosefiles being gone, we no longer need to repack loosefiles, let's get
rid of the code.

Reviewed By: quark-zju

Differential Revision: D17923874

fbshipit-source-id: 9bc3390d448df4576e4567447a00446d1d1ff717
2019-10-16 14:21:58 -07:00
Xavier Deguillard
5840de16ef remotefilelog: remove format.noloosefile
Summary: This is now dead code.

Reviewed By: quark-zju

Differential Revision: D17923872

fbshipit-source-id: 9a65d13d43f0caa7b25516a7de3bcd7d558dda92
2019-10-16 14:21:57 -07:00
Xavier Deguillard
5132ddaa2c remotefilelog: remove remotefilelog.fetchpacks from the code
Summary:
All the repos, and all the tests have this config enabled, we have no plans of
turning it on again, let's kill it.

Reviewed By: quark-zju

Differential Revision: D17923873

fbshipit-source-id: fb5b16ede63918d9e89dc437dfb5cc3e5aa778bd
2019-10-16 14:21:57 -07:00
Xavier Deguillard
4cdbc8d9f8 remotefilelog: enable format.noloosefile by default
Summary: Loosefiles are dead, no need to test them anymore.

Reviewed By: quark-zju

Differential Revision: D17919277

fbshipit-source-id: 83386f49711d34e42a82b61ff2bb206a4f5afb12
2019-10-16 14:21:57 -07:00
Xavier Deguillard
3ad04bbd86 remotefilelog: make fetchpacks the default
Summary:
This has been enabled for a while now. We won't be going back to using
loosefiles, so let's make fetchpacks the default in the code. A future step
will remove the code paths that are no longer exercised.

Reviewed By: quark-zju

Differential Revision: D17919275

fbshipit-source-id: 0614f5710b630690de92cdb43ec07d3a2888aa1e
2019-10-16 14:21:57 -07:00
Xavier Deguillard
7869cc7b17 remotefilelog: remove hg gc
Summary:
The `hg gc` tries to cleanup old loosefiles from the hgcache, since loosefiles
are no longer being generated, there is no need to keep the code around. The
command is kept around to inform users.

Reviewed By: quark-zju

Differential Revision: D17919276

fbshipit-source-id: bd0adc628fda0f72dacb432c859ef827511e7a69
2019-10-16 14:21:56 -07:00