Summary:
Previously these were stored on the remotefilelogcontentstore, which is
a weird place since it's generally responsible for loose files. Now that we have
the fileslog abstraction let's move the mutable packs on to it.
This mirrors the manifestlog pattern.
Reviewed By: quark-zju
Differential Revision: D12959496
fbshipit-source-id: 25649570a44b50e9baa558b85ba00605883fd403
Summary:
A future diff will use the same mutable*store pattern to allow pending
file mutable packs to be read from the store. The mutablemanifeststore is
generic and can be reused, so let's move it and rename it.
Reviewed By: quark-zju
Differential Revision: D12959493
fbshipit-source-id: 82710b4d157eb3194440ea630dd458b382896a39
Summary:
Now that all the file store creation logic is inside the fileslog
abstraction, let's also move the storage of all the stores onto this instance,
instead of having them hanging off the repo object.
This matches the manifestlog pattern and gives us better control over the
lifetime of all the filelog stores.
Reviewed By: quark-zju
Differential Revision: D12959500
fbshipit-source-id: f07f8b52bb83a7837e6dc02664bec6111df7a421
Summary:
As part of unifying file storage into fileslog, let's move the store
creation logic into fileslog. It still puts the stores on the repo directly, but
a future diff will come back and fix that so the stores are kept on the fileslog
object.
Reviewed By: quark-zju
Differential Revision: D12959498
fbshipit-source-id: f3defc88b34c74c95bf1604f194b1b5883bad24d
Summary:
We had remotefilelog specific logic in core mercurial code. Now that
we have the fileslog abstraction we can hide remotefilelog specific invalidation
in a remotefilelog specific fileslog implementation.
Reviewed By: quark-zju
Differential Revision: D12959495
fbshipit-source-id: ccf224bf9799eb1af74f0dff6021fcbc2eb20d68
Summary:
In upcoming diffs I want to introduce lifetime management for
structures receiving writes for file content. We need to be able commit these at
the end of a transaction, and roll them back in the event of an abort.
We already have this, but it's adhoc and inconsistent. Let's introduce the
concept of a fileslog on the repository that is responsible for all filelog read
writes. At the moment it doesn't manage reads, and only governs remotefilelog
writes, but we can extend this later.
This pattern of a top level repo.*log property that manages the reading/writing
of a type of object is already used in the manifestlog and has proven to be
relatively clean.
Reviewed By: quark-zju
Differential Revision: D12959494
fbshipit-source-id: 676aa86c313cb7e48512091a9c19b9452e8f114a
Summary:
Previously, remotefilelog tried to hide which store should receive
writes behind the union store abstraction. This is starting to make things a
little complicated though. For instance, it means that right now both local data
and local history are written via one api on the remotefilelogcontentstore, even
though the remotefilelogcontentstore should only be about data. It also means
that remotefilelogcontentstore had to become aware of pack files, which it can't
read, so it no longer upholds the guarantee that anything written to it can be
immediately read. Overall it's just confusing.
This diff rips out the writestore concept, and instead has the store setup logic
store the writable stores directly on the repo, and changes the write path to
write to those stores directly. Thus removing the notion of pack files from
remotefilelogcontentstore.
A future diff will clean this up even further, and fix the bug where you can't
read data that was just written to a local pack.
Reviewed By: quark-zju
Differential Revision: D12959502
fbshipit-source-id: 85c39c0696febd0972a21f22f3640fd6954901c1
Summary:
The "misc" benchmark requires the base16 module to be public. It was made
private in a previous change. Let's make it public again so the benchmark can
run.
Reviewed By: singhsrb
Differential Revision: D13015031
fbshipit-source-id: 0dc1542803aae290de26651e367898eebfc95e83
Summary:
This will help us in identifying commonly conflicted files/artifacts.
Alas, I think SVN only includes one path in the error message. But better than nothing.
Reviewed By: quark-zju
Differential Revision: D13009975
fbshipit-source-id: 220bcaa679222718c58e42174f28fd0bbeb618d2
Summary:
The Rust condition implemenation seems working okay. Therefore drop the support
to switch to buggy `threading.Condition`.
Reviewed By: phillco
Differential Revision: D12875128
fbshipit-source-id: 15f41bdc3fceeaa7de7d8cdbd76ee6d70951c107
Summary: This is the final step to make CAT authentification work
Reviewed By: markbt
Differential Revision: D12975214
fbshipit-source-id: e445ca502f8abaac914140f3f30476d50b3c2fbc
Summary:
To solve friction with OAuth tokens we will support CAT tokens as well in Scm Daemon.
Icebreaker support has been done in D12942971
CATs tokens can be generated on dev servers without user (via the tool based on TLS certs).
So we are going to use them in the next diff.
This will allow us to enable token-less cloud sync for everyone, scm daemon will use CATs.
Reviewed By: markbt
Differential Revision: D12962342
fbshipit-source-id: 173301387ee446622bf77b2d6bed6934b5ced2c3
Summary:
Basically if Unauthorized it will try to access the token again and restart all the subscriptions
rather than trying to reconnect with the same token in infinite loop.
We know OAuth tokens have potential to be invalidated.
CAT token (that we are going to support as well) will always be valid for some time - like 1 day, so we need a smooth way to recover from Unauthorized and issue a fresh token.
Reviewed By: markbt
Differential Revision: D12960843
fbshipit-source-id: 630c446c490b0724df38c61507ee555dc7ed7241
Summary: Jellyfish uses `hg debugcrdump` to get commit data, including binary files. Now we want in jf to be able avoid dumping binary files, so I added `--nobinary` option to crdump
Reviewed By: quark-zju
Differential Revision: D12981968
fbshipit-source-id: 669ef4cf8f6225b911f5085c1a47fb7242f259bf
Summary: This is a backport of my upstream patch https://phab.mercurial-scm.org/D4147
Differential Revision: D12970974
fbshipit-source-id: ed9d8db2e32818e6e5ab3f23f5a0097bfa2cc14e
Summary:
`@@ -1,1 +-1,0 @@` is not a valid patch hunk header.
Change it to `@@ -1,1 +0,0 @@`.
This is a backport of my upstream patch https://phab.mercurial-scm.org/D3737
Reviewed By: singhsrb
Differential Revision: D12970975
fbshipit-source-id: eb769e93076efc932a8c4be7387ba21933aae331
Summary: This has been broken after D12832280.
Reviewed By: quark-zju
Differential Revision: D12981581
fbshipit-source-id: 3f411260e24e623abb6f18814fa5b0bf87b416cd
Summary:
The way I wrote this, `if e.errno != errno.EEXIST or e.errno != errno.EACCES`
this condition never succeeds. So we're re-raising always, rather than falling
back to a `delete/rename` strategy.
Differential Revision: D12974035
fbshipit-source-id: 0b500d009315ba0094019a82576d5a3698b624b2
Summary: Updated the global help summaries that are displayed for each command when you run 'hg help' and fixed corresponding tests
Reviewed By: markbt, kulshrax
Differential Revision: D12832280
fbshipit-source-id: 950dad1c805feab573d7d0182da523ae12299d3b
Summary:
Our `rename` is not atomic:
```
def rename(src, dst):
"""Rename file src to dst, replacing dst if it exists"""
try:
os.rename(src, dst)
except OSError as e:
if e.errno != errno.EEXIST:
raise
unlink(dst)
# What if the process is interrupted here?
os.rename(src, dst)
```
However, the `MoveFileEx` Windows API provides a way to to
replace the existing file, thus eliminating the need to do `unlink`.
Unfortunately, it only works for files, not for dirs, therefore
we're introducing a new file-specific rename function.
Differential Revision: D12940555
fbshipit-source-id: a6749a9b16a285788de0f5c06d51a15c919166ce
Summary:
If the commits being pushrebased don't actually need to be rebased, pushrebase
will accept them like a normal push. In this case we shouldn't prevent them
from be changed to public commits on the client.
Track this by detecting whether we receive a changegroup part from the server.
If we do, only the commits that are marked as replaced with obsmarkers (if
enabled) can be marked as public.
Reviewed By: quark-zju
Differential Revision: D12944851
fbshipit-source-id: 44f8fc17b36397d949cba5d3e787fad813bab4ea
Summary:
When pushrebase is enabled, pushing a commit that doesn't result in any
rebasing action acts like a normal push (the commit is not modifed and a new
hash is not returned), however the phase update doesn't apply, so the commit
remains draft.
Reviewed By: quark-zju
Differential Revision: D12944850
fbshipit-source-id: 2145d9b7eebc27bfdff34544e73802c13f30dbd2
Summary:
The vendored crates were changed by D12811597. Bump `zstd-sys` in `Cargo.toml` to be compatible.
As we're here, also bump rust compiler to 1.30.0 so it's consistent with buck build.
Reviewed By: kulshrax
Differential Revision: D12952552
fbshipit-source-id: 6274bf829b98b16aeb6795209d12aba8b475b46d
Summary:
D12888964 added the capability for `svnrev` revsets to be
interoperable with the `globalrev` revsets. This commit adds the tests for it.
Reviewed By: quark-zju
Differential Revision: D12888960
fbshipit-source-id: 07b12632d534a329c32179e978b058b1e427e688
Summary:
The capturing UI is not required as we can use the much cleaner
`ui.pushbuffer`/`ui.popbuffer` for the intended purpose.
Reviewed By: quark-zju
Differential Revision: D12906912
fbshipit-source-id: ae93e6417135ca23b28a11af63745464344fa3cf
Summary:
This method always prints the graph for the commits in the repository.
This commit adds supports for specifying any revset as input for the log and
also, makes printing the graph optional.
Reviewed By: quark-zju
Differential Revision: D12888965
fbshipit-source-id: 794606fa17f9836fd73675d36d11220b11994f41
Summary: The `svnrev` is more useful than the `rev` in this context.
Reviewed By: quark-zju
Differential Revision: D12888963
fbshipit-source-id: a902c57ecc3bc3eca9da77ab6e14ef58512d5ad8
Summary:
This is required for testing `globalrevs` integration with
`hgsubversion`. In particular, we will test out whether we can resolve
`r<svnrev>/r<globalrev>` correctly later. Seems like this configuration should
be on during all the tests because it is the configuration we use in
production. Therefore, this commit in resolves revset string with prefix `r`
for all the `hgsubversion` tests.
Reviewed By: quark-zju
Differential Revision: D12888961
fbshipit-source-id: af9b2e1aea9771f42fe1fb2d3f9a759a926b1ce3
Summary:
This commit adds support for the `globalrev` and `svnrev` based
revsets to be interoperable. In particular, we want the commands
```
hg log -r "svnrev(<svnrev>/<globalrev>)"
hg log -r "globalrev(<svnrev>/<globalrev>)"
hg log -r "r<svnrev>/r<globalrev>"
hg log -r "m<svnrev>/m<globalrev>"
```
to resolve to a commit with <svnrev> as the corresponding svn revision number
and <globalrev> as the corresponding strictly increasing global revision
number.
Reviewed By: quark-zju
Differential Revision: D12888964
fbshipit-source-id: 1c4e6e2cf3febb5a1d8a476554ad62cc630dc96e
Summary:
After some cleanup and improvements by quark-zju, we only wrap the
`hgsql` extension for embedding `globalrev` in a commit. Therefore, lets remove
the unnecessary verbosity in the code and make it more clear.
Reviewed By: quark-zju
Differential Revision: D12888962
fbshipit-source-id: b1fcebd6ce6c9cdf1c5cb7bb8b3532695f20d32c
Summary:
We need a configuration option for specifying the starting revision
beyond which we will consider the global revisions associated with the commit
valid for the following reasons:
- It lets us have the flexibility to support `globalrevs` from a commit of our
choice.
- We need this configuration to decide when we should fallback to looking at
the `svnrev` instead of the `globalrev`.
Reviewed By: quark-zju
Differential Revision: D12888966
fbshipit-source-id: 46d6314886ed5074edb537ba340d5606ec354619
Summary:
rustc-1.30.0 tries to work out what the linker actually is from the name, and
gets confused because the script we pass it is actually gcc (or clang), but has
`ld` in the name. Update the command-line options to also pass
`-Zlinker-flavor=gcc` to override the linker flavor inference.
proc_macros are now stable. The `quote` crate has a dependency on the `proc_macro`
which is now a shared object as part of the rustc distribution, which means that things
using `quote` must have a runtime linkage with the rustc libraries. The Thrift `codegen`
binary is the main thing affected by this, and I've hacked around it by putting an
`LD_LIBRARY_PATH` in the Buck macros. Need to find a nicer fix though.
rustc 1.30 now implements `#[macro_export(local_inner_macros)]`, which has
strict semantics around namespaces and symbol hygiene, which doesn't work with
common/rust/sql's macros. Work around this for now by just exporting
everything.
Reviewed By: kulshrax
Differential Revision: D12811597
fbshipit-source-id: f18d12e6d99994876c29d3a6bd6ae43f1f37dd17
Summary:
The default feature requires additional environment setup. Since environment
setup cannot be avoided, let's rely on the "environment setup" logic to specify
"with_chg" feature correctly. So "cargo build" without specifying features can
work.
This might fix the Windows CI build.
Reviewed By: DurhamG
Differential Revision: D12948723
fbshipit-source-id: cf2609bccace69cd22a9e4ef4fd2c1fc1bf73338
Summary:
It turns out data packs contain the exact mercurial file blob,
including the rename metadata header. This is different from how loose files work, which
contain the non-headered text and instead store the rename in the history at the
end of the file.
Ideally we'd change datapacks to not store the metadata version of the file, but
unfortunately this is how it has always been, so instead we must change the
commit-straight-to-pack code to write the headered blob.
Differential Revision: D12936247
fbshipit-source-id: 3f909d2964d7f7200ac0e31e47bd195b0c9b03e5
Summary:
Support pluralized translation strings using ngettext.
This allows strings that are appropriately pluralized based on the count of the
item. To use import `_n` from the `i18n` module and provide it with singular
and plural messages, along with the count of the item that should be pluralized:
```
from mercurial.i18n import _n
ui.write(_n("%d item processed", "%d items processed", count) % count)
```
When using `%`-based string formatting in Python, both variants of the format
string must have the same number of subsitutions: it's not possible to leave
out the `%d` in the singular case.
Reviewed By: quark-zju
Differential Revision: D12921684
fbshipit-source-id: 756d1350a827d0451a07279f6884ee57dba6ac9f
Summary:
Discovery excludes extinct (obsoleted without any non-obsolete descendants)
commits from the candidates that can be exchanged. This is unnecessary, and
the user may legitimately want to exchange an extinct commit.
Reviewed By: quark-zju
Differential Revision: D12924522
fbshipit-source-id: 1ea53f2c7bdfd7b4d97c6fbae43ebdcbaf322614
Summary:
This is needed before we start moving builtins into `hg.rust`. The decision
to run or not run a builtin needs to be made before the decision to run or not
run a `chg`.
Reviewed By: quark-zju
Differential Revision: D10859033
fbshipit-source-id: 04018904684fc3c8ca2b927bfb828e40a8d09938
Summary:
In order to be able to run `chg` from the main `hg.rust` binary, we decided
that we will turn it into a static lib. This diff teaches our current build
scripts to do this.
Reviewed By: quark-zju
Differential Revision: D10853906
fbshipit-source-id: 8e0f37aa7e52d4a0610f36d7903eb0a318c193ad
Summary: Log the downloading time spend and the downloading size when hg is using lfs
Reviewed By: ikostia
Differential Revision: D12813953
fbshipit-source-id: adbcb8c508f5d3668b05d5c894cd7e32085a74f0
Summary: Not all of the repos are remotefilellog, so I moved some invocagions of the content store to shallowrepo and added requirements check where the transaction is processsed in localrepo
Reviewed By: quark-zju
Differential Revision: D12881916
fbshipit-source-id: 1119debd1e3d42cdf9513a6cae4bad4c000cc046
Summary:
Based on discussions about the best approach for solving the amend message
problem, back out the template previously added. We will use a different
approach.
Reviewed By: mitrandir77, liubov-dmitrieva
Differential Revision: D12921753
fbshipit-source-id: ca760ffe14bfe473b7526a1b84a8cfc6b0257bf2
Summary:
The `predecessors` and `successors` cover all use cases now, so
`allpredecessors` and `allsuccessors` can be deprecated.
Also de-dup entries in the help text. The addition of the old `precursors`
revset as an alias for `predecessors` makes `predecessors` appear write.
Reviewed By: phillco, mitrandir77
Differential Revision: D12884191
fbshipit-source-id: d87927f498df2296387b4542c4a9b704df334ce3
Summary:
It turns out tracking ignored files does have an impact on status performance.
Filtering out the ignored directories is not that fast, and ignored files can
be scattered everywhere (like ".pyc", ".iml" files) that makes them harder to
be filtered out efficiently.
Add code paths to migrate between "ignored tracked" and "ignore untracked".
Store the metadata in treestate.
Reviewed By: phillco
Differential Revision: D12916021
fbshipit-source-id: e02d0c6f3b1a036f70703c11f35381c594e2f8e5
Summary: This is to replace `debugstate -v`. The latter does ont list untracked files.
Reviewed By: DurhamG
Differential Revision: D12906649
fbshipit-source-id: b84f41dfadff4932c0ddd48480a4aa03db88cab0