Summary:
Make it so that remote bookmarks like `foo/name` or `bar/name` would pull from
different sources `paths.foo` or `paths.bar`.
Reviewed By: DurhamG
Differential Revision: D21526666
fbshipit-source-id: 6791ab047840c6c49df0c96ff1f56ae7bd1aeeba
Summary:
We now have auto pull logic that covers most unknown rev use-cases. The hint
message is no longer necessary. It's also unclear how to use `hg pull`
correctly. For example, should it be `-r`, `-B remote/foo` or `-B foo`?
Reviewed By: DurhamG
Differential Revision: D21526667
fbshipit-source-id: 40583bfb094e52939130250dd71b96db4d725ad5
Summary: The original purpose of this test was to verify that `hg restack` would work correctly with the `inihibt` extension disabled. `inhibit` has not been relevant at FB for years, so this test has no value.
Reviewed By: quark-zju
Differential Revision: D21555411
fbshipit-source-id: 475ed37439ed71aee08ad1b23ebe1770c3324890
Summary:
This is helpful, when we have raw unbundle bytes and a server path and just
want to send these bytes server's way.
Very similar to `sendunbundlereplay`, but does not do anything additional,
and reads from stdin.
Reviewed By: markbt
Differential Revision: D21527243
fbshipit-source-id: 97726cb40a32c7e44f47e0f56d8c8eabc4faf209
Summary:
As a developpers is working on large blobs and iterating on them, the local LFS
store will be growing significantly over time, and that growth is unfortunately
unbounded and will never be cleaned up. Thankfully, one the guarantee that the
server is making is that an uploaded LFS blob will never be removed[0]. By using
this property, we can simply move blobs from the local store to the shared
store after uploading the blob is complete.
[0]: As long as it is not censored.
Reviewed By: DurhamG
Differential Revision: D21134191
fbshipit-source-id: ca43ddeb2322a953aca023b49589baa0237bbbc5
Summary: The compiler is warning about it.
Reviewed By: singhsrb
Differential Revision: D21550266
fbshipit-source-id: 4e66b0dda0e443ed63aeccd888d38a8fcb5e4066
Summary: Expose the API that returns a real graph.
Reviewed By: DurhamG
Differential Revision: D21486520
fbshipit-source-id: 4ebdb4011df8971c54930173c4e77503cd2dac47
Summary:
Part of the mutation graph (excluding split and fold) can fit in the DAG
abstraction. Add a method to do that. This allows cross-dag calculations
like:
changelogdag = ... # suppose available by segmented changelog
# mutdag and changelogdag are independent (might have different nodes),
# with full DAG operations on either of them.
mutdag = mutation.getdag(...)
mutdag.heads(mutdag.descendants([node])) & changelogdag.descendants([node2]) # now possible
Comparing to the current situation, this has some advantages:
- No need to couple the "visibility", "filtered node" logic to the mutation
layer. The unknown nodes can be filtered out naturally by a set "&"
operation.
- DAG operations like heads, roots can be performed on mutdag when it's
previously impossible. We also get operations like visualization for free.
There are some limitations, though:
- The DAG cannot represent non 1:1 modifications (fold, split) losslessly.
Those relationships are simply ignored for now.
- The MemNameDag is not lazy. Reading a long chain of amends might be slow.
For most normal use-cases it is probably okay. If it becomes an issue we
can seek for other solutions, for example, store part of mutationstore
directly in a DAG format on disk, or have fast paths to bypass long
predecessor chain calculation.
Reviewed By: DurhamG
Differential Revision: D21486521
fbshipit-source-id: 03624c8e9803eb1852b3034b8f245555ec582e85
Summary:
This allows us to replace the pyre2 C++ bindings so the fast regex engine can
work with Python 3, and simplify our build steps.
Reviewed By: DurhamG
Differential Revision: D20973179
fbshipit-source-id: e123ac18954991f2c701526108f5c2ecd2b31a3b
Summary: Add the ability to parse EdenAPI history responses to `data_util`.
Reviewed By: quark-zju
Differential Revision: D21489228
fbshipit-source-id: 42dda64273673431a6f3e4d7bd430689c76c387f
Summary: Change `make_req` to take a JSON array as input when constructing `DataRequest`s instead of a JSON object. This is more correct because DataRequests can include multiple `Key`s with the same path; this cannot be represented as an object since an object is effectively a hash map wherein we would have duplicate keys.
Reviewed By: quark-zju
Differential Revision: D21412989
fbshipit-source-id: 07a092a15372d86f3198bea2aa07b973b1a8449d
Summary:
Write commit cloud sync and clienttelemetry blackbox logs to tracing data.
Note: since metalog can answer head changes, I didn't add head changes of
commit cloud sync to the tracing data.
Reviewed By: DurhamG
Differential Revision: D19797700
fbshipit-source-id: b89924a7aa5e6027cad5c8138e8988f6b0ea4b2a
Summary: This allows us to query tracing data for watchman commands.
Reviewed By: DurhamG
Differential Revision: D19797711
fbshipit-source-id: 4dfd50fff820da70888faa0fe8f53af25f205137
Summary:
The repo.pull API updates remote bookmarks on its own. Therefore do not even
ask the server to listkey (all) bookmarks.
This also removes the need of listkeys(bookmarks) for the new clone API.
Reviewed By: DurhamG
Differential Revision: D21011393
fbshipit-source-id: b10bdbc82563c32626bdcb2632170fd56819e904
Summary:
The core `clone.streamclone` is the new clean way to do a streaming clone with
selectivepull. Detect the use of it and skip remotenames' own exclone logic.
Reviewed By: DurhamG
Differential Revision: D21011396
fbshipit-source-id: 50fdbf4c2761a96c50e23f21a87ef636fac74afb
Summary:
The current `clone --shallow` command has some issues:
- It fetches *all* remote bookmarks, since selectivepull does not work with
streamclone, then remove most remote bookmarks in a second transaction.
- It goes through remotenames, which is racy, and D20703268 does not fix the
clone case. Possible cause of T65349853.
- Too many wrappers (ex. in remotefilelog, remotenames, fastdiscovery) wtih
many configurations (ex. narrow-heads on/off) makes it hard to reason about.
Instead of bandaidding the clone function, this diff adds a new clone implementation
that aims to solve the issues:
- Use streamclone, but do not pull all remote names.
- Pull selectivepull names explicitly with a working "discovery" strategy
(repo heads should be non-empty with narrow-heads on or off).
- Do clone in one transaction. Outside world won't see an incomplete state.
- Use `repo.pull` API, which is not subject to race conditions.
- Eventually, this might be the only supported "clone" after Mononoke becoming
the single source of truth.
Note: the code path still goes through bookmarks.py and remotenames.py.
They will be cleaned up in upcoming diffs.
Reviewed By: DurhamG
Differential Revision: D21011401
fbshipit-source-id: d8751ac9bd643e9661e58c87b683be285f0dc925
Summary:
In the past we hide the revlog headrevs API with the idea that calculating
heads in the DAG is not going to scale, and heads should be based on references
(remotenames, visible heads). Practically calculating heads in the DAG based
on segmented changelog is not going to be painfully slow so we probably can
afford it.
Therefore let's just re-expose the DAG-based heads API as rawheads. The only
user of it is in dagutil.py.
This will be used in the next diff where streamclone first gets the revlog
changelog copied without remote bookmarks. Then it needs to do a pull
which requires the heads information.
Reviewed By: DurhamG
Differential Revision: D21296530
fbshipit-source-id: a81a61e3b58c921a3390fda8f716bd7ae0e55ed1
Summary:
Move the logic to write repo hgrc ([paths]) and set [paths] config options
earlier, so other logic can use the [paths] config.
Some tests are changed because remotenames can now write bookmarks in more
cases.
Reviewed By: DurhamG
Differential Revision: D21011397
fbshipit-source-id: 4b921a02c20daeef31d44a03264a89b975303aa5
Summary:
"[paths] being empty" will no longer be a way to test initial clone, use
transaction name instead.
Reviewed By: DurhamG
Differential Revision: D21011395
fbshipit-source-id: e257fe8eb2efd45ac52fad7c74363151b0a8c417
Summary: This will be used by hg-git to test initial clone.
Reviewed By: DurhamG
Differential Revision: D21011400
fbshipit-source-id: 11a1a41631830273a6407e419ebe5ff21964e7de
Summary: It is not used and makes the already complicated clone logic more complicated.
Reviewed By: DurhamG
Differential Revision: D21011394
fbshipit-source-id: 3620f7372a9f3cefc60618052c768c6c2cbe04f9
Summary:
They are not used. Remove it to make it a bit easier to move stream_out_shallow
to core.
Note: this does not remove all include/excludepatterns yet.
Reviewed By: DurhamG
Differential Revision: D21011403
fbshipit-source-id: f6d27a3e2472f6c69f95a958ac99f75a8b8f8b74
Summary: It will be used in the next change.
Reviewed By: DurhamG
Differential Revision: D21011399
fbshipit-source-id: 6bdffc79af0474e42562686109417882a8cb2cd6
Summary:
Add the `hg cloud hide` command. This allows removal of commits, bookmarks and
remote bookmarks from a cloud workspace, even when the items are omitted
locally.
Reviewed By: DurhamG, quark-zju
Differential Revision: D21409384
fbshipit-source-id: 24b64c207c78f9b0258e9cf6a578db7b14c84901
Summary: This will reduce the amount of space they take in scuba.
Reviewed By: xavierd
Differential Revision: D21483472
fbshipit-source-id: 9de49dedef480932f8583dd17fe6625d222a3285
Summary: This allows us to query tracing data for fsmonitor walk events.
Reviewed By: DurhamG
Differential Revision: D19797709
fbshipit-source-id: 1ff76dd6122cf56787e7928711f604f9c3d571cc
Summary:
Pass `configparser::config::ConfigSet` to `repack` in
`revisionstore/src/repack.rs` so that we can use various config values in `filter_incrementalpacks`.
* `repack.maxdatapacksize`, `repack.maxhistpacksize`
* The overall max pack size
* `repack.sizelimit`
* The size limit for any individual pack
* `repack.maxpacks`
* The maximum number of packs we want to have after repack (overrides sizelimit)
Reviewed By: xavierd
Differential Revision: D21484836
fbshipit-source-id: 0407d50dfd69f23694fb736e729819b7285f480f
Summary:
Let's not allow proceeding with memcommit if repo is locked. This what normal
push flow does, so we should allow it here as well.
Reviewed By: markbt
Differential Revision: D21502435
fbshipit-source-id: 80e665f065fb0cd882bc99482769a3de01d3de30
Summary:
If http_proxy.no is set, we should respect it to avoid sending traffic to it
whenever required.
Reviewed By: wez
Differential Revision: D21383138
fbshipit-source-id: 4c8286aaaf51cbe19402bcf8e4ed03e0d167228b
Summary:
When Qing implemented all the get method, the translate_lfs_missing function
didn't exist, and I forgot to add them in the right places when landing the
diff that added it. Fix this.
Reviewed By: sfilipco
Differential Revision: D21418043
fbshipit-source-id: baf67b0fe60ed20aeb2c1acd50a209d04dc91c5e
Summary: Make them reusable in other Python bindings, ex. pymutation.
Reviewed By: sfilipco
Differential Revision: D21486524
fbshipit-source-id: 258455c6a442353c77588fadcb560cb5a170926e
Summary: This makes it easier to visualize a MemNameDag.
Reviewed By: sfilipco
Differential Revision: D21486523
fbshipit-source-id: c65f1fc421bd654dc820faae3c93f2aa57f910d4
Summary:
This will allow clients to operate on MemNameDag.
Unfortunately, it isn't that easy to reuse code in `py_class!`. Since they are
just thin wrappers, I live with the copy-paste for now.
Reviewed By: sfilipco
Differential Revision: D21479015
fbshipit-source-id: ddcc7f5c7ede6bb1e9c73d058779805875b09200
Summary: This would be handy to visualize a MemNameDag.
Reviewed By: sfilipco
Differential Revision: D21486522
fbshipit-source-id: c8d7147dc53a1a7c1b8b09ce055493c69cceba2f
Summary:
Use MemNameDag::from_ascii to simplify the tests. This removes the need of:
- using tempdir
- converting between Id and VertexName manually via an IdMap
- depending on drawdag directly
Reviewed By: sfilipco
Differential Revision: D21486519
fbshipit-source-id: f04061d8892f043de40e7e321273acc51e15308a
Summary:
It seems handy to construct a Dag just from ASCII. Therefore move it to a
public interface.
Reviewed By: sfilipco
Differential Revision: D21486525
fbshipit-source-id: de7f4b8dfcbcc486798928d4334c655431373276
Summary:
They are part of the read-only algorithms that are not specific to a certain
type of NameDag.
Reviewed By: sfilipco
Differential Revision: D21479017
fbshipit-source-id: 3fa58071ac43246d3cd45d84384ee93c7385f414
Summary:
Adds an in-memory NameDag so we can construct the DAG and use its algorithms by
just providing parents function and heads.
Reviewed By: sfilipco
Differential Revision: D21479021
fbshipit-source-id: e12d53a97afec77b2307d5efbb280bd506dee0ba
Summary: Adds an in-memory IdMap to be used in an in-memory NameDag.
Reviewed By: sfilipco
Differential Revision: D21479018
fbshipit-source-id: bc702762b059e8659c6ab322f3c39f032e95d5b6
Summary:
This allows them to switch to a different IdMap implementation relatively
easily.
Reviewed By: sfilipco
Differential Revision: D21479023
fbshipit-source-id: 8ecb99cafe2093ec7d14b848ffa08581c5300414
Summary: This will allow different IdMap implementations.
Reviewed By: sfilipco
Differential Revision: D21479016
fbshipit-source-id: 852501896fddcb82624338acd9dceee41150e302
Summary:
`NameDag::add_heads` API changes the internal `dag` state without updating
`snapshot_map`. That will cause queries relying on `snapshot_map` to fail.
Update it so that `snapshot_map` gets updated by `add_heads`.
Reviewed By: sfilipco
Differential Revision: D21479019
fbshipit-source-id: 70528aa4a488cef3dc71bf21dd89e45cfe763794
Summary:
This makes it easier to add an "in-memory-only" NameDag with all the algorithms
implemented.
Reviewed By: sfilipco
Differential Revision: D21479020
fbshipit-source-id: c1a73e95f3291c273c800650f70db2a7eb0966d7
Summary:
Commit cloud now uses `mercurial.json` rather than `json`. This doesn't
support the `indent` arg, so remove this from the debug output when
`debugrequests` is enabled.
Reviewed By: farnz
Differential Revision: D21500306
fbshipit-source-id: ae436e9c32d1d2da432eeb93d114115ea80b825b
Summary: If no LFS blobs needs uploading, then don't try to connect to the LFS server in the first place.
Reviewed By: DurhamG
Differential Revision: D21478243
fbshipit-source-id: 81fa960d899b14f47aadf2fc90485747889041e1
Summary:
When LFS is enabled, only bundle3 is supported, so we have to hack the exchange
code a bit in this case to always chose bundle3.
This is copied verbatim from the lfs extension.
Reviewed By: DurhamG
Differential Revision: D21459734
fbshipit-source-id: 41c867cec09e2485ec1e9d91545b61da568f4766
Summary: This is according to the suggestion in the discussion referenced in the task. Per quark-zju we do need to change `rage` to use `hg sparse` rather than `hg sparse show`.
Reviewed By: quark-zju
Differential Revision: D21422005
fbshipit-source-id: 6dd0e20125635c7fb9b6ea6c9e2b35c8fb517d5d
Summary: Added the `status` field to json in order to provide that information to the automated client, as well as match similar output of `hg status`.
Reviewed By: quark-zju
Differential Revision: D21421494
fbshipit-source-id: 2a8b80068f2068b09930b90c43252003421b324e
Summary: Fixed that `hg sparse show` failed on missing profiles. Added them to be shown in the output with "!" symbol and in cyan color - which matches output of deleted files in `hg status`.
Reviewed By: quark-zju
Differential Revision: D21419278
fbshipit-source-id: 5581e67774686a5240dceb9aac428fac3b1b73c2
Summary:
Remove HgIdDataStore::get_delta and all implementations. Remove HgIdDataStore::get_delta_chain from trait, remove all unnecessary implentations, remove all implementations from public Rust API. Leave Python API and introduce "delta-wrapping".
MutableDataPack::get_delta_chain must remain in some form, as it necessary to implement get using a sequence of Deltas. It has been moved to a private inherent impl.
DataPack::get_delta_chain must remain in some form for the same reasons, and in fact both implenetations can probably be merged, but it is also used in repack.rs for the free function repack_datapack. There are a few ways to address this without making DataPack::get_delta_chain part of the public API. I've currently chosen to make the method pub(crate), ie visible only within the revisionstore crate. Alternatively, we could move the repack_datapack function to a method on DataPack, or use a trait in a private module, or some other technique to restrict visibility to only where necessary.
UnionDataStore::get has been modified to call get on it's sub-stores and return the first which matches the given key.
MultiplexDeltaStore has been modified to implement get similarly to UnionDataStore.
Reviewed By: xavierd
Differential Revision: D21356420
fbshipit-source-id: d04e18a0781374a138395d1c21c3687897223d15
Summary:
Update `contrib/check-code.py` to Python 3.
Mostly it was already compatible, however stricter regular expression parsing
revealed a case where one of our tests wasn't working, and as a result lots of
instances of `open(file).read()` existed that this test should have caught.
I have fixed up most of the instances in the code, although there are many
in the test suite that I have ignored for now.
Reviewed By: quark-zju
Differential Revision: D21427212
fbshipit-source-id: 7461a7c391e0ade947f779a2b476ca937fd24a8d
Summary: Reformat using a newer version of Black.
Reviewed By: quark-zju
Differential Revision: D21426337
fbshipit-source-id: 1ac7f6e85a06feec0d41e9509eca09194f421a1d
Summary:
The latest version of Black removes unneccessary parenthesis. Mercurial's
test-check-code currently uses extra parentheses to signal untranslated strings, so
Black's reformatting breaks this test.
Capitulate to Black by adding a new `_x` translation marker that means "untranslated".
Reviewed By: quark-zju
Differential Revision: D21426335
fbshipit-source-id: a6c26d7c6365c49530a7dee3a5f9ed71ff166835
Summary:
Implement autopull so non-automation `hg pull -r Dxxxx`, `hg up Dxxxx` will
pull `Dxxxx` automatically.
Since we now autopull the commits, error messages are removed. The old code
actually causes issues because it will raise at `"D1234" in repo`, which is
a surprise to many code paths, including the revset autopull logic, which
uses `x in repo` to decide whether `x` is unknown.
Note `hg pull -r Dxxxx` is not using the revset layer and needs to be handled
separately. It works for hg servers right now because the server can translate
`Dxxx` to a commit hash. It probably does not work for a Mononoke server.
Reviewed By: sfilipco
Differential Revision: D21320626
fbshipit-source-id: 939abe12e3a9a8ed5ca7ed29bb4f90fb39e7674a
Summary:
Change the interface to return infallible `Optional[node]` instead of fallible
`List[rev]`. In the next diff, we're going to use the 'node' information to
implement autopull.
Reviewed By: sfilipco
Differential Revision: D21320628
fbshipit-source-id: 6f7c070faba667cc85313cc78d6149c787ca8593
Summary:
Currently, phrevset picks the "successor" that has the maximum revision
number. That depends on the assumption that larger revision numbers
are modified last. Howevver, that's not always true with commit cloud sync. For example, in my repo I have D21179514 modified from 63768bf43
to 684612d5d. Phabricator has 63768bf43. Local successor is 684612d5d,
but the revision number of 684612d5d is smaller than 63768bf43:
quark@devvm1939 ~/hg/edenscm/hgext % hg log -r 'D21179514'
changeset: 63768bf436d01982a8d42ce97160ac6d9ae2cdad D21179514
user: Jun Wu <quark@fb.com>
date: Wed, 22 Apr 2020 09:45:50 -0700
summary: [hg] commitcloud: log metalog root during update references
quark@devvm1939 ~/hg/edenscm/hgext % lhg log -r 'D21179514'
changeset: 684612d5d606b01c224889f2b3f87aff7b93db49 D21179514 (@)
user: Jun Wu <quark@fb.com>
date: Wed, 22 Apr 2020 10:10:37 -0700
summary: [hg] commitcloud: log metalog root during update references
quark@devvm1939 ~/hg/edenscm/hgext % lhg log -r 'successors(63768bf436d0198
2a8d42ce97160ac6d9ae2cdad)' -T '{node} {rev}\n'
684612d5d606b01c224889f2b3f87aff7b93db49 76718
63768bf436d01982a8d42ce97160ac6d9ae2cdad 95363
Improve it by actually prefer selecting a non-obsoleted successor.
Reviewed By: sfilipco
Differential Revision: D21267552
fbshipit-source-id: d43d72a7c273c55af70bb41ad967fff0c78a452a
Summary: This is more efficient (if pullattempts have high chance to succeed).
Reviewed By: sfilipco
Differential Revision: D21320627
fbshipit-source-id: a2166f5a59f98c7d705c806b9d152ceb9981f3be
Summary:
Make it so that the autopull functions just describe what to do (using the
`pullattempt` struct) instead of having the side effect directly. This will be
useful in multiple cases:
- The actual autopull logic becomes easier to implement.
- The revset autopull layer can merge `pullattempt`s to fetch things in one go.
- The `pull -r` logic can reuse the `pullattempt`s to translate what to pull
(ex. from `D1234` to a commit hash).
This has subtle changes that multiple "remote"s are no longer properly
supported. That is probably fine in our production use-cases but we might
want to revisit if we want to support remotes "properly". Currently, this
greatly simplifies things due to the fact that "infinitepush" or
"infinitepushbookmark" have to be used in certain cases.
Reviewed By: sfilipco
Differential Revision: D21320633
fbshipit-source-id: e38b68abf69a34a97431685aa7ab0d2fe022fda8
Summary: Add a way for extensions to register how to auto pull unknown names.
Reviewed By: sfilipco
Differential Revision: D21320630
fbshipit-source-id: d20e11cff83b8a7e15a5085b0508a3e5bef305c3
Summary:
We're going to make autopull more complicated. Move it to a separate module as
it is not directly related to revset.
Reviewed By: sfilipco
Differential Revision: D21320631
fbshipit-source-id: fe60bc53ebf1c75f8bf66156805cbe2801fe6532
Summary:
The revset optimization makes unknown names harder to extract. For example,
`(or (list "a" "b" "c"))` will be optimized to `(_list "a\0b\0c")` and it
becomes harder to extract `"a"`, `"b"`, and `"c"`.
Move the unknown name extraction logic to before the optimization step to solve
it.
Reviewed By: sfilipco
Differential Revision: D21320632
fbshipit-source-id: 3a25f1cf4aab0449be6952113d622f29b1c0b631
Summary:
This allows us to understand what config is used during a transaction.
For example, is `selectivepull` enabled during a `pull`?
Reviewed By: DurhamG
Differential Revision: D21222146
fbshipit-source-id: a8c82f2b02e9657885947a706f728e28b1bfc1e2
Summary:
We're seeing deadlocks where if the process forks (like in a update
worker) while a background python thread is holding the progress lock, it can
cause a deadlock in the forked process if the thread ever tries to access the
progress bar.
To fix it, let's invalidate the engine if the process forks.
Reviewed By: xavierd
Differential Revision: D21415152
fbshipit-source-id: 75607dd2c1ed122b3a9df68d359ba9dcdde78a77
Summary:
A number of repo names are used quite frequently. Let's use an enum to
prevent typos and make things cleaner.
Reviewed By: quark-zju
Differential Revision: D21365036
fbshipit-source-id: 1d3d681443df181e9076f5ee87029ae61124a486
Summary: This bug got in while iterating the original Diff. It should only be returning empty when the blob does not exist locally.
Reviewed By: xavierd
Differential Revision: D21417659
fbshipit-source-id: 676e22313ab4a024af5341d8c99797fc062bd293
Summary:
Instead of trying to maintain two hgrc.dynamic's for shared repositories,
let's just always use the one in the shared repo. In the long term we may be
able to get rid of the working-copy-specific hgrc entirely.
This does remove the ability to dynamically configure individual working copies.
That could be useful in cases where we have both eden and non-eden pointed at
the same repository, but I don't think we rely on this at the moment.
Reviewed By: quark-zju
Differential Revision: D21333564
fbshipit-source-id: c1fb86af183ec6dc5d973cf45d71419bda5514fb
Summary: Let's log the mismatches to scuba so we can track them down.
Reviewed By: quark-zju
Differential Revision: D21313255
fbshipit-source-id: ee79c9504a80ebe5b21849c0eae5993b65eaff28
Summary:
In a future diff we want to log information about configuration
mismatches. In order to do that, we need to be able to call ui.log before
extensions are setup. Let's move the ui.log sampling logic into core so it can
be called before extension setup.
Reviewed By: quark-zju
Differential Revision: D21313257
fbshipit-source-id: fe1c0f572720c17e7398f2a4fa7082ef8fb59536
Summary:
Adds python logic for validating the dynamic configs. Any dynamic
configs that don't match the given list of rc files will be reported and removed
Reviewed By: quark-zju
Differential Revision: D21310919
fbshipit-source-id: 07f584bba990f1b01347dfbc285e3ca814fe5c5a
Summary:
Adds .hg/hgrc.dynamic to the default load path, before .hg/hgrc though,
so it can be override.
Reviewed By: quark-zju
Differential Revision: D21310921
fbshipit-source-id: 288a2a2ba671943a9f8532489c29e819f9d891e1
Summary:
Our internal git dependency got upgraded, so we need to upgrade our
Cargo.toml version. Unfortunately this doesn't seem to have any test coverage?
Reviewed By: singhsrb
Differential Revision: D21410241
fbshipit-source-id: 64fe7f39a9c93aa5d97ce095ee1641c1cc6ed365
Summary:
The formatter is broken, it prints to stdout which breaks json output,
and it's questionable whether we want a new line printed to the user for every
200k files downloaded.
Reviewed By: quark-zju
Differential Revision: D21409529
fbshipit-source-id: 2a5d94f8fcc62dbe25f0aae5453e4664c49fdcb2
Summary:
`eden stats memory` was never useful because it shows system
statistics which you can get better from `top`, `htop`, or `atop`.
Reviewed By: genevievehelsel
Differential Revision: D21392737
fbshipit-source-id: 010021b8a97bd8ba8ac289d906acc3c3ecd10768
Summary:
Talked with xavierd last week and we can use LocalStore's `get_missing` to determine if a blob is present locally. In this way we can prevent the backingstore crate from accidentally asking EdenAPI for a blob, so better control at EdenFS level.
With this change, we can use this function at the time where a blob import request is created with confidence that this should be short cheap call.
This diff should not change any behavior or performance.
Reviewed By: xavierd
Differential Revision: D21391959
fbshipit-source-id: fd31687da1e048262cb4eae2974cab6d8915a76d
Summary:
When doing discovery, for repos with long master lines and infrequent
branches, picking a random set of sample commits could result in not picking the
master, and therefore having to do very long commit graph traversals to check
ancestors against the other samples.
To prevent this, let's pick the N most recent commits instead of a random
sample. This should generally get the master commit into our sample.
Reviewed By: quark-zju
Differential Revision: D21394302
fbshipit-source-id: f4b8110cd126b90553ec624e48cab0b590e124fb
Summary:
Addressing issues simpkins brought up on D21207287 when we upgraded and introduced some pyre bugs.
Temporarily upgrading just this project, once we resolve some sandcastle capacity issues we'll release this via another global upgrade in fbcode.
Reviewed By: simpkins
Differential Revision: D21316793
fbshipit-source-id: f0c79f53d97f7182e7d8fe6e081c58ef53ce0c9a
Summary: When we create directory at certain places, we want these directories to be shared between different users on the same machine. This Diff uses the previously added `create_shared_dir` function to create these directories.
Reviewed By: xavierd
Differential Revision: D21322776
fbshipit-source-id: 5af01d0fc79c8d2bc5f946c105d74935ff92daf2
Summary:
D21316793 is blocked from landing because there are a few targets in eden that are running pyre via buck targets integration.
We can't do custom version overrides for projects that are using a mix of local configurations and buck integration, because buck doesn't provide an interface for setting the equivalent pyre version override.
We're moving away from buck targets integration for pyre across the board, and I've run a codemod over the project to clean up all of the buck typing integration (including some residual mypy) as well as updated type ignores / fixmes accordingly.
Let me know if you have any concerns; upon skimming it looks like most changes are either converting `type: ignore`s into fixmes, or removing `type: ignores`.
Reviewed By: dkgi
Differential Revision: D21343093
fbshipit-source-id: 5ee1436377eb526c0a679fb821c42e07cbca52a5
Summary:
ConEmu tries to normalize 256 colors to 16 colors but its normalization logic
is buggy. For example, color196 gets normalized to green instead of red. See
the attached picture of ConEmu and its debug real console.
{F235735030}
Reviewed By: markbt, ikostia
Differential Revision: D21311443
fbshipit-source-id: cb6db07d6b10a7365e33f4aa8f5f3f61f90c8e69
Summary:
We'll be adding a bunch of Facebook specific configuration and values
here. Let's move it to someplace not open source.
Reviewed By: quark-zju
Differential Revision: D21241038
fbshipit-source-id: 2ac9cdce40b1b46f15f171d9d1f6b6692dcd29bf
Summary:
Implements an ensure_location_supersets function who's goal is to
verify that a given config location specifies the exact same configs as a given
set of other locations. Any inconsistencies are removed from the config and
reported to the caller.
This will be used to ensure our dynamic configs match our existing rc file
configs exactly, before we delete the file configs.
Reviewed By: quark-zju
Differential Revision: D21240837
fbshipit-source-id: e2c8ec054a3696d2cf02e65c212ad886c5117253
Summary:
The `parents` template currently returns "meaningfulparents". This sometimes
returns the null revision as the second parent, making templates think this is a
merge commit when it is not. Make sure we filter this out.
Reviewed By: quark-zju
Differential Revision: D21347776
fbshipit-source-id: af83fd5cff381850ac39d97b5b2f4c77033fe2fb
Summary: `cargo autocargo` should normally produce no changes on `master`. The features of the `log` crate was updated in D21303891 without re-running autocargo. This fixes it.
Reviewed By: dtolnay
Differential Revision: D21349799
fbshipit-source-id: ce487bc5989e179673297350249593103b4d34dd
Summary:
Now we download files in 200K chunks, and it might be confusing - it's unclear
whether hg is making any progress or not.
This diff makes it clearer.
Note I'm not printing progress before first fetch to avoid breaking the tests
Reviewed By: farnz
Differential Revision: D21348756
fbshipit-source-id: 05e5169114adf2b99a74b37d933755a644214a42
Summary: Mercurial Infinitepush normally records received bundles into the `forwardfillerqueue`, which is later tailed by the commit cloud `forwardfiller` in order be replayed onto Mononoke. Now I am adding a reverse filler, which means that we will have two such queues and sync in two directions. Therefore, in order to avoid infinite loops we need to distinguish cross-backend bundle replay from genuine pushes. I propose to use `crossbackendsync` bundle2 param to indicate that no recording is needed.
Reviewed By: krallin
Differential Revision: D21255446
fbshipit-source-id: 70f6efe1331bd3c7fd3aca61d486d350d93086dc
Summary:
Previously we weren't showing help at all when running "hg cloud --help". This
diff should fix it
Reviewed By: ikostia
Differential Revision: D21347825
fbshipit-source-id: 1d9d11e2f9fe18a03b5d2cd8bd316fe9a218347c
Summary:
In vs-code if you have a well-formed url you can command-click it
to open it, e.g., when you see it in your terminal. But this URL is not
well-formed because it's missing the protocol. So let's add it.
Reviewed By: quark-zju
Differential Revision: D21336742
fbshipit-source-id: dd2de2d5177d3a2542c4a22f0099f28b97c79d06
Summary: If the bundle file has 1G in size, we probably don't want to waste 1G of memory just to see that it is too big.
Reviewed By: markbt
Differential Revision: D21177359
fbshipit-source-id: 026b5ab40e6dbddba3d7142a8e34256d127bf82c
Summary:
Building on the previous two commits, this adds a test which performs the following steps:
- does an infintiepush push to a Mercurial server
- looks into the `forwardfillerqueue`
- runs commitcloud forwardfiller's `fill-one` to replay the bundle to Mononoke
- verifies that this action causes the commit to appear in Mononoke
As this test uses `getdb.sh` from Mercurial test suite, it needs to be whitelisted from network blackholing (Note: we whitelist mononoke tests, which run with `--mysql` automatically, but this one is different, so we need to add it manually. See bottom diff of the stack for why we don't use `--mysql` and ephemeral shards here).
Reviewed By: krallin
Differential Revision: D21325071
fbshipit-source-id: d4d6cbdb10a2bcf955ee371278bf2bbbd5f5122c
Summary:
Cloning a repository with selectivepull enabled temporarily disables
selectivepull for the duration of the initial pull so that we can get a
streaming clone.
Once this is done, hide all of the commits in the repository by clearing the
visible heads. Selective pull will then populate the remote bookmarks with the
public heads that we do want.
Reviewed By: quark-zju
Differential Revision: D21301037
fbshipit-source-id: 565ae50439ed5405ce940a5675caeba912fe7083
Summary: If a scratch remotebookmark points to a draft commit that is not available locally (i.e., has been hidden on a different machine), then don't pull it into the local repository. Instead, just omit the remote bookmark.
Reviewed By: quark-zju
Differential Revision: D21287886
fbshipit-source-id: 84e7c6b52250709f7c88b07fccdbb61e044370c8
Summary:
Selective pull subscripts are lost during a push. This is because
`remotenames.expush` calls `selectivepullbookmarknames` with the
remote, not the remote name.
`remotenames.exclone` does the same, but in that case there is
no need for the remote name as the destination can't have any
subscriptions other than the default set.
Reviewed By: quark-zju
Differential Revision: D21283029
fbshipit-source-id: 52c2e7e301b8e95b4a252cbfe2ad9de168e81044
Summary:
Commit cloud remote bookmarks sync has several edge cases that don't work correctly.
This test demonstrates some that we will fix.
Reviewed By: quark-zju
Differential Revision: D21283028
fbshipit-source-id: 4e746476a0f3bf0ca7d7088f510451632a2ee075
Summary: Fix permission issues we are seeing with the latest Mercurial release.
Reviewed By: xavierd
Differential Revision: D21294499
fbshipit-source-id: bcfb13dd005258b2e3b74fa281dbd8df36133ef6
Summary: `termios` is not avialable on Windows. Do not import it.
Reviewed By: DurhamG
Differential Revision: D21258999
fbshipit-source-id: f4390b69fe9abceea8b1959e7506c1558778f980
Summary:
I wanted to figure out "who added this visible head", "what is the difference
between this metalog root and that root". Those are actually source control
operations (blame, diff). Add a git export feature so we can export metalog
to git to run those queries.
Choosing git here as we don't have native Rust utilities to create a more
efficient hg repo yet.
Ideally we can also make hg operate on a metalog directory as a "metalogrepo"
directly. However that seems to be quite difficult right now due to poor
abstractions.
Reviewed By: DurhamG
Differential Revision: D21213073
fbshipit-source-id: 4cc0331fbad6e1586907c0a66c18bcc25608ea49
Summary:
This would avoid issues where the Phabricator commit hash points
to a filtered commit locally. There are 2 user complaints already.
Reviewed By: DurhamG
Differential Revision: D21180833
fbshipit-source-id: 7374e236bcf5e3f3e62bae59fa53604869e22c6f
Summary:
This makes metalog easier to use in debugshell context. For example, to
investigate the "bookmarks" in the past, the code gets simplified from:
roots = b.metalog.metalog.listroots(repo.svfs.join('metalog'))
past_ml = b.metalog.metalog(repo.svfs.join('metalog'), root[10])
past_ml.get("bookmarks")
to:
roots = ml.roots()
past_ml = ml.checkout(roots[10])
past_ml.get("bookmarks")
Reviewed By: DurhamG
Differential Revision: D21162568
fbshipit-source-id: 7cc5581afe596a3d2696311a36ac11caa718428a
Summary: This uploads more details that might be useful for debugging.
Reviewed By: DurhamG
Differential Revision: D21179514
fbshipit-source-id: ba24395fc4fd153c3ceb4957f822aab70821e6ef
Summary: This allows the Python world to obtain the root ID for logging purpose.
Reviewed By: DurhamG
Differential Revision: D21179513
fbshipit-source-id: 3f289c06d3d470ff492de39fa985203b3facbf00
Summary:
This would hopefully give us more insights about when and what host uploads
10k+ remote bookmarks.
Reviewed By: DurhamG
Differential Revision: D21179515
fbshipit-source-id: 3e5c5559e2e739268add05e40f71bea08c29662f
Summary:
We removed the feature in D20704618 and it does not cause complaints.
Let's remove the code supporting the chown feature.
Reviewed By: DurhamG
Differential Revision: D21170307
fbshipit-source-id: c845016219e8c681930bb1780b94e6d31ca99730
Summary:
While the change looks fairly mechanical and simple, the why is a bit tricky.
If we follow the calls of `ContentStore::get`, we can see that it first goes
through every on-disk stores, and then switches to the remote ones, thanks to
that, when we reach the remote stores there is no reason to believe that the
local store attached to them contains the data we're fetching. Thus the
code used to always prefetch the data, before reading from the store what was
just written.
While this is true for regular stores (packstore, indexedlog, etc), it starts
to break down for the LFS store. The reason being that the LFS store is
internally represented as 2 halves: a pointer store, and a blob store. It is
entirely possible that the LFS store contains a pointer, but not the actual
blob. In that case, the `get` executed on the LFS store will simply return
`Ok(None)` as the blob just isn't present, which will cause us to fallback to
the remote stores. Since we do have the pointer locally, we shouldn't try to
refetch it from the remote store, and thus why a `get_missing` needs to be run
before fetching from the remote store.
As I was writing this, I realized that all of this subtle behavior is basically
the same between all the stores, but unfortunately, doing a:
impl<T: RemoteDataStore + ?Sized> HgIdDataStore for T
Conflicts with the one for `Deref<Target=HgIdDataStore>`. Macros could be used
to avoid code duplication, but for now let's not stray into them.
Reviewed By: DurhamG
Differential Revision: D21132667
fbshipit-source-id: 67a2544c36c2979dbac70dac5c1d055845509746
Summary: implement the get() functions on the various LocalDataStore interface implementations
Reviewed By: quark-zju
Differential Revision: D21220723
fbshipit-source-id: d69e805c40fb47db6970934e53a7cc8ac057b62b
Summary:
This makes debugshell easier to use. Especially when the script wants to access
`__file__`.
Reviewed By: DurhamG
Differential Revision: D21169556
fbshipit-source-id: 88b3ebb1ca9a39fe26bc7cc5ea8e250c28fa0d6f
Summary:
Similar to part of D20804854, normalize infinitepush/ to default/ in
remotenames code paths.
This might not be strictly necessary, but we never want to write out
infinitepush/ remote bookmarks and we have seen that OnDemand writes out
infinitepush/ remote bookmarks (which got synced to commit cloud and caused
user complaints) recently.
Reviewed By: DurhamG
Differential Revision: D21233658
fbshipit-source-id: cf8c12ac40348c7b475a7f3d5d5223775491650e
Summary:
The python script run using `debugpython` within the test was importing
Mercurial internal modules which causes failures on some platforms like
Windows. Instead, lets use the `debugshell` command which already imports the
common objects like `repo` correctly.
Reviewed By: xavierd
Differential Revision: D21251818
fbshipit-source-id: db1b9e92df99b736a28bc9e89fb08ae77d6e82fc
Summary:
Memcache isn't available for Mac, but we can build the revisionstore with Buck
on macOS when building EdenFS. Let's only use Memcache for fbcode builds on
Linux for now.
Reviewed By: chadaustin
Differential Revision: D21235247
fbshipit-source-id: 5943ad84f6442e4dabbd2a44ae105457f5bb9d21
Summary:
When creates directories sometime we want to make sure other users within the same group have the write access to it to enable data sharing. Previously we rely on setting umask for the entire process to make sure the newly created directories have the correct permission bit. This is kind fragile and error-prone when running in a multi-thread environment.
This diff introduces an internal function `create_dir_with_mode` to create directory with specified permission mode. It first creates a temporary directory within the parent of the directory being created, setting up the correct permission bit, then attempts to rename the temporary directory to the desired name. This ensures that we never leave a directory without the correct permission in the place we need and without changing umask for the process.
Reviewed By: xavierd
Differential Revision: D21188903
fbshipit-source-id: 381bff7d3aaca097b9d50150e86cbbf70a90a0a5
Summary:
Adds initial python bindings for the rust pending changes. This is not
ready for production usage yet, but having the bindings let's me test changes
more easily until we're ready for automated tests.
Reviewed By: xavierd
Differential Revision: D20546896
fbshipit-source-id: c0ad7155e5068f45bf9c987030746e6c5f35c26a
Summary:
The second phase of pending changes is to iterate over the treestate
and figure out what files were not seen in the filesystem walk. This diff
implements that.
Reviewed By: xavierd
Differential Revision: D20546899
fbshipit-source-id: 3523fbc7e31ef0ed09c4937c72264b64e2a3db5b
Summary:
The first phase of pending changes is inspecting the filesystem for
changes. This diff adds that logic.
Reviewed By: xavierd
Differential Revision: D20546909
fbshipit-source-id: 1c2c0fa7f700dbff4acfce4d5271b4472a13571f
Summary: This ensures lagged master issue does not happen by pulling a single commit.
Reviewed By: DurhamG
Differential Revision: D20845384
fbshipit-source-id: 3ba16c07fe264fe2b6aecd494bbb832af7b390a0
Summary:
Patterns are more powerful than prefixes. Some full revset names are
obviously not valid remote name - for example, `remote/master :: .`.
They cannot be ruled out using prefixes but can using patterns.
As we're here, add some caching for the regex compiler.
Reviewed By: DurhamG
Differential Revision: D20831015
fbshipit-source-id: af8c4eed4a3153fd71480b8972c55feed4641392
Summary:
For names like `a-b-c`, it can be parsed in multiple ways:
- `"a-b-c"`
- `"a-b" - "c"`
- `"a" - "b-c"`
Mercurial uses `repo.lookup` in the parser to accept names like `"a-b-c"`.
Do it for the whole revset expression too.
But do not do it for every lookup (ex. testing `"a-b"` or `"b-c"` in the above
case), because that can be exceedingly expensive.
Reviewed By: DurhamG
Differential Revision: D20831014
fbshipit-source-id: f507e04ce24c953b096ccd836c356f50f11d2006
Summary:
Add a function to figure out unknown symbols of a revset AST without executing
the revset, then try to autopull unknown symbols.
This has pros and cons comparing to the runtime (stringset) approach.
Pros:
- The fullreposet restriction is lifted.
- We can have some ideas about whether the symbols are "probably" locally
known. If everything is locally known, then we can skip all remote lookups
(see the next diff for details).
- We can fetch multiple symbols in batch if we want. Although it's difficult
to do so right now due to different paths (paths.default, infinitepush,
infinitepushbookmark, etc). Revisit once the paths are unified.
Cons:
- Functions and argument types must be statically known. Might miss
some functions added by some extensions.
Reviewed By: DurhamG
Differential Revision: D20909535
fbshipit-source-id: a567ca0aa80aa7f2930dd75637ef3ff8cef1bdef
Summary:
Dashes are also revset operators. Add a test so we can verify if we can also
autopull those special names.
Reviewed By: DurhamG
Differential Revision: D20831016
fbshipit-source-id: 97e772053dae873ebaa529ac9eb84ea9d04f0f63
Summary:
Similar to the previous diff, let's use the new autopull logic, which
uses the tech-debt free repo.pull API.
In rare cases this can cause more pulls due to the path selection (ex. use
"infinitepush" for "remote/scratch/x" but "default" for "remote/stable/x").
With Mononoke serving repos, we might be able to remote the special paths,
and just use "default" for all cases.
If it goes well, we can then delete the old code.
Reviewed By: DurhamG
Differential Revision: D20804854
fbshipit-source-id: 75e68582a29b613c8626a119b85064e3c0ba9462
Summary:
The new auto pull logic can replace the one in remotenames. It it goes well, we
can then remove the code in remotenames doing the auto pull.
Reviewed By: sfilipco
Differential Revision: D20804853
fbshipit-source-id: c87b6b382f4cce3b306648b305a7b6bbaec05df1
Summary:
Attempt to auto pull bookmark names without the `remote/` or `default/` prefix
if hoist is set. This would hopefully be enough to allow us to enable
selectivepull globally without breaking existing users.
Reviewed By: sfilipco
Differential Revision: D20804856
fbshipit-source-id: 72601ac5e3545523cbfd7087d1fc822ef33c2f2e
Summary:
On repack, when the Rust stores are in use, the repack code relies on
ContentStore::commit_pending to return the path of a newly created packfile, so
it won't delete it when going over the repacked ones. When LFS is enabled, both
the shared and the local stores are behind the LfsMultiplexer store that
unfortunately would always return `Ok(None)`. In this situation, the repack
code would delete all the repacked packfiles, which usually is the expected
behvior, unless only one packfile is being repacked, in which case the repack
code effectively re-creates the same packfile, and is then subsequently
deleted.
The solution is for the multiplex stores to properly return a path if one was
returned from the underlying stores.
Reviewed By: DurhamG
Differential Revision: D21211981
fbshipit-source-id: 74e4b9e5d2f5d9409ce732935552a02bdde85b93
Summary:
This adds the proper hooks in the right place to upload the LFS blobs and write
to the bundle as LFS pointers. That last part is a bit hacky as we're writing
the pointer manually, but until that code is fully Rust, I don't really see a
good way of doing it.
Reviewed By: DurhamG
Differential Revision: D20843139
fbshipit-source-id: f2ef7b045c6604398b89580b468c354d14de1660
Summary:
Add two utility programs for ad-hoc debugging of EdenAPI. EdenAPI requests and responses are encoded as CBOR, which is not easy to work with manually on the command line. In order to allow debugging the HTTP API using tools like `curl`, we need tools that can generate raw request payloads and interpret CBOR responses.
The utility programs included in this diff are:
- `make_req` - Can construct EdenAPI request payloads from a human-editable JSON representation.
- `data_util` - Can list, validate, and extract the contents of an EdenAPI data response.
These tools can be used by themselves or as part of a pipeline. See test plan for examples.
Reviewed By: xavierd
Differential Revision: D21136575
fbshipit-source-id: d1ac8d92964614005078a6ac76dd0835c29a80a5
Summary:
`scmutil.revsingle` resolves the commit using the revset language layer,
which will trigger auto pull logic. The import helper does not want any
kind of auto pull logic. Therefore use `repo[rev]` instead, which resolves
the commit hash directly and bypasses the revset / auto pull logic.
Reviewed By: singhsrb
Differential Revision: D21196495
fbshipit-source-id: 5a51057a731523bbb643c7e264d6902dcfbb9059
Summary: Move the MutationEntry type to the Mercurial types crate. This will allow us to use it from Mononoke.
Reviewed By: quark-zju
Differential Revision: D20871338
fbshipit-source-id: 8de3bb8a2673673bc4c8a6cc7578a0a76358c14a
Summary:
The part of status that lists what files have changed is called
PendingChanges. This diff introduces the initial stub for PendingChanges. The
pending changes algorithm involves three parts:
1. Looking at files on the filesystem for changes.
2. Looking at files in the dirstate map for changes.
3. Looking at the content for any files that we were unsure of during steps 1
and 2.
This diff puts the basic state machine in place, and accepts the basic
information about the working copy (the root and what type of filesystem it is).
In the future we might have it detect what type of filesystem it is, but for now
this makes it easy.
Reviewed By: xavierd
Differential Revision: D20546898
fbshipit-source-id: a3030b7c846b3cb2fcba805b7fe4744df7c5764e
Summary:
treestate.get_filtered_keys passes directory paths to the filter
function and returns directory matches with a trailing '/' on the end. This
makes it difficult to act as a path normalization function when the caller
doesn't know if the path is a file or directory.
It seems like we can just strip the trailing '/' before exposing the strings to
the caller (both as filter inputs and as get_filtered_keys outputs).
This is useful in the following diff that adds a case normalization crate.
Reviewed By: xavierd
Differential Revision: D20880881
fbshipit-source-id: 6e9f419178b4e278844244bd6aff2fc10e09d2cd
Summary:
This logic will be used in a variety of places (update workers, status,
etc). Let's move it somewhere common.
Reviewed By: xavierd
Differential Revision: D20771623
fbshipit-source-id: b4de7c1d20055a10bbc1143d44c55ea1045ec62a
Summary:
In a later diff we'll need to be able to hand a reference to the
TreeState to the pending changes iterator. We'd like to be able to hand a
Rc<RefCell<TreeState>> but cpython requires that its fields implement Send. The
simplest solution is to use Arc<Mutex<_>>. Once we finish Rustifying all of this
code we can drop the cpython requirement that this work across threads and
downgrade this to a Rc<RefCell<_>>.
Reviewed By: xavierd
Differential Revision: D20546904
fbshipit-source-id: a4a1ce6973f53b3bb95f227616149f98fcd780e0
Summary:
PathAuditor will be needed for native status soon. Let's move it into
the workingcopy crate.
Reviewed By: xavierd
Differential Revision: D20546906
fbshipit-source-id: ef69f88ee828a72e82b5e944cc7913f391bd8a2f
Summary: Update the test to match the latest output.
Reviewed By: xavierd
Differential Revision: D21181146
fbshipit-source-id: 3b6190c9ae8e73309c0b7cb3c48d8a6646bc7fb4
Summary: This will help us debug slow commands
Reviewed By: xavierd
Differential Revision: D21075895
fbshipit-source-id: 3e7667bb0e4426d743841d8fda00fa4a315f0120
Summary:
If a commit operation results in a commit that is already present in the
repository, we must revive the commit, rather than create a new one. In this
case, if obsmarkers are disabled, we can't create a revive marker.
Reviewed By: quark-zju
Differential Revision: D21179879
fbshipit-source-id: 320c70b0ca1e0f384733e09e0e1dd77ac3a255f9
Summary:
Without this change the following code will fail surprisingly:
In [1]: def f():
...: return m
...:
In [2]: f()
NameError: global name 'm' is not defined
Reviewed By: singhsrb
Differential Revision: D21140299
fbshipit-source-id: f0a6509badcd9314a33a5ca0c78a60bb847d63c7
Summary:
Make `ml`, `serv`, `bin`, `hex`, `util` available as they are handy.
Remove less useful names like `e`.
Reviewed By: singhsrb
Differential Revision: D21140300
fbshipit-source-id: ca012da6e33fad64b352c117595538e10d1fad83
Summary:
The Memcache store is voluntarily added to the ContentStore read store, first
as a regular store, and then as a remote one. The regular store is added to
enable the slower remote store to write to it so that blobs are uploaded to
Memcache as we read them from the network. The subtle part of this is that the
HgIdDataStore methods should not do anything, or the data fetched won't be
written to any on-disk store, forcing a refetch next time the blob is needed.
Reviewed By: DurhamG
Differential Revision: D21132669
fbshipit-source-id: 96e963c7bb4209add5a51a5fc48bc38f6bcd2cd9
Summary:
realnewheads removes ancestors from the heads list. It is not needed
if len(heads) <= 1.
This is an optimization that makes the following change a bit faster.
Reviewed By: DurhamG
Differential Revision: D21011402
fbshipit-source-id: 308b4b5b6f2b8d6e053e51e4a10e0fda2ac949db
Summary:
Update tests. They are caused by the use of deprecated command "rollback".
Normally this kind of issues shouldn't happen.
Reviewed By: DurhamG
Differential Revision: D21164084
fbshipit-source-id: 7d847166f999e2bc472bb8276c1ebb66ad7c45c2
Summary:
D17677229 unintentionally changed the remotefilelog repack code to print
messages about the fact that it was doing a repack to stdout instead of
stderr.
This results in garbage messages showing up in the output of commands that are
intended for programmatic consumption, like `HGPLAIN=1 hg status -0mardu`
Reviewed By: DurhamG
Differential Revision: D21149364
fbshipit-source-id: 104d719af35835be098a375f9b9aebcd1f7a6eca
Summary:
The tests are broken on non-fbcode builds because
mysql-connector-python is the old version. We're unable to upgrade
mysql-connector-python on centos 7/8 because yummy is broken. This blocks us
from getting a release.
Let's roll back the mysql-connector-python upgrade for now, until yummy is
fixed.
Reviewed By: singhsrb
Differential Revision: D21162119
fbshipit-source-id: 5d0b266d72274540eca5b9a76bf151a0fbbee059
Summary:
The old pytracing logic walked the stack looking for the most recent
spanid. This was fragile and missed a bunch of spots because the function name
wasn't present in f_globals. Let's make this explicit by tracking the stack of
spanids for each python thread.
Reviewed By: quark-zju
Differential Revision: D21068332
fbshipit-source-id: 98759640fa1081bc5bc0805cc620e35a2de9dae3
Summary: This mitigates loading order issues demonstrated by the previous diff.
Reviewed By: DurhamG
Differential Revision: D21148446
fbshipit-source-id: 40e4861055822b4676f3ac38d0f004b365efe86d
Summary: Demonstrate that bookmark loading order can cause "unknown name" errors.
Reviewed By: DurhamG
Differential Revision: D21148445
fbshipit-source-id: d12417ad150904bda14df47cb6e9fe464f392588
Summary:
When comparing empty file with file with content our xdiff wrongly included
warning about missing newline, which also made the line counter in the hunk
header off-by-one.
Empty files are quite rare in our repos, that's why I discovered this bug only
now (it broke phabricator parsing of this single commit).
Reviewed By: markedson1024
Differential Revision: D21141341
fbshipit-source-id: 9d3e0d8a61ac4ee2cf27978b99b3a092259ee186
Summary:
We don't use ssl to connect to myrouter, and the fact that we even try
causes things to break because we don't have ssl certs.
Reviewed By: sfilipco
Differential Revision: D21139692
fbshipit-source-id: 4a53de929f0114e4307276b8feffcaafebc5d5ce
Summary:
Ideally, either the ContentStore, or the upper layer should verify that we
haven't missed uploading a blob, which could lead to weird behavior down the
line. For now, all the stores will return the keys of the blobs that weren't
uploaded, which allows us to return these keys to Python.
Reviewed By: DurhamG
Differential Revision: D21103998
fbshipit-source-id: 5bab0bbec32244291c65a07aa2a13aec344e715e
Summary:
When a file goes from being a symlink to a regular file, a regular update
action ("g") is used, and the Python code implicitely remove the symlink before
writing to it. In the Rust code, we don't and as a consequence write through
the symlink, not the intended behavior.
An alternative way of fixing this would be to perform an lstat(2) before
writing to a file, but the cost of doing that will be fairly high for a very
unlikely situation especially since the manifest diff can give us exactly this
information.
This whole merge code feels extremely fragile, so I'm definitively not sure if
I got all the places that needs updating :(.
Reviewed By: DurhamG
Differential Revision: D21082733
fbshipit-source-id: 4f36a67363915c9b67d5a0b290a226075a9f1d31
Summary:
We'll be adding more data to the filesystem layer, so let's move this
out of lib.rs.
Also made a slight tweak to expose File metadata in the walk results, which will be used by the future pending changes logic to avoid re-stating the file.
Reviewed By: xavierd
Differential Revision: D20546903
fbshipit-source-id: 70456055b0da601990e6d6ff535678d2df6c50ba
Summary:
Purging treemanifest packfiles always made little sense to me, as the reason we
have tons of them, is because we fetched tons of them. Remove all of them would
just lead to the same situation again. Let's just do a repack instead.
Reviewed By: markbt
Differential Revision: D21065723
fbshipit-source-id: a7cdee1de1d7897481f75c13d8aceeb8c1a68550
Summary:
Now that we've upgraded mysql-connector-python, we can enable these
tests.
Reviewed By: quark-zju
Differential Revision: D21009185
fbshipit-source-id: e9ae62cadcc8d0a291381ab2cfb5c7bc04606d9e
Summary:
Previously, an extension adding the "changeset" pushop might forget to call the
prepushoutgoing hooks, preventing them from being called.
Reviewed By: DurhamG
Differential Revision: D21008487
fbshipit-source-id: a6bc506c7e1695854aca3d3b2cd118ef1c390c52
Summary:
Sometimes due to wrong configuration, branches that are not relevant to the
user become visible. Detect that and provide a way to hide them.
Reviewed By: xavierd
Differential Revision: D21055464
fbshipit-source-id: 19da498a137fdd08e363d6f689b6de31bc884dbd
Summary:
Sometimes due to wrong configuration, cloud sync or legacy pull without
selectivepull will pollute the remote bookmark namespace with too many remote
bookmarks. Detect that and provide a way to reset remotenames to selected
bookmarks.
Reviewed By: xavierd
Differential Revision: D21055466
fbshipit-source-id: f96c6ba79dd8646fa017947e48e80259ed77de67
Summary:
This is rare. But if visibleheads has a broken header, attempt to fix instead
of skipping.
Reviewed By: xavierd
Differential Revision: D21055468
fbshipit-source-id: 8907c84b69eadb50afae1940862db01a926a38f5
Summary: Trigger a `hg pull` if the remote bookmark appears to be lagging.
Reviewed By: xavierd
Differential Revision: D21055465
fbshipit-source-id: e5ea33ca15f50b504368bec0f349a4abe895eee0
Summary:
It was for preventing undocumented configs. Practically it does not achieve the
goal and we might prefer not documenting some of the advanced features to reduce
support burden of unusual configs. Therefore remove it.
We can revisit once we want to improve the documentation of the product.
Reviewed By: xavierd
Differential Revision: D21055469
fbshipit-source-id: 2c26791d2284071b1ac26d1190ec5c4876546f77
Summary:
`obsolete()` alone shouldn't prevent push. Check if a successor in the
destination branch instead.
Reviewed By: DurhamG
Differential Revision: D20911924
fbshipit-source-id: 0f983f3440a5bcff13e1a98b28aac2df80b419e0
Summary:
Change the fork search to always respect GraphQL if possible. This will result
in more deterministic result, and can avoid full changelog scan if the diff
points to public commits.
Reviewed By: DurhamG
Differential Revision: D21045430
fbshipit-source-id: 2e2b13f5aad3670b9018e5c4ce769b330d14531e
Summary:
The local draft scan turns out to be needed by cfgr `jf land` for reasons like
callsign not set (s199694). The whole changelog scan is already slow and will
be slower with segmented changelog so let's log it and see if we can remove it.
Reviewed By: DurhamG
Differential Revision: D21045429
fbshipit-source-id: 999c8479662b3476a09ec852de98cbecebd7f31a
Summary:
The `ui` object is a bit messy - there are repo specific ui, and non-repo ui,
and ui can be copied around.
This diff changes `fout` and `ferr` to an indirect type that can be mutated
globally so the streampager can affect the `fout` and `ferr` of all related `ui`
objects instead of just one single `ui`.
Reviewed By: DurhamG
Differential Revision: D20903568
fbshipit-source-id: b2f139b91a39c20c22261e03ce50f3cc59074291
Summary:
This allows the streampager to be configured via hgrc files.
Default are picked so the behavior is closer to the current default pager
(`less -FRX`).
Reviewed By: DurhamG
Differential Revision: D20902034
fbshipit-source-id: 994ab963ceace02eeb1d18cfa5768e411ca3610b
Summary: This makes it work with chg, since `/dev/tty` is not available for chg.
Reviewed By: DurhamG
Differential Revision: D20936967
fbshipit-source-id: f3ded1aa5552f321ff7043a039f4e35a88160a51
Summary:
The Rust worker code will only work with remotefilelog, and when the Rust
ContentStore is enabled, make sure to not enable it if these 2 conditions
aren't met.
Reviewed By: quark-zju
Differential Revision: D21033428
fbshipit-source-id: c34c1b39ddb81be399463712216fa2cd68771f41
Summary:
Computing delta force the client to have the previous version locally, which it
may not have, forcing a full fetch of the blob, to then compute a delta. Since
delta are a way to save on bandwidth usage, fetching a blob to compute it
negate its benefits.
Reviewed By: DurhamG
Differential Revision: D20999424
fbshipit-source-id: ae958bb71e6a16cfc77f9ccebd82eec00ffda0db
Summary:
We want Mercurial to become more responsible for it's own
configuration, instead of relying on chef and other means. To do so, let's
introduce a new `hg debugdynamicconfig` that can generate dynamic configs for
a given repository based on various states, like what tier it's in or what shard
that machine is in. By default it generates to '.hg/hgrc.dynamic' for the given
repository.
Currently it just sets the hostgroup config.
Future diffs will make Mercurial consume this config, and possibly have Mercurial
call this command asynchronously when it notices the file is out-of-date.
Reviewed By: quark-zju
Differential Revision: D20828132
fbshipit-source-id: 6f5bf749f5b04e0a5989d6dc19ee788c2e47f88f
Summary:
A future diff will want to generate configs programmatically and write
them to a file. Let's add write support to ConfigSet.
Reviewed By: quark-zju
Differential Revision: D20828133
fbshipit-source-id: 702f6f9bdfdf99ef25c6e1c0ab33373a4b6508fe
Summary: D21017515 removed the `since-last-arc-diff` flag; this was the last reference to it in the hg codebase.
Reviewed By: singhsrb
Differential Revision: D21025752
fbshipit-source-id: 083cb821263fa844ec74773d8636e19a6e82c550
Summary:
I noticed we removed the call to getManifestEntry, but didn't remove
the method from the EdenThriftClient.
Reviewed By: singhsrb
Differential Revision: D21025523
fbshipit-source-id: 409eb52bad08b305ecfd0f8918cb71fec6a71aab
Summary:
This flag is an obsolete duplicate of since-last-submit.
Eliminate it to facilitate convenient tab autocompletion and make
the world less complicated.
Reviewed By: xavierd
Differential Revision: D21017515
fbshipit-source-id: f3e4db602a69f1c7da886d455ac36c4a2ddb6b01
Summary:
The revisionstore is a large crate with many dependencies, split out the types part which is most likely to be shared between different pieces of eden/mononoke infrastructure.
With this split it was easy to get eden/mononoke/mercurial/bundles
Reviewed By: farnz
Differential Revision: D20869220
fbshipit-source-id: e9ee4144e7f6250af44802e43221a5b6521d965d
Summary: Since the old Edenfs warning is usually for simply picking up new eden releases, we can suggest the user runs a graceful restart instead of a normal restart to avoid them running into `Transport not connected` errors. This path is only hit in unix environments, so windows users will not see this (since graceful restart isn't supported there yet). Since this is a manual step as well, it will be easier for a user to see if they run into an issue here. This can also enable us to get more telemetry from users running graceful restarts.
Reviewed By: wez
Differential Revision: D20901597
fbshipit-source-id: 9e5c9a90313901be159f66afcbbadc5d7af4fe28
Summary:
Having some colors, even dull is better than no colors. For every "bright"
color found in the repo, also specify their non-bright variant.
Reviewed By: DurhamG
Differential Revision: D20972198
fbshipit-source-id: ca10c0eac13129f120fc45623d134f279a75b3c2
Summary: We're writing utf-8 data to it, decode it before returning it.
Reviewed By: DurhamG
Differential Revision: D20972741
fbshipit-source-id: fb23a6d1c3188e10598b839639cdd5e74322089a
Summary:
While keys are strings, values are bytes buffer and thus needs to be converted
sometimes.
Reviewed By: DurhamG
Differential Revision: D20974484
fbshipit-source-id: 13394f5dc43191e85e4b1d350cc4fbbd8489572a
Summary:
Symlinks are pointers to path, that are required to be utf-8, thus we can
decode the data.
Reviewed By: DurhamG
Differential Revision: D20973701
fbshipit-source-id: 8399dfb3462fea907758a01ed2fcea508833fbaa
Summary:
With the upgraded git, some error message aren't the same as before, update the
test to reflect that.
Reviewed By: quark-zju
Differential Revision: D20993735
fbshipit-source-id: d9b8bfc9c6d10f7c0898299659e4322589ea8077
Summary: `hyperlink(url, title)` returns a terminal escape sequence for the url even if the title provided is empty. While the terminal displays nothing, the actual string in hg-template-land is non-empty (it contains a url), and all the template functions that check for empty strings don't see it as empty.
Reviewed By: fanzeyi, xavierd
Differential Revision: D20970733
fbshipit-source-id: 04436714f3827b98b8fb249b3eb1da82f366807c
Summary: In Python3, str is not a byte string, but a unicode one. Use bytes instead.
Reviewed By: sfilipco
Differential Revision: D20965794
fbshipit-source-id: b04ff004aac87fd3afc8070fc8d1d849ad48d0d3
Summary:
In order to grep, the body of the file is decoded to utf8 with the error
handling "replace". This is probably OK as I would expect histgrep to be used
on text files, not random binary ones where grepping would probably not make a
lot of sense.
Reviewed By: sfilipco
Differential Revision: D20965178
fbshipit-source-id: 9ba234f33e801a78537c22b61dee434625449c01
Summary: The file is already written with writeutf8, read should use readutf8 too.
Reviewed By: sfilipco
Differential Revision: D20949694
fbshipit-source-id: cb00f45313ba8f78197d2344db7adc787b13ee4d
Summary:
Dulwich expects pretty much everything to be bytes, thus we have to convert a
lot of stuff to bytes from unicode. This only fixes one test, but makes
progress on all of them.
Reviewed By: sfilipco
Differential Revision: D20949172
fbshipit-source-id: 44cd0c5136b3d224f7eb81e48ec98fed60c8b390
Summary: The output was added in a recent git release, update the test to reflect that.
Reviewed By: DurhamG
Differential Revision: D20968427
fbshipit-source-id: 7fed6232723151adefe8329d8a98a314f04f222e
Summary: Not sure what fixed them, but now they pass.
Reviewed By: xavierd
Differential Revision: D20933992
fbshipit-source-id: ece47486df17fd5d9303a98bc3b63a429972e73f
Summary:
These classes were used for upstream's treemanifest implementation. At
one point we partially used it for our server side tree logic, but these days we
don't use any of it except for the revlog layer. Let's delete the context and
treemanifest layers and tests.
Reviewed By: sfilipco
Differential Revision: D20953163
fbshipit-source-id: 952063e4e0cf74e2da740bf91a70e1714a9ad9b5
Summary:
Disables 'hg serve' being able to start a web server. This can be
worked around temporarily by setting web.allowhgweb=True, but we should remove
that workaround soon so we can deleted all the code.
Reviewed By: xavierd
Differential Revision: D20951800
fbshipit-source-id: e0d5017647a073b5ede3b0bbc4dd745fabeac816
Summary: The .keys() in Python3 returns an iterator, hence '+' doesn't work on these.
Reviewed By: quark-zju
Differential Revision: D20956491
fbshipit-source-id: 15c74bfcfe6d27dff5018fdf71e61bb747daf2d8
Summary:
The iteritems method doesn't exist in Python3, add the items one and remove the
pycompat.itermitems wherever we iterate over the lazyremotenamedict.
Reviewed By: quark-zju
Differential Revision: D20926027
fbshipit-source-id: de9d297126e8190f008cb5d09cc5a128d68c2213
Summary: The test is less relevant as our entry point is now in Rust (and via bindings).
Reviewed By: xavierd
Differential Revision: D20953331
fbshipit-source-id: 0f80befb761d81389924bee23a683d9fb05d13db
Summary:
Drop other diffhelpers implementations.
The Rust implementation does a better job on type checks and won't segfault.
Reviewed By: xavierd
Differential Revision: D20935367
fbshipit-source-id: f59240f3a661efe1ca6e451922bcb3ca6ee6ae22
Summary:
The diffhelpers.c lacks of type checks and segfaults on Python 3:
(gdb) r --config patch.eol=auto import -d '0 0' -m 'test patch.eol' --bypass ../test.diff --debug --traceback
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7263016 in __strcmp_sse42 () from /lib64/libc.so.6
(gdb) bt
#0 0x00007ffff7263016 in __strcmp_sse42 () from /lib64/libc.so.6
#1 0x00007fffee5e3d3b in testhunk (self=<optimized out>, args=<optimized out>) at edenscm/mercurial/cext/diffhelpers.c:151
Looking at the diffhelpers usage, it seems to be using the `bytes` type
(bytes on Python 2, str on Python 3). Let's implement it in Rust so `rust-cpython`
will complain if the type is not `bytes`.
Reviewed By: xavierd
Differential Revision: D20935366
fbshipit-source-id: 8b474555b52caeab4175d7dad44c4c4e7097e557
Summary:
This largely reverts the changes in D9443604, to make `hg rage` report the
full configs again.
Our configs vary from tier to tier and repository to repository. The override
settings alone don't seem like enough to try and figure out what the actual
settings are that the user is using.
I retained the behavior of reporting the source file and line number for each
config item, which wasn't present before D9443604. I also still excluded
config values from the "builtin" config source. Currently this only excludes
the handful of merge-tools defined in
`eden/scm/edenscmnative/bindings/modules/pyconfigparser/src/lib.rs`
Reviewed By: quark-zju
Differential Revision: D20927599
fbshipit-source-id: 8b5b5bf8b7871b85bd0fe5cd179f16693e4fbb2a