Summary:
conduit is going away, phabricator team wants us to stop using
it in hg.
Reviewed By: quark-zju
Differential Revision: D18732257
fbshipit-source-id: c4faf83e36af80fc616e91adede141ba12de5446
Summary: conduit is going away, phabricator team wants us to stop using it in hg
Reviewed By: quark-zju
Differential Revision: D18727399
fbshipit-source-id: c208f5fec5fefd83aa37629b56d2bbaa2532d30e
Summary:
In NFS v4.x, flock ends up inheriting some semantics of fcntl,
including that write locks can only be created against file handles
opened for O_WRONLY or O_RDWR.
This diff changes the mode of 'lockpath' to O_RDWR to solve this.
Reviewed By: simpkins
Differential Revision: D18714734
fbshipit-source-id: 84ba4a6a5de034a4942b1ca3aa8b0c92f882ce38
Summary:
Since bookmarks are stored in svfs, track it in metalog for better transaction
support.
This affects some transaction / rollback behaviors. Since our plan is to remove
`hg rollback` eventually, the compatibility is intentionally broken.
Reviewed By: xavierd
Differential Revision: D18538147
fbshipit-source-id: 6070772a4bce88d3808547207f5df194696b1b52
Summary:
Existing tools (ex. shell complete script) still read from
`.hg/store/{remotenames,bookmarks}`. Be compatible with them by double writing
content to both metalog and filesystem. Metalog is the source of truth for hg.
Reviewed By: xavierd
Differential Revision: D18524106
fbshipit-source-id: c37bc86b7443bba1b65735f29243767650b22ecd
Summary:
Similar to D17199834, by moving 'bookmarks' from localvfs and sharedvfs to
storevfs, we can make it part of metalog and get better transaction support.
Reviewed By: xavierd
Differential Revision: D18524104
fbshipit-source-id: ae148c1f02fc83b5c2d73102ecab39ff223ea5df
Summary:
Right now `bookmarks` is stored at both "local" vfs and the "shared" vfs.
In an upcoming change I'd like to move bookmarks to the "metalog" to get
better transaction. Therefore make it always shared.
The shared bookmark feature is turned on by default. Assuming nobody manually
turns it off, production hosts all have shared bookmark turned on.
Reviewed By: simpkins
Differential Revision: D18524103
fbshipit-source-id: 3160146f357dd01f2d78f5d2f4a14838f8f12a94
Summary:
The only valid place that metalog can be changed is inside a transaction, since
it's transaction.{close,abort} that writes or discards metalog changes.
In other words, metalog should not be changed during A, B, or C:
|<- A ->|<----------- repo lock --------->|
|<- B ->|<- transaction ->|<- C ->|
Add detection for them.
Reviewed By: xavierd
Differential Revision: D18538143
fbshipit-source-id: 036286ed32a897fe3ce0a91c1e3c848cc6167b1d
Summary:
Before this diff, metalog has a same lifetime as repo.svfs and never gets
reloaded or dropped. That is problematic in case external processes also
make changes, ex. running `hg amend` in `histedit exec`.
pid 1> histedit action foo (a single transaction, metalog loaded here)
pid 1> histedit action exec ... (a single transaction)
pid 2> hg amend (changes metalog)
pid 1> histedit action bar (cannot perform this action because metalog has
conflicts!)
This is why test-mutation.t didn't work with metalog.
Fix it by discarding metalog state at transaction/lock boundary (enter/exit).
The next two diffs add checks so we wouldn't discard uncommitted data silently.
Reviewed By: xavierd
Differential Revision: D18519995
fbshipit-source-id: ceb030362d66ad4be142e81accb82a4afa67f305
Summary: This resolves ProgrammingErrors detected by a later change.
Reviewed By: xavierd
Differential Revision: D18538145
fbshipit-source-id: 650e956707af6024457cdc7dabf516d087ad03cd
Summary:
"outstanding merge conflicts" is not a helpful message to inexperienced users.
Print out commands to get more context.
Reviewed By: simpkins
Differential Revision: D18535010
fbshipit-source-id: 035ec9f3d79bf04a997ee907469f2e3d749a1d0e
Summary: Some commits in AOSP have empty fields for author/committer email addresses.
Reviewed By: tchebb
Differential Revision: D18661778
fbshipit-source-id: e975392da677879d598eb9fc77558251a55c2f23
Summary:
Now that the fb-mercurial sources are available in the Eden repository, update
our CMake build files to always build them. This moves the build logic from
the centralized `FBMercurialFeatures.cmake` file into `CMakeLists.txt` files
in the appropriate subdirectories.
Reviewed By: chadaustin
Differential Revision: D18588011
fbshipit-source-id: ded9decde5c2ec766aae0bb0f4f5b021d1044a98
Summary:
D8997967 changed `hg rage` to pull from a path that uses the machine's unix user. But The write in the background backup for commit cloud used `util.shortuser(ui.username())`. This means that in On Demand, it would write to `$LOGDIR/samfu/$REPO$DATE` but `hg rage` would look in `$LOGDIR/svcscm/$REPO$DATE`. Changing this to the same `util.getuser()` should fix this.
Caveat: I didn't actually test this. I just know that my `hg rage` says "log directory does not exist: /tmp/svcscm" (P122851697)
Reviewed By: markbt
Differential Revision: D18654245
fbshipit-source-id: ccb78eba778ddedb23c7947a3eeb16e9f8fd2021
Summary:
This diff replaces eden's dependencies on failure::Error with anyhow::Error.
Failure's error type requires all errors to have an implementation of failure's own failure::Fail trait in order for cause chains and backtraces to work. The necessary methods for this functionality have made their way into the standard library error trait, so modern error libraries build directly on std::error::Error rather than something like failure::Fail. Once we are no longer tied to failure 0.1's Fail trait, different parts of the codebase will be free to use any std::error::Error-based libraries they like while still working nicely together.
Reviewed By: xavierd
Differential Revision: D18576093
fbshipit-source-id: e2d862b659450f2969520d9b74877913fabb2e5d
Summary:
[svcscm@hg022.prn2 /data/scm/www]$ hg log -r master
transaction abort!
rollback completed
abort: File name too long: '/data/scm/www-merge-generaldelta/.hg/store/data/flib/intern/____generated____/_graph_q_l_meerkat_step/flib/intern/entschema/generated/entity/bizapps/dcp__insight/application__config/_ent_d_c_p_insights_application_config_action.php/._g_q_l_g___intern_____set_permission_manager_domain_dcp_insights_application_config_data_____ent_d_c_p_insights_application_config_action____gen_perform_graph_q_l_set_permission_manager_domain_dcp_insights_application_config_mutation_coercer.php.i-U0sMqX~'
On hg022.prn2 www currently failes under certain circumstances because filenames longer than
255 characters are currently created. I traced this back to mktempcopy and made sure that
we truncate filenames when they are created too long.
Reviewed By: quark-zju
Differential Revision: D18639433
fbshipit-source-id: 20e4b086ca5c775b6054b642ecedfb05efd00fb9
Summary: Migrate callsites to use the new pattern matching filtering APIs.
Differential Revision: D18610738
fbshipit-source-id: 242182f4e6a58bbff5dddbb177287921c85519bc
Summary:
Similar to D2756217. But skip sync directly if the repo has been synced
recently.
This will help reducing CPU load on the DB tier.
Reviewed By: ikostia
Differential Revision: D18621013
fbshipit-source-id: 83370669ea61eb693d06495aaa13664648b97aca
Summary:
It seems an emtpy GraphQL query always times out. So let's avoid such queries
from the client side.
Reviewed By: xavierd
Differential Revision: D18626286
fbshipit-source-id: 70f0061f7f7ad8c7d8be4e15fc419039dc07d61e
Summary:
Many people hit TApplicationException recently. Most of them can be fixed
by `eden doctor`. Instead of crashing and showing an unhelpful backtrace, show
a shorter error message and prompt the user to run `eden doctor`.
Reviewed By: fanzeyi
Differential Revision: D18609445
fbshipit-source-id: 5492fa92008cb33e1122b72b48d0858db0d5f994
Summary:
The restackonce function warns about not using it and using `rebase.rebase`
directly, so let's just do that.
Reviewed By: quark-zju
Differential Revision: D18574767
fbshipit-source-id: 56829bccbba7f727867ba2b9bd0a81530ba29bf3
Summary: Eden sets the "portablefilenames" to ignore and the current Mercurial code doesn't consider the setting on Windows, which triggers iterate on the Eden clone. Iterate is an unsupported function on Eden clone.
Reviewed By: quark-zju
Differential Revision: D18195607
fbshipit-source-id: a21e1fcec3ee74398f22eaf56c70116468a45b45
Summary:
The caller already pass in a node, so there is no need to convert the rev
number to a node. This broke `hg next -B`.
Reviewed By: quark-zju
Differential Revision: D18539038
fbshipit-source-id: 44afdd184bc7c949f8efb863702af8a301bbcfb7
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
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
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
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
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
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
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
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
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
Summary:
In preparation for merging fb-mercurial sources to the Eden repository,
move everything from the top-level directory into an `eden/scm`
subdirectory.