Summary:
`MPath` was created as a type in Mononoke for representing the paths of files and directories. Some of the earliest bonsai use cases of this involved `BonsaiChangesets` where the path was required to be non-root. 5 years ago we made the decision to bake-in this non-root check in the `MPath` type. Even though the type signature doesn't indicate this, `MPath` in its current form represents non-root paths, i.e. anything except just the base directory (`/`). This worked fine for cases which actually needed non-root paths but `MPath` in general have been used much more extensively throughout Mononoke codebase in the past five years. In cases where the path can also be root, we use `Option<MPath>` where the `None` variant represents the root path. In cases where such a path can be optional, we use `Option<Option<MPath>>` and it gets very ugly very quickly from there.
This diff aims to replace the `MPath` type name with `NonRootMPath` to make it more explicit what the type represents. Once landed, I will make `MPath` as a type that can represent any type of path and in particular the root would be represented as an empty vec. Finally, I will replace all occurrences of `Option<NonRootMPath>` with `MPath` wherever its safe to do so (e.g. if `Option<NonRootMPath>` is persisted in storage somewhere in a serialized form, it won't be safe to change the type)
Reviewed By: YousefSalama
Differential Revision: D48950003
fbshipit-source-id: 384e9202987dbbc608e9df378dd56d9d938c4728
Summary: This code was added when EdenAPI was being created. I can't think of any reason why we would want to killswitch all of EdenAPI on all tiers but keep the jobs running, which is the only way we could use this tunable. Let's remove this
Reviewed By: YousefSalama
Differential Revision: D48865059
fbshipit-source-id: c078843eac602d4f252a162ac660d15c195901b6
Summary: Phabricator now provides "commit_hash_best_effort" fields which obviate the need to rummage around in local commit properties. Use it.
Reviewed By: tjfryan
Differential Revision: D48683771
fbshipit-source-id: 5eb1a4a8a40215ed1c268c62ed1dbcd6a828bc3b
Summary:
Long ago, `jf submit` on a commit which didn't have a diff already associated with it, would submit the diff, obtain the diff number, and then metaedit the commit to add the diff number to the commit message.
This led to an odd situation: the commit hash stored in the local commits data in Phabricator did not match the commit the user had checked out. This would trigger the `(local changes)` annotation in `hg ssl`, even though there were none.
This workaround was added to prevent this. It would use mutation data to detect the initial metaedit, and ignore it when deciding to display `(local chnages)`.
Some time later, `jf submit` was changed to obtain the diff number first, metaedit the commit, and then submit the edited version. This means Phabricator now has the correct commit hash. However the workaround remained, which means the first mutation (amend/rebase/metaedit/...) after a user's initial submit does not show as `(local changes)`.
Fix this by removing the workaround. It is no longer needed.
Reviewed By: zzl0
Differential Revision: D48681255
fbshipit-source-id: 2183f5400eb6eb37cf12a562176c1c169d9d3a28
Summary: it's slow to generate the conflicted file via source, dest and base commits, let's just log them
Reviewed By: sggutier
Differential Revision: D48915787
fbshipit-source-id: fd1e153cb1603513cebf6354cbbb81a924db508b
Summary:
Normalize "a/b" reponame to "b" as "remotefilelog.reponame" does not include
slashes. Normalize them for comparison to reduce confusing errors like:
abort: D123 is for repo 'foo/bar.git', not this repo ('bar.git')
Reviewed By: zzl0
Differential Revision: D48908797
fbshipit-source-id: b1022eef4d10d0ba6a81fca08bba0e4dc7f6f31c
Summary:
client side memcache clean up from storage layer
the client side memcache is not used anymore (S351219), we are now ready to remove it from the codebase.
Reviewed By: muirdm
Differential Revision: D48904567
fbshipit-source-id: 822e5eb0cdf1401585a2891a1c3a79527f8db284
Summary:
extract get_merge_ctxs_from_repo() for generating merge data from repo, we will
add another function for generating data from a file
Reviewed By: muirdm
Differential Revision: D48876697
fbshipit-source-id: a322858d7687c30c900a4d7337dda898630bd9f6
Summary:
Written by Martin von Zweigbergk at https://phab.mercurial-scm.org/D11999
I did minor compatibility changes.
Original commit message:
Returning None from simplemerge() means that the caller interprets
it as "no merge was necessary (because two sides matched)". See
6217040b2780 and issue2680 for some background. However,
simplemerge() shouldn't even get called in such scenarios, and
returning None means that the file is not considered merged, even
though the contents actually were. See the affected test cases.
Reviewed By: muirdm
Differential Revision: D48866240
fbshipit-source-id: 175755e7b2fd5ecddea3878c954c4672d5d91b71
Summary: Extracting this to a separate library, so I can extract the graph printing code from newadmin into a separate library in the next diff (D48897709).
Differential Revision: D48896898
fbshipit-source-id: 00874680997ceebd3a3795d5be2e1be0a86ab1e7
Summary:
This diff copies just over the build scripts from the airstore build setup and makes some minor changes to the naming / README in the existing build files.
Now the build built wheels will be WS_Airstore rather than Airstore.
Adding bypass as this doesnt have anything to with OSS github repos
bypass-github-export-checks
Reviewed By: DevidXu
Differential Revision: D48868175
fbshipit-source-id: fbf5cf8e86bd2a310a4c9698158189f9b53adf5c
Summary:
Similar to Python, the Rust pathmather machinery now expands globs within relpath patterns on Windows. This emulates typical shell expansion.
For example, `sl status *.rs` will now work on Windows in that "*.rs" will be expanded to a list of files by us (even though it isn't a glob pattern).
This only impacts the "status" command since it is the only native Rust command that uses the matcher. This behavior change is effectively behind the experimental.rustmatcher flag, which is only enabled in tests.
Reviewed By: zzl0
Differential Revision: D48807328
fbshipit-source-id: ec4f881b53687a2d16236196ed09757175a48a4f
Summary:
We had no limit to the number of uncommitted changes we show.
We should instead truncate the list after 25 files.
At the same time, let's make long lists of files scrollable, with a little fade at the bottom to hint that it's scrollable.
I experimented with having the server only return a subset of uncommitted changes, but the semantics get weird with optimistic state and selecting/deselecting files.
Instead, I think we should be ok with lots of changed files. If the number of changes is extreme (1000+), maybe we should show a top-level error. I don't do that in this diff.
We should also add a button to load more files, or even all files. Since it's scrollable now, I think this is not so bad, and we have already fetched them so it's not even async / there's no loading time.
Reviewed By: quark-zju
Differential Revision: D48812465
fbshipit-source-id: 9cf649d43d54cc4ad8bf9ee241763cb9ce35304e
Summary:
We only send the first 25 files down to the client, so if a commit has more, we don't show them in the UI. We should show a banner explaining that this is happening.
We actually need to do this in a few other places too, this diff starts with just the changed files list.
Reviewed By: quark-zju
Differential Revision: D48812467
fbshipit-source-id: 97fedd25b379124a6547dc24439fd9384cb74b3e
Summary: Add a couple of extra colors for banners, useful to draw more attention to something when necessary
Reviewed By: sggutier
Differential Revision: D48812466
fbshipit-source-id: 88e0b71426dbf89cfbf242218452b7e88fb882be
Summary:
Written by Martin von Zweigbergk at https://phab.mercurial-scm.org/D11981
Original commit message:
_minimize() is weird in that it changes a_lines and b_lines but
leaves base_lines unchanged, which means they'll be
inconsistent. That was fine because the caller never used
base_lines. With the recent refactorings of this code, we can now
make this function cleaner by having it minimize a single conflict and
not care about base_lines.
This also makes the code simpler and makes the code for each
render_*() function more similar.
Reviewed By: quark-zju
Differential Revision: D48866235
fbshipit-source-id: ae3348fd4ea8a3155baa5460f2ade6c28724aa33
Summary:
Written by Martin von Zweigbergk at https://phab.mercurial-scm.org/D11980
Original commit message:
IMO, Merge3Text should be about merging text without knowing about
conflict markers. "Conflict minimization" is about making conflict
markers smaller, so it should be moved out. This patch does that. I'll
refactor it next.
Reviewed By: quark-zju
Differential Revision: D48866238
fbshipit-source-id: 232c9f2e4cdcd519446672e4c0f9805d40a807d4
Summary:
Written by Martin von Zweigbergk at https://phab.mercurial-scm.org/D11979
I did minor compatibility changes.
Original commit message:
render_markers() now always renders minimized 2-way markers, so
let's simplify and rename it accordingly.
Reviewed By: quark-zju
Differential Revision: D48866237
fbshipit-source-id: 79ca3f4016e0cb3a55f78b10d183b10e90c4bf0e
Summary: since we move the automerge logic into `merge_groups()` function, now we can use `basediff` in smerge_benchmark.py. This diff fix the `basediff` and rename it to `render_mergediff2()` (two difffs) since it's similar to `render_mergediff()` (one diff)
Reviewed By: quark-zju
Differential Revision: D48866236
fbshipit-source-id: fdb31428830c7074a07248c62a0faa404bd5859a
Summary:
Written by Martin von Zweigbergk at https://phab.mercurial-scm.org/D11978
I did minor compatibility changes.
Original commit message:
The results in some duplicate, but the code is very straight-forward
and I think it's worth it to have each conflict marker style in a
separate function.
Reviewed By: quark-zju
Differential Revision: D48866239
fbshipit-source-id: 7495e646b865a163338206eabd7a43053eda4083
Summary:
move the automerge logic to merge_groups(), so `mergediff` mode can
benefit from the automerge as well. Besides that, it also make the render_XXX
functions just focusing on conflict rendering.
Reviewed By: quark-zju
Differential Revision: D48845462
fbshipit-source-id: 57e26e200775629fd11e1950228aea9d0e2cc9cd
Summary:
Written by Martin von Zweigbergk at https://phab.mercurial-scm.org/D11977
I did minor compatibility changes.
Original commit message:
I want to remove knowledge of paths from the simplemerge core
module.
Reviewed By: quark-zju
Differential Revision: D48839969
fbshipit-source-id: 3ff6683b1e890552a40f7ab07017028a376c64d0
Summary:
Written by Martin von Zweigbergk at https://phab.mercurial-scm.org/D11976
I did minor compatibility changes.
Original commit message:
The :merge and :merge3 markers used the newline style detected
from the base input. The :mergediff style always used LF as newline
character. This patch teaches :mergediff to use the same detection
as the others did.
Reviewed By: quark-zju
Differential Revision: D48803482
fbshipit-source-id: d381cf6fca8be5336df0fd611e55b07147181ee5
Summary:
Written by Martin von Zweigbergk at https://phab.mercurial-scm.org/D11975
I did compatibility changes. The auto-merge logic is still in the
render_markers() function, will extract that out in the following diffs.
Reviewed By: quark-zju
Differential Revision: D48801200
fbshipit-source-id: 1d8b7d42b5f14d3fa8380bc3ddd3ab4cbff126a7
Summary:
Written by Martin von Zweigbergk at https://phab.mercurial-scm.org/D11974
I did compatibility changes
Original commit message:
IMO, the rendering of a conflict as text with merge markers should be
separate from the code for resolving conflicts. The latter is what
Merge3Text is mostly about already.
Reviewed By: quark-zju
Differential Revision: D48801201
fbshipit-source-id: e6fee2cb20c677ff2c175f2d8382fc757aa0267b
Summary:
Chrono 0.4.27 deprecated `DateTime::from_utc` and we want to keep internal and OSS versions in sync.
https://github.com/chronotope/chrono/releases/tag/v0.4.27
Reviewed By: zertosh
Differential Revision: D48863870
fbshipit-source-id: 490e938758c3f92a67b798d84040098cebb87980