Summary:
Improve `makedirs` error message so it would be more helpful when there are
broken symlinks.
Differential Revision: D8108794
fbshipit-source-id: 08013022642efde946ef9d5c6b06b4763f4ad68f
Summary:
This will be used by the next change testing whether `{files|count}` is
exceeding a threshold for deciding which commit template to use.
Reviewed By: phillco
Differential Revision: D8101518
fbshipit-source-id: 51e918c6d8ab7d6e8b71708d9291945b2a09a632
Summary:
D5521665 added a `{stat}` template that can be used to show lines changes.
That gives more information than a plain template with just filenames, and
could serve as a hint about whether to split a diff or not.
Reviewed By: farnz
Differential Revision: D7960550
fbshipit-source-id: 5cb151b5d7ff72ce6260a7a76f15d7c17bd3bbd4
Summary:
It's super-useful to know the difference between "Accepted (You need to go and click the land button)" and "Accepted (We're just waiting for the land system to do its thing, no work for you right now)"
Alternative approach in D8074898
Reviewed By: mitrandir77
Differential Revision: D8074794
fbshipit-source-id: fdfda64e3a542518b8609e3a415d8cb3156373cf
Summary:
Let's move the sql revisions table writing to a function. In a future
diff we'll reuse this functionality to allow backfilling a database from an
existing repository.
Reviewed By: singhsrb
Differential Revision: D8066524
fbshipit-source-id: 173161d476eab6e35ccd0649494fd8f0f8b3093f
Summary:
Adds a command for deleting trees from history, both in mysql and
locally. This will be useful for recovering from treemanifest corruption.
Reviewed By: singhsrb
Differential Revision: D8066231
fbshipit-source-id: 34a57572c526d99c62d7d4a9e48d60d668065547
Summary:
This splits out the logic in the `fsmonitor` extension that is responsible for
publishing `hg.filemerge` and `hg.update` state changes to Watchman into
its own extension, `hgevents`. This is because we want the behavior of
`hgevents` when Hg is running in Eden, but we do not want the remaining
behavior of `fsmonitor` when Hg is running in Eden, so splitting the logic
into separate extensions is the most straightforward way to achieve that.
To achieve the split, we move some more logic that is common to both
`fsmonitor` and `hgevents` out of `hgext/fsmonitor/__init__.py` and into
`hgext/extlib/watchmanclient/__init__.py`. Then we move these lines
out of `extsetup()` in `fsmonitor` to create `extsetup()` in `hgevents`:
```
extensions.wrapfunction(merge, 'update', wrapupdate)
extensions.wrapfunction(filemerge, '_xmerge', _xmerge)
```
We also have to pull all of the transitive dependencies for this logic
into `hgevents`.
Finally, we also have to define a `reposetup()` function in `hgevents`
that does a subset of what `reposetup()` does in `fsmonitor`. Specifically,
it ensures that a Watchman client is created for a `repo`, as appropriate,
so that it can be used to dispatch state changes to Watchman in
`state_filemerge` and `state_update`.
Note that the utility functions `createclientforrepo()` and
`getclientforrepo()` have been added to ensure that only one
Watchman client is created (and shared) when both `fsmonitor`
and `hgevents` are enabled.
Today, when an Hg repo is created in Eden, we set `extensions.fsmonitor=!`
in the `.hg/hgrc`:
diffusion/FBS/browse/master/fbcode/eden/hooks/hg/post-clone.py$69
Therefore, to get existing repos (both Eden and non-Eden) to pick up
the `hgevents` extension automatically, we add it to the list of
`[extensions]` in `common.rc`:
diffusion/FBS/browse/master/fbcode/scm/hg/fb/staticfiles/etc/mercurial/repo-specific/common.rc$53-60
as this is where `fsmonitor` is configured. We do not enable it in
`scm/hg/fb/staticfiles/etc/mercurial/facebook.rc` because
there is no reason to enable `hgevents` on Hg servers. Therefore, we
also decline to add `hgevents` to the set of `DEFAULT_EXTENSIONS` in
`scm/hg/mercurial/extensions.py`.
Reviewed By: quark-zju
Differential Revision: D8003628
fbshipit-source-id: 4f23881f8c25f4638f5475c292537b0352ae8d15
Summary:
We had a bug where the cache store had a value that didn't correspond
with it's key. Let's add the key to the value so we can ensure they are always
paired correctly.
Reviewed By: phillco
Differential Revision: D8065151
fbshipit-source-id: 01be3a3432d1b4f5e9a234b35b8315c37b1869c3
Summary:
watchman rust client: add tests for arrays of objects
this contains a reproducer test for broken compact arrays in combination with untagged enums
Reviewed By: sunshowers
Differential Revision: D7877495
fbshipit-source-id: 7fc3c05f1590e708a7645f0f9adbfd545e8bae42
Summary:
watchman rust client for mercurial needs
* describe responses and request with strong typing
* supports bser and json protocols
* command line transport and unix socket transport
* socket discovery (env or query command line client)
* read timeouts
Reviewed By: wez
Differential Revision: D7764586
fbshipit-source-id: 1f5725f6ce615e3e6e30395d09b5b37e0c2229d4
Summary:
wjb has seen some weird truncate issues, which is caused by `ftruncate (2)`
returning 1 while its manpage says it returns <= 0. The recent contbuilds
also failed due to this.
While we're waiting for the upstream fix [1], let's workaround it from the
userspace to unblock the contbuild.
[1]: https://www.spinics.net/lists/linux-btrfs/msg78417.html
Reviewed By: DurhamG
Differential Revision: D8064611
fbshipit-source-id: df6c44255de47efa25a4c2b713a159ecd61b7478
Summary: Didn't realize it was possible to land with a failure.
Reviewed By: DurhamG
Differential Revision: D8065037
fbshipit-source-id: abc34efeb4898f2068e57691adb0ddec8a64eabd
Summary: Ran into an ImportError with the old layout.
Reviewed By: quark-zju
Differential Revision: D8061476
fbshipit-source-id: 6fc0b0c3a426e49eb5a43d59e13c69efd19fd453
Summary:
Add a new config section, `[hint-definitions]` that describes additional hint
messages. This can also be used to override built-in hint definitions.
Add a new template function `triggerhint(name)` that triggers the given hint.
Reviewed By: quark-zju
Differential Revision: D8056847
fbshipit-source-id: 5ffc945343133eb635ae0820190ecad9f16bc731
Summary:
Previously if we were pulling between peers, we would not send trees
for public commits, since we assumed the receiving end could fetch them from the
server.
It turns out there are situations where public commits are actually local only
to the client (like when pulling directly from subversion before the server
does), so let's change our heuristic to send trees if they exist in the source
client's local data store.
This also required updating the server side tree pack generation logic to handle
the case when the client sends a base manifest node that the server doesn't know
how to handle. We now ignore those bad base manifests.
Reviewed By: phillco
Differential Revision: D7992502
fbshipit-source-id: 8ddd1836e6f325363ad2bb6eae34ddbbc84c2d11
Summary: This would help labeling interesting commands from callers.
Reviewed By: DurhamG
Differential Revision: D8057148
fbshipit-source-id: 647cc91be3baeaa0362799603a66dab0c6c570b8
Summary:
From the code context, if p2 is `context.overlayworkingctx`, we should avoid
update fsmonitor state.
Reviewed By: phillco, singhsrb
Differential Revision: D8044903
fbshipit-source-id: 82b750cc73a75a2aaa77a630bd73a1a77eedc4e9
Summary:
Previously we would print out all the contents of the file as-is but
this is very user-unfriendly and could produce huge unreadable outputs.
Now we print onyl the first 20 files and label the fields.
Reviewed By: phillco
Differential Revision: D8025914
fbshipit-source-id: c330c34ed4f31c3337bc414cd72c3e43cdd0caf5
Summary:
The crates.io lz4 bindings only support the lz4 framed format, while
our python lz4 library produces custom framed compressed blobs. Let's add a new
wrapper around lz4-sys that handles are special framing. We can migrate to the
standard framing later.
Reviewed By: quark-zju
Differential Revision: D7855502
fbshipit-source-id: 04abb1bc784c6be7f22bcd80645d1b50debc93bd
Summary: we should escape \ as \\ according to the doc
Reviewed By: markbt
Differential Revision: D8024433
fbshipit-source-id: 14fb84741dfbd066d8278146bc6fef0cd76846c6
Summary:
These tests just test the expected outcome when the union data store
is empty.
Reviewed By: quark-zju
Differential Revision: D8018975
fbshipit-source-id: a2cc4c87509b857dbf5f6af506f165ea62080db8
Summary:
This commit derives the common traits for the Key type just as we did
for the Node type in D7872300.
Reviewed By: quark-zju
Differential Revision: D8018973
fbshipit-source-id: 566a69be16d74529c6eb5f157b84de25835f780f
Summary:
We need to implement `quickcheck::Arbitrary` for Key so that it can be
used for the quickcheck tests.
Reviewed By: quark-zju
Differential Revision: D8018977
fbshipit-source-id: dbdbb34fbd7eaeb18321eafec4604d752f496a4d
Summary:
We need to implement `quickcheck::Arbitrary` for Node so that it can
be used for quickcheck tests.
Reviewed By: quark-zju
Differential Revision: D8018978
fbshipit-source-id: ceda99622370bee6e9d05b839f9856c0526f553c
Summary:
I am planning to use the `quickcheck` crate for testing the union data
store. This commit just adds the crate to the revisionstore.
Reviewed By: quark-zju
Differential Revision: D8018974
fbshipit-source-id: d390deeb01aa7d1bf1e66bb5bc948d48bd3f269e
Summary:
This commit just introduces the `UnionDataStore` and implements the
`DataStore` trait for it.
Reviewed By: quark-zju
Differential Revision: D7801615
fbshipit-source-id: 14eabd2aa1b1e085de94aec126a7108231ec6e8d
Summary:
We will be implmenting multiple union stores and therefore, it makes
sense to encapsulate the common logic in its own type. This also abstracts the
usage of `RefCell` within the union store.
Reviewed By: jsgf
Differential Revision: D7884651
fbshipit-source-id: a74b6d9df5ee0d7d04359219e276fd5713b3a00b
Summary:
Based on the review comments for D7801615, this commit adds the common traits
for the `Node` type
Reviewed By: jsgf
Differential Revision: D7872300
fbshipit-source-id: 44dedfc3ec0e18ac0dee0dcfc5f7dfc4aff2511d
Summary:
There is some logic in `hgext/fsmonitor/watchmanclient.py` that needs
to be shared between fsmonitor and the new extension we are trying to
split out of it as part of T29379329.
Reviewed By: quark-zju
Differential Revision: D8003255
fbshipit-source-id: de01c5ba1460d7dde22969980b296afb3a942dd7
Summary:
This is a precursor to splitting the fsmonitor extension, as both
it and the new extension will use pywatchman.
Reviewed By: quark-zju
Differential Revision: D8002713
fbshipit-source-id: 37983fe2898d23223d1178eb3f15685f17ff8868
Summary:
This is regulary not the case if Commit Cloud enabled, if a lot of work is done on one
machine 1, then cloud sync is done on another machine (machine 2), we sync draft not obsolete
heads and all history of obsmarkers, but there is no guarantee we download all
the obsoleted commits to the machine 2.
So, there can be a sequence of obsmarkers from commit A to commit B, when some commit in between hasn't been fetched to the machine 2.
Function obsutil.allsuccessors returns all successors (not only final successors) and it is intentionally do not check presence in the repo.
Reviewed By: DurhamG
Differential Revision: D8009823
fbshipit-source-id: f6b90011acaa518f71a2033eb2b885b27a7f06e7
Summary:
[hg] commit cloud: if option to show requests is on also show the responses
this is useful for investigating issues with Commit Cloud
the option is
```
[commitcloud]
debugrequests = true
```
only works with --debug
Reviewed By: markbt
Differential Revision: D7950549
fbshipit-source-id: ab7f07ad2a61f6bee9c627dfa3d3b43d6380e9cf
Summary:
Adds rust bindings around the existing mpatch c library.
Also fixes a bug in mpatch where it could reference uninitialized memory.
Reviewed By: quark-zju
Differential Revision: D7769299
fbshipit-source-id: bcc21df85c97ef6f5537ebff8fbf1b350ee64fc3
Summary: This change makes all p4 paths lowercase when dealing with the mapping from p4 to hg, thus making the importer work fine with different case paths from Perforce.
Differential Revision: D7978382
fbshipit-source-id: 134705ac27d889e80e5de589ab165e8acfd52346
Summary:
Partially revert D7584511 so buck test failures for `.t` tests would show
the `.t` output change instead of a long, less meaningful environment
variables.
Reviewed By: singhsrb
Differential Revision: D7992713
fbshipit-source-id: 64de5e19589277018e1e37968ea69a2329d67852
Summary:
This adds a test that verifies that if we pull infinitepush commits and
received some normal-public commits as part of that pull, we will only receive
the tree data for the infinitepush commits. The commit cloud team had some
concerns here, since this will be much more common in that future.
Reviewed By: singhsrb
Differential Revision: D7993229
fbshipit-source-id: c91752e0da86a81142503ed97ac104668d1af874
Summary:
Initial implementation of getmissing for a simple Rust pass through
data store. Future diffs will extend this to implement the union data store
completely in Rust.
Reviewed By: quark-zju
Differential Revision: D7632405
fbshipit-source-id: e660d33f8231410805cfaba6d77c56f27b002f8e
Summary:
An initial implementation of getmeta for the Rust hg data store. Future
diffs will add more functionality.
Reviewed By: quark-zju
Differential Revision: D7632404
fbshipit-source-id: 53bd3b96b777bc3c5aef2b4d07ce1a9d9a5a52ed
Summary:
An initial implementation of getdeltachain for a simple pass through
data store. Future diffs will add additional functionality.
Reviewed By: quark-zju
Differential Revision: D7632407
fbshipit-source-id: 1a38089ba8ea70f8772af95afd871ee493082d80
Summary:
Implements the get function for a simple pass through rust data store
layer. Future diffs will implement more functions, and then later we will
implement the entire union data store in Rust.
Reviewed By: quark-zju
Differential Revision: D7632403
fbshipit-source-id: 3a1d0a8500e3110213d70dc1cff637cf8eadd809
Summary:
This will contain all the Python centric hg store code that will let
Python call into the Rust storage layer.
Reviewed By: quark-zju
Differential Revision: D7632406
fbshipit-source-id: 6b7bcc8f47a23e9c0121e1f92de1137369bf584e
Summary:
If a user runs hg pullbackup while their repository doesn't have the
latest commits, it's possible that pullbackups will deliver some public commits
to the user in order to then deliver the necessary draft commits on top. Let's
add a test that verifies the public commits are not delivered with remotefilelog
data.
Reviewed By: quark-zju
Differential Revision: D7927966
fbshipit-source-id: 8661a291c8b3a67359c9975e130f23fec643307d
Summary:
This could be useful for implementing logic like "if this commit is by the
current user, show something differently".
Reviewed By: markbt
Differential Revision: D7964292
fbshipit-source-id: de1ac0b5edde838dbaae646a88ebf636b4925b22
Summary:
commitcloud: do not use filtered set of heads when update infinitepush
state
hg cloud sync command can be interrupted when pulling
some of commits will be pulled, but not written to the commit cloud and
infinitepush states
the next run of cloud sync is smart, it will not pull what has been already pulled in but will fix the
commit cloud state
but because we used the filtered list of heads for infinitepush state, it will not fix the infinitepush
state
So, we shouldn't use the filtered set
Reviewed By: markbt
Differential Revision: D7972200
fbshipit-source-id: 94c01694d4ac77beeed647f77cbdb30fe3f7a404
Summary:
I noticed some tests were running slower without chg. Upon investigation,
`alias hg=...` seems stop working. Similar to D7563731, let's define
functions explicitly instead.
Reviewed By: singhsrb
Differential Revision: D7964291
fbshipit-source-id: 08a69c865ffef6be7e84dd66a7cece9284b94e60