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
Summary:
I was not aware that `**.c` is a valid glob pattern in hg when writing the
Python fast path.
`**` in glob patterns should disable fast paths because it can match paths with
`/` in them.
Reviewed By: DurhamG
Differential Revision: D12892725
fbshipit-source-id: b26a57dee57f074b3b8acb9dee95bc74103f4285
Summary:
D12811551 removed the mercurial.sparse module. However, actual removal of the
module needs to wait until the changes to the eden dirstate extension get
deployed.
This restores the module until all of the Eden changes have been deployed.
This module only contains a dummy `matcher()` function, which is the only part
of the module that Eden referenced.
This was causing exceptions for users with the a mercurial release from today,
but an Eden release from yesterday. The exception would normally only occur
when using chg, since chg disables lazyimport. Without chg, lazyimport would
allow the import to succeed even though the module does not exist.
Reviewed By: DurhamG
Differential Revision: D12877889
fbshipit-source-id: 2c6afd9bcb7031727b40fd32fbc1ba1356eb6e9b
Summary:
This diff implements getBlob on top of the mercurial rust
datapack code. It adds a C++ binding on top of the rust code to
make it easier to use and hooks it up in the hg backing store.
Need to figure this out for our opensource and windows builds:
* Need to teach them how to build and link the rust code
* need to add a windows version of the methods that accept paths;
this is just a matter of adding a WCHAR version of the functions.
Reviewed By: strager
Differential Revision: D10433450
fbshipit-source-id: 45ce34fb9c383ea6018a0ca858581e0fe11ef3b5
Summary: We'd like to identify which of the three underlying conditions cases this exception.
Reviewed By: quark-zju
Differential Revision: D12870572
fbshipit-source-id: 45724ad6bb3582c04a6ea3c0b7a748bf72219b93
Summary:
D12863838 broke the `test-check-code.t` by using `os.getcwd` instead
of `repo.getcwd`. This commit fixes the same.
Reviewed By: phillco
Differential Revision: D12870782
fbshipit-source-id: 5d9c0af5263fc38ca78526b84aa33a9dd8a6db3d
Summary:
This test is broken after D12849852 because the grep outputs the files
in different order during multiple test runs. Let's fix it by sorting the
output from the command.
Reviewed By: phillco
Differential Revision: D12869810
fbshipit-source-id: 49073e83e926e94db5f0bd290d74845ebfde0bb6
Summary:
This helps to avoid over-fetching of results and addresses
some of the user feedback we've gotten.
This is an imperfect constraint because the mercurial matcher doesn't
appear to have a way to return an equivalent regex to us today.
Reviewed By: quark-zju
Differential Revision: D12863838
fbshipit-source-id: ef963455018f9902453e405a1a998d19f7bcde9d
Summary: This is nicer for the user and makes the test not be flakey.
Reviewed By: quark-zju
Differential Revision: D12860852
fbshipit-source-id: 6ccb0ca679dc25a80730e83a26a39dd3becb5c8f
Summary: This fixes the "hg prev" targetting the first commit in the repo. The problem was the rev `0` which casted to false in all the checks.
Reviewed By: phillco
Differential Revision: D12840237
fbshipit-source-id: 594a2725fa125ee713f347379c875ec54b80a53d
Summary:
This brings the config closer to what we use and uncovers some problems with
disallowemptyupdate itself.
Reviewed By: phillco
Differential Revision: D12840239
fbshipit-source-id: 77740b79114c7d901b0181e0e425aea4e9c7c570
Summary:
Before D10316761, we cannot upgrade both Eden and hg atomically. Therefore
restore the API change so newer hg works with older eden, and newer eden works
with older hg.
Reviewed By: wez
Differential Revision: D12855935
fbshipit-source-id: 448a67ee748e39d33a64f62c702e0c45aea2ecae
Summary:
Previously there are only server-side timeouts. When the server goes wrong, the
client can hang forever. This diff sets the client-side timeout at the Python
socket object.
Reviewed By: phillco
Differential Revision: D12854064
fbshipit-source-id: 71307b305f8e8e936d7d395c76b5e8ef92c6a089
Summary:
a couple of problems:
* The recent move from tweakdefaults also broke `bin` symbol, rendering
this feature completely broken for non svn backed repos
* The `bgr` tool knows about fewer corpuses than we do, so go directly
to the underlying C++ client binary
* Add configuration options for that binary
Reviewed By: phillco, farnz
Differential Revision: D12849852
fbshipit-source-id: 154d4822d097602505349d3f67b45f19c17a7bf8
Summary:
`environ` might be changed by `setenv` and would be wrong to locate `argv[0]`.
Linux >= 3.5 provides the `argv[0]` pointer in `/proc/self/stat`. Let's use
that instead.
Reviewed By: ikostia
Differential Revision: D12834877
fbshipit-source-id: d76804e8f4113cdf3adb0cceed817f7e93d1b6de
Summary: This function is duplicated to `hgext/amend/unamend.py` and is used there but not in the uncommit
Reviewed By: quark-zju
Differential Revision: D10447652
fbshipit-source-id: e6d001ae5f652214c3b1bf3b9f343e7e64874721
Summary:
The recent changes to the progress engine to work around locking bugs removed
the `clear` step of `progress.suspend`. This leads to garbled output when
a progress bar is ongoing. Restore it by adding a new lock method to the
engine.
Also add a `--with-output` option to `hg debugprogress` to test this.
Reviewed By: mitrandir77
Differential Revision: D12838415
fbshipit-source-id: 83ed516b528d0b0bbe37945141d50b50da00ac8e
Summary:
I broke the Windows build because the return type of `path_to_local_bytes` is
different on Windows and Unix, and so must be dealt with differently. They are
different because on Windows we often need to make a copy, whereas on Unix we
can just use references to the byte data. Cows to the rescue: unify them
behind a Cow type.
While we're here, tidy up and unify the docs.
Reviewed By: quark-zju, ikostia
Differential Revision: D12833091
fbshipit-source-id: e02e308e6f81dd3d8ddf33e76c3073f51d3eccc1