Commit Graph

51339 Commits

Author SHA1 Message Date
Michael Devine
02295d54b6 Fix commit ordering
Summary: The commit timestamps in Git have second granularity. As a result, sometimes multiple succeeding commits have numerically equivalent timestamps. This means that sorting by timestamp may not result in the correct ordering of commits. This is particularly true because the sort we use is a stable sort, which means that commits with the same timestamp must go into the sort in ascending commit history order to have the correct order coming out of the sort. This commit updates the log that generates the list to use ascending commit order rather than descending.

Reviewed By: tchebb

Differential Revision: D18486839

fbshipit-source-id: 7a0ff099375a250d92b0f1a846e1105bf7bb9c86
2019-11-15 11:16:09 -08:00
svcscm
7a8bb97245 Updating submodules
Summary:
GitHub commits:

c24f26fe23

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 0c944b70133413b29fccce3aabe326f850bf1c44
2019-11-15 10:49:43 -08:00
Stefan Filip
e07097e3bc tests: set flatcompat=False for test-fb-hgext-treemanifest-pushrebase.t
Summary: Title

Reviewed By: quark-zju

Differential Revision: D18463485

fbshipit-source-id: 6356d87743764e85f46e91e6bffe35db7ebdf10b
2019-11-15 10:47:50 -08:00
Michael Devine
8c7131b74f Optimize memory usage of rev-list parser
Summary: The existing logic for parsing rev-list data relies very heavily on split, which creates many intermediate strings that take up a lot of memory. This commit updates the logic to use indices into the original output to extract individual strings. It also includes a new unit test for the list parsing. Big thanks to Tom Hebb for identifying the excessive memory usage.

Reviewed By: tchebb

Differential Revision: D18513949

fbshipit-source-id: c3b4e420ae2635904b42b84f2973e83c81c21dd7
2019-11-15 10:38:48 -08:00
Xavier Deguillard
75d4a47eb1 histgrep: replace rev number with node in default output
Summary:
Revision numbers are deprecated, let's only show the short hash of the commit
instead.

Reviewed By: quark-zju

Differential Revision: D18519655

fbshipit-source-id: df277cc7e99ad747899d1fae2d92cd88eebea0f1
2019-11-15 09:48:10 -08:00
svcscm
33e8f2ed77 Updating submodules
Summary:
GitHub commits:

61f165b8f9

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 7016cbd4cd2d38ac316396599b2e539fa79e42cb
2019-11-15 09:48:10 -08:00
svcscm
8d510c0525 Updating submodules
Summary:
GitHub commits:

770b887986

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 31edbcc549f11026806e4b3576fcdda22401f9cc
2019-11-14 23:17:20 -08:00
David Tolnay
9c6f253858 rust: Replace derive(Fail) with derive(Error)
Summary:
This diff replaces code of the form:

```
use failure::Fail;

#[derive(Fail, Debug)]
pub enum ErrorKind {
    #[fail(display = "something failed {} times", _0)]
    Failed(usize),
}
```

with:

```
use thiserror::Error;

#[derive(Error, Debug)]
pub enum ErrorKind {
    #[error("something failed {0} times")]
    Failed(usize),
}
```

The former emits an implementation of failure 0.1's `Fail` trait while the latter emits an impl of `std::error::Error`. Failure provides a blanket impl of `Fail` for any type that implements `Error`, so these `Error` impls are strictly more general. Each of these error types will continue to have exactly the same `Fail` impl that it did before this change, but now also has the appropriate `std::error::Error` impl which sets us up for dropping our various dependencies on `Fail` throughout the codebase.

Reviewed By: Imxset21

Differential Revision: D18523700

fbshipit-source-id: 0e43b10d5dfa79820663212391ecbf4aeaac2d41
2019-11-14 22:04:38 -08:00
svcscm
b9569ab08f Updating submodules
Summary:
GitHub commits:

20080a6338
170bb2ae47

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: f3c5863ebb72b5eef36133bffd2a1ba8ba1d0fe4
2019-11-14 22:04:38 -08:00
svcscm
1718045feb Updating submodules
Summary:
GitHub commits:

35d49a558b
8f12df2a87
ceabf4daaf
0058daef7b
4574f38a41
aedd6286e5

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: caeee3893df80041fa62e7d6e03776b80911766d
2019-11-14 17:14:18 -08:00
Genevieve Helsel
5d2c5ae60a more helpful error message when calling status with out of date parent.
Summary: make the error message returned in the case of out of date parents during a new status call more user friendly and provide possible remediation instructions

Reviewed By: simpkins

Differential Revision: D18328835

fbshipit-source-id: b214f45bb055d008db8b233ddd2a1843332db838
2019-11-14 16:46:15 -08:00
generatedunixname89002005307016
ccfa401a49 Update pyre version for eden
Summary: Automatic upgrade to remove `version` override and silence errors.

Reviewed By: MaggieMoss

Differential Revision: D18510552

fbshipit-source-id: f14b2d8d1cfc0bd010fc793384e394806122a353
2019-11-14 16:33:52 -08:00
Xavier Deguillard
d7de06ddfd cmdutil: use ctx.node() instead of ctx.rev() in finddate
Summary:
The finddate function is used when using `hg update --date`, and since it
returned a revision number, the user would see the revision number deprecation
warning. Using nodes solves this.

Reviewed By: quark-zju

Differential Revision: D18486760

fbshipit-source-id: e1a51f624d8e7133fbf334f9b8b4b4c3d5aff2a0
2019-11-14 15:30:47 -08:00
Jun Wu
055cf342d9 pathmatcher: hint globset to use prefix strategy instead of regexp strategy
Summary:
`globset` supports multiple matching strategies, including literal prefix
(backed by AhoCorasick), or regexp, etc.

In theory patterns like `foo/**` (where `*` cannot match `/`) can use `foo`
prefix strategy. However, the implementation detail of `globset` wouldn't
accept it as a prefix. But `foo/*` (where `*` can match `/`) can be treated as
a prefix. Transform the former pattern to the latter to hint `globset` to use
the optimal strategies.

Reviewed By: sfilipco

Differential Revision: D18500298

fbshipit-source-id: 39e604d6157a919b75c392488b6d42375e518c16
2019-11-14 14:27:39 -08:00
David Tolnay
b1793a4416 rust: Rename Fallible<T> to Result<T>
Summary:
This diff is preparation for migrating off of failure::Fail / failure::Error for errors in favor of errors that implement std::error::Error. The Fallible terminology is unique to failure and in non-failure code we should be using Result<T>. To minimize the size of the eventual diff that removes failure, this codemod replaces all use of Fallible with Result by:

- In modules that do not use Result<T, E>, we import `failure::Fallible as Result`;
- In modules that use a mix of Result<T, E> and Fallible<T> (only 5) we define `type Result<T, E = failure::Error> = std::result::Result<T, E>` to allow both Result<T> and Result<T, E> to work simultaneously.

Reviewed By: Imxset21

Differential Revision: D18499758

fbshipit-source-id: 9f5a54c47f81fdeedbc6003cef42a1194eee55bf
2019-11-14 14:11:01 -08:00
svcscm
97dfb32ff6 Updating submodules
Summary:
GitHub commits:

df16a5e175
a91912f485
b25002139f
141c6d9cca
d02b9c97ab
b06a5e5923

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: b645446ea1ad74c0018ec657dbb8172ce41ecd81
2019-11-14 13:57:44 -08:00
Jun Wu
63c1b3001d treematcher: implement proper error handling
Summary:
simpkins encountered a case where the treematcher does not work with many
patterns.  It turns out `globset` has a hard-coded regex size limit (10MB).

Implement proper error handling so we can detect such issues and fallback to
slower paths.

Reviewed By: sfilipco

Differential Revision: D18500299

fbshipit-source-id: 0122ba9b0246c1536b2069a40e13261ee47f8bba
2019-11-14 11:43:18 -08:00
Jun Wu
d56700b63c lfs: implement gc
Summary: Add `hg debuglfsgc` command to reclaim disk space. Make it part of `hg gc`.

Reviewed By: xavierd

Differential Revision: D18417035

fbshipit-source-id: 7c0a445a0d4405df5cff960c0e28c4fc5a1f2c31
2019-11-14 11:14:05 -08:00
svcscm
fcca32a488 Updating submodules
Summary:
GitHub commits:

3de8f357ee
4468e01836

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 13d5cf4487b3740f93c7f6f347c177bd4d72a136
2019-11-14 11:14:05 -08:00
Xavier Deguillard
9d8eec40e4 rebase: properly handle --keep
Summary:
Even keep was being passed in, rebase still added mutation markers to the old
commits, which would then make them hidden in the smartlog output. Not adding
the mutation markers in this case solves the issue.

Reviewed By: quark-zju

Differential Revision: D18496840

fbshipit-source-id: f5d0f8920bd00041598841a65356b88df00708d7
2019-11-14 11:14:05 -08:00
svcscm
45dd628557 Updating submodules
Summary:
GitHub commits:

401178e861
916f8c2477
f059c7d9b9
dca5f88a84

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 3cc242b97702b130c20f6b7894f660b138a2b80a
2019-11-13 20:32:17 -08:00
Adam Simpkins
46890ae1ec Merge fb-mercurial sources into the eden repository
Summary:
Merge the fb-mercurial code into the Eden repository, under the
`eden/scm` subdirectory.

Reviewed By: quark-zju

Differential Revision: D18445774

fbshipit-source-id: fc3307f9937e0c7e1c8f7d03c5102c4fe5dedb10
2019-11-13 20:20:32 -08:00
svcscm
5fc3d15232 Updating submodules
Summary:
GitHub commits:

1deef35e63
0ff7470bdd
43dfa89c99

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: b0a53bb4aa2fda83be642097ce7424b9ba560711
2019-11-13 20:16:37 -08:00
Chad Austin
21ab8fcb67 report daemon starts to scuba
Summary: Report edenfs startup time to Scuba.

Reviewed By: fanzeyi

Differential Revision: D18093269

fbshipit-source-id: d2dce804a998e76f67b2bcfa3417f46ae0004dd6
2019-11-13 20:16:37 -08:00
Chad Austin
62169acd37 report checkout durations to scuba
Summary: Log checkout durations to the structured logger.

Reviewed By: fanzeyi

Differential Revision: D18071996

fbshipit-source-id: 6c5a3ceeb6925058d02eebc4a44f0473680b31b5
2019-11-13 20:16:37 -08:00
Adam Simpkins
ab3a7cb21f Move fb-mercurial sources into an eden/scm subdirectory.
Summary:
In preparation for merging fb-mercurial sources to the Eden repository,
move everything from the top-level directory into an `eden/scm`
subdirectory.
2019-11-13 16:04:48 -08:00
Chad Austin
987dd994b6 add a StructuredLogger instance to ServerState
Summary:
Allocate and hook up a StructuredLogger at startup if the EdenConfig
has the appropriate values set.

Reviewed By: simpkins

Differential Revision: D18071821

fbshipit-source-id: 3996b6644bbf0c16bb3b9950d57a79d4619a1656
2019-11-13 15:23:38 -08:00
svcscm
0a46a2715b Updating submodules
Summary:
GitHub commits:

fe2aa2895c
9735191ff9

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 7e0a742583d7b9e9ff273bb00a119b65edeb7c1f
2019-11-13 15:23:37 -08:00
Chad Austin
75beaad10f fix typo in missing cwd error
Reviewed By: quark-zju

Differential Revision: D18485216

fbshipit-source-id: b472dd043b0a0854074751ff822d9a67aac7c103
2019-11-13 15:09:36 -08:00
Jun Wu
fff9002050 tests: enable metalog
Summary:
Enable metalog for tests so visibility and remotenames updates are strongly
guaranteed atomic.

Reviewed By: kulshrax

Differential Revision: D18272994

fbshipit-source-id: f80b2565694b1a4591fad6c300d37b3dc5e3becf
2019-11-13 14:44:39 -08:00
Jun Wu
94cc65c957 svfs: integrate with metalog
Summary:
Add abstractions so part of the store vfs can be managed by metalog.
A config option was added to control the behavior.

Reviewed By: kulshrax

Differential Revision: D18272996

fbshipit-source-id: 6bd1400bfacbd2414f8d4b6bfc0b978f5020c883
2019-11-13 14:44:39 -08:00
Jun Wu
4f6669c023 visibility: use an empty file to note "visibility not enabled"
Summary: This makes an upcoming change easier.

Reviewed By: markbt

Differential Revision: D18272999

fbshipit-source-id: e189b147f2e5bbba7930d3c2cae22c8cffdbce88
2019-11-13 14:44:38 -08:00
Jun Wu
ea25a26d31 remotenames: slightly change with f syntax
Summary:
Change `with f` to `with fileobj as f`. The "usual" `fileobj` returns itself
as `f`. But we're changing it in upcoming diffs.

Reviewed By: kulshrax

Differential Revision: D18272995

fbshipit-source-id: 8465311921802010bfaac7fa0c33ed402d737363
2019-11-13 14:44:38 -08:00
Jun Wu
81c0762230 tests: avoid accessing remotenames directly
Summary:
In a future diff I'm changing the source of truth of `remotenames`, so
`.hg/store/remotenames` will stop working. Rewrite the tests to use a more
compatible form.

Reviewed By: kulshrax

Differential Revision: D18272998

fbshipit-source-id: acb1cc1102caf0397a2a3d72a0c4cbb39a0a9b8d
2019-11-13 14:44:38 -08:00
Jun Wu
ff4f48571e bindings: add bindings for zstore
Summary:
This exposes zstore interface to Python, making it easier to be used as a blob
store, or benchmark with revlog.

Reviewed By: kulshrax

Differential Revision: D18300621

fbshipit-source-id: 2762f23fe0fbd5f5f4af07ca7e4d6303b4009da1
2019-11-13 14:44:37 -08:00
Jun Wu
f0e8dee2ac bindings: add bindings for metalog
Summary: Expose metalog APIs to Python.

Reviewed By: kulshrax

Differential Revision: D18273001

fbshipit-source-id: b8fbf0c22a925e3e5373498076a3392901c00aed
2019-11-13 14:44:37 -08:00
Jun Wu
ec7157bef5 metalog: atomic lightweight key-value storage
Summary:
Intended to solve atomic read / write problem for remotenames and visibleheads.
In the future it might also store bookmarks and other data.

Metadata like visibleheads or bookmarks can be delta-ed well. So zstore is
used.

Reviewed By: kulshrax

Differential Revision: D18273000

fbshipit-source-id: 78347b9f88ccc9ee52d33f5e8b8663193ff1eec4
2019-11-13 14:44:37 -08:00
Jun Wu
56337e3067 zstore: test delta related behaviors
Summary: Delta-related logic is complex. Add visualization and test to verify them.

Reviewed By: kulshrax

Differential Revision: D18300620

fbshipit-source-id: 8d0bcf69b9e73a601f549ef9bdc881eea60e1bae
2019-11-13 14:44:36 -08:00
Jun Wu
aed58e562f zstore: blob store backed by zstdelta
Summary:
This blob store is the first usage of indexedlog. It uses zstd dictionary
compression provided by the zstdelta crate and aims to replace lz4 + bdiff
revlog for storing file revisions.

Blobs are enforced SHA1 addressed. A separate mapping from filenode to SHA1 is
needed if we want to integrate it into Mercurial file storage.

Practically, compare with lz4+bdiff, this setup compresses better (which could
be improved by tweaking parameters in zstdelta - it uses a variant of zstd
level 1 currently) when using same delta-chains:

| Repo    | File revisions | Zstore size (log + index) | Revlog du size | Revlog raw size |
| hg      | 74.9K          | 28 + 2.1MB                | 40MB           | 33.3MB          |
| cpython | 232K           | 179 + 6.5MB               | 221MB          | 199.9MB         |

It should also compress better for binary files, since there is no line-based
diff algorithm.

Performance wise, my previous experiments on fbsource showed compression is
faster with zstdelta. Decompression is slower. But in reality we might have
many files to decompress, in which case, multi-thread should make things
better.

The delta base decision logic is designed to automatically reshape a linear
chain to a tree to reduce chain length. The next diff adds dedicated tests
for the algorithm.

The name `Zstore` was chosen because the prefix `zst` is the name of
the compression algorithm.

Reviewed By: kulshrax

Differential Revision: D10251983

fbshipit-source-id: 3ba308d2799bb759a36f69a88f7c0144830fc41e
2019-11-13 14:44:36 -08:00
Michael Devine
3fb8264cf4 Implement file mode logic for repo converter
Summary: Up until now, we haven't been setting file modes for the files we're putting into hg. This seems like it might be related to some of the problems we're seeing in changes relating to symlinks. This commit adds mode tracking to try to fix that. It also adds unit tests to test the underlying mode conversion functions in gitutil to check our logic.

Reviewed By: tchebb

Differential Revision: D18409701

fbshipit-source-id: c5c3a90e12bd7115e24024a912f175484efe8a90
2019-11-13 13:19:29 -08:00
Jun Wu
2fbe60fea6 pullcreatemarkers: support git commit hashes
Summary:
For certain repos, the Phabricator GraphQL returns Git commit hashes. Add an
option to convert them to hg commit hashes.

Reviewed By: simpkins

Differential Revision: D18442376

fbshipit-source-id: b68be1d69adca85105d9f1124561c753909fbb32
2019-11-12 21:15:36 -08:00
Jun Wu
cb142585f3 pullcreatemarkers: avoid calling graphql too frequently
Summary:
The current implementation calls GraphQL at least twice to make sure pagination
didn't happen. But the second call seems to be rate-limited and timed out in
some cases. Practically it seems one round-trip can just work for hundreds of
commits. Therefore let's just avoid the second GraphQL call.

Reviewed By: singhsrb

Differential Revision: D18442374

fbshipit-source-id: 3313bd01516e758aeeafd6d1ec674eb7c27e165b
2019-11-12 20:18:32 -08:00
svcscm
e26f21353c Updating submodules
Summary:
GitHub commits:

553d397359
2a1dc6cf79
4bd2132eaa
ce60998143

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 41b56724fd2614083c2f854489fbd33b6ab6535e
2019-11-12 19:42:14 -08:00
Adam Simpkins
3e72b11174 do not attempt to build HgDatapackStore on Mac
Summary:
The `HgDatapackStore.cpp` file currently depends on code not available on Mac,
so do not attempt to build it there.

Reviewed By: fanzeyi

Differential Revision: D18467948

fbshipit-source-id: cce37bb480426e6d972045321f15c1f2aa4457ee
2019-11-12 18:35:50 -08:00
svcscm
d26acc0dbe Updating submodules
Summary:
GitHub commits:

c8ebdc9781
67c9b0925c
9428045992
103322c93b
e3917f1902
edcf5e006b
83b8ff6b69

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: eb1b70519ab300c39bd3f04c579899ebf651fe5b
2019-11-12 18:19:44 -08:00
Jun Wu
ff49c90113 tests: fix hggit feature detection
Summary:
The "git" feature detection was broken so the tests didn't run. Fix the feature
detection so the tests run again.

Reviewed By: xavierd

Differential Revision: D18461790

fbshipit-source-id: 6f599e7cea8e20e1d091c20fea654ffa36512739
2019-11-12 17:13:36 -08:00
Jun Wu
9281189d60 hggit: use repo.heads()
Summary: D18366733 deprecated changelog.head(rev)s. Migrate hggit to use the new API.

Reviewed By: xavierd

Differential Revision: D18461791

fbshipit-source-id: 713a4eeab48c4455c46cf6415363949015eb5642
2019-11-12 17:13:36 -08:00
Xavier Deguillard
7d5ecb3c02 mutation: exclude nullid from allpredecessors
Summary:
The predecessor() revset would sometimes include the null commit, combined as a
range, this meant all the commit in the commit graph, which is unexpected. Fix
this by considering that the nullid is in the seen set.

Reviewed By: quark-zju

Differential Revision: D18461597

fbshipit-source-id: 522d4174ecc4d136a6e2b1faba89b1f0cb492fa0
2019-11-12 16:50:53 -08:00
Chad Austin
0cb796d2c3 build deprecation-clean
Summary:
I spent hours debugging a deadlock in my code that was caused by
accidental usage of the deprecated Synchronized::operator->. Avoid
that in the future by building Eden deprecation-clean.

Reviewed By: genevievehelsel

Differential Revision: D18354757

fbshipit-source-id: fe74250635f779bb5010f907d57951132b9edea4
2019-11-12 16:31:54 -08:00
svcscm
acbc85e12c Updating submodules
Summary:
GitHub commits:

ae1758dc67
42b5494ec8
35c4a5d481

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 28f531f546459272a540e5d521811b971beed9e8
2019-11-12 16:31:54 -08:00