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
Summary:
We need a way for mergedrivers to be able to read ancestor data (to properly detect a backwards merge, such as during `hg backout`).
Passing it directly is tricky since passing a new kwarg to functions without `**args` raises a `TypeError`. We'd have to update the hook framework to catch this `TypeError` and re-run the hook without the kwarg, which would be hard to do cleanly.
Rather, we can just add this as a transient property on `mergestate`, which seems like an appropriate place for it. Any callers trying to read this when it hasn't been set will get an exception. But there aren't any other users of this field since it hasn't existed before.
Reviewed By: quark-zju
Differential Revision: D12827614
fbshipit-source-id: 48dc84f1e60232625c8f2a73e81b5bc223c22bb3
Summary: Ancestors is needed by mergedriver scripts to detect a backout. The first step is to pass them to applyupdates, so it can pass them to mergedriver.
Reviewed By: quark-zju
Differential Revision: D12827615
fbshipit-source-id: 0d92423eeb22d1b42828d61472c87af34e11be4d
Summary: It needs to be Send to be used in cpython.
Reviewed By: ikostia
Differential Revision: D10250289
fbshipit-source-id: ea57e356a0752764e50db9b6872b5cc4a456303f
Summary:
Make it more detailed for public APIs. Hide too detailed information (file
format).
Reviewed By: DurhamG
Differential Revision: D10250140
fbshipit-source-id: d9d9af9d67984b80f07db13e69bbffdf77e6a30e
Summary:
The log module is the "entry point" of other features. Update it so things are
more detailed. I tried to make it more friendly for people without knowledge
about the implementation details.
This could probably be further improved by adding some examples. For now, I'm
focusing on the plain English parts.
To reviewers: Let me know how you feel reading it assuming no prior knowledge
with the implementation. Ways to make sentences shorter, natural to native
speakers without losing important information are also very welcome.
Reviewed By: DurhamG
Differential Revision: D10250141
fbshipit-source-id: 35258c7197c1ce0a1d3d0554fab2f2d2866e123c
Summary:
Make important modules public. Make internal utility (base16) private. Add
some text to the crate-level document. It just refers to important structures.
Will revise document of those structures.
Reviewed By: DurhamG, kulshrax
Differential Revision: D10250143
fbshipit-source-id: c79859ee7d3d9cc4ee9a093ef5d12ec6599f2a42
Summary:
The "fsmonitor returned" file list was made short by D9997658. Do the same
thing for notefiles.
Reviewed By: phillco
Differential Revision: D10865333
fbshipit-source-id: ff31cde04210363e6af04e5578543f1b16310b11
Summary:
If a "normal" file is clean, drop the "NEED_CHECK" bit.
Not very sure how NEED_CHECK can be set for the entire working copy while
`_poststatusfixup` does get executed. But it happened. Fix it by explicitly
removing NEED_CHECK from clean files.
Reviewed By: markbt
Differential Revision: D10865256
fbshipit-source-id: aafd3195a8acf39178bbc2d5f919345a7320f2b7
Summary:
If the NEED_CHECK bit was set accidentally (reason yet to know), there is no
way to recover automatically by running "hg status" without touching the files.
Add a test to show that.
Reviewed By: markbt
Differential Revision: D10865255
fbshipit-source-id: 60b6914a9cd778e60815f83ba98c29c9c5f88b34
Summary:
This got broken by a recent refactoring because `re` resolves
to `re2` rather than the python `re` flavor.
Reviewed By: phillco
Differential Revision: D12834778
fbshipit-source-id: d67fe751593c423ebf12229cc7719585b46b862a
Summary:
This test still fails on OSX because the messages with prefix
`remote:` are missing. It doesn't seem like we need those messages for the
actual testing. Therefore, adding the `-q` option to the affected commands to
remove the `remote:` messages for all the platforms.
Reviewed By: quark-zju
Differential Revision: D12829679
fbshipit-source-id: e53dca96b5511049ef240ed671705987cdd9eab1
Summary:
On Windows the return type of `path_to_local_bytes` is different and requires a
borrow to pass to `PyBytes::new`.
Reviewed By: ikostia
Differential Revision: D12820046
fbshipit-source-id: 166c502598a85c4409f09f44abdf0e45ab45ef67
Summary:
When syncing a commit cloud repo, if the user has put a bookmark on a public
commit that we don't have locally, also pull that public commit into the repo
so that we can put the bookmark on it.
Reviewed By: quark-zju
Differential Revision: D12815471
fbshipit-source-id: 080038e4e239170cad994ff4ab9326d787d1c0fa
Summary:
If you put a bookmarks on a public commit that one of your other synced
repos doesn't have, it will delete the bookmark when it syncs. This deletion
is then propagated to all your other synced repos. This appears to the user
like the bookmark just vanishing.
Reviewed By: quark-zju
Differential Revision: D12815470
fbshipit-source-id: 802f85433b9ad15db3fb9e82e1222224eff4ca88
Summary:
The `VLQEncode` and `VLQDecode` traits erroneously expected the (automatic)
`Sized` marker trait for `Read` and `Write`. This meant they couldn't be used
for trait object `Read`s or `Write`s without jumping through hoops or extra
`mut` keywords.
By not requiring `Sized` we can remove those workarounds.
Reviewed By: quark-zju
Differential Revision: D12816459
fbshipit-source-id: 16353e8fefff5738bd24a9f41c9d7d250aea56fd
Summary:
Suggested by jsgf, use Condvar to emulate the "blocking" behavior so we do not
need to hold MutexGuard for long. This removes most unsafe Rust and also avoids
leaking Mutex even if the Python world forgets to call `release`.
The only remaining "unsafe" is to bypass a rust-cpython API restriction that is
over strict in this use-case.
Reviewed By: markbt
Differential Revision: D11729852
fbshipit-source-id: 9c914f0769e6903e390982c7aa423bb7e3ae2742
Summary: It includes encoding and python path information that could be interesting sometimes.
Reviewed By: markbt
Differential Revision: D12813630
fbshipit-source-id: 679ae45a2df5d710651009cd71c85e31bbe578c2
Summary:
All `hg serve` processes on the server have `hg serve --stdio`, which is not
that useful about what it's doing.
Change it to include wireproto command, ex.
`hg serve (fbsource getfiles client-hostname)`
Reviewed By: markbt
Differential Revision: D10476292
fbshipit-source-id: ce215800d9422995905357d4d5bd79ca5f1d5337
Summary:
Introduce a new template config option `amend.messagetemplate`, which, when
set, is applied to the commit message when amend is run with the `-m` option.
The template is provided with the old message, as `oldmessage` as well as the
message provided on the amend command line, as `message`. This can be
configured so that the amend message only overrides part of the old message.
Reviewed By: quark-zju
Differential Revision: D10857454
fbshipit-source-id: 6eb6f33624fae32fc7a344769e39f5c7a78a3604
Summary:
The `truncate` tool isn't availble on OSX, so include our own in the test
suite.
Reviewed By: DurhamG
Differential Revision: D12815613
fbshipit-source-id: 510b2936f07c5193671baaeaec6620872c3ec982
Summary:
`hg debugcolor --style --color=no` crashes as the list of styles is empty. Just
print nothing in that case.
Reviewed By: quark-zju
Differential Revision: D11910780
fbshipit-source-id: bfc29e7e5190b5fede7950874ac7a88be3435b12
Summary:
Add support for colors specified as hex strings (#rgb or #rrggbb, like in CSS),
rendering them if the terminal supports truecolor mode.
True color support can be detected by the `COLORTERM` environment variable
being set to `truecolor` or `24bit` (currently VTE, Konsole and iTerm2 do this).
It can also be enabled by setting `HGCOLORS=16777216`.
Reviewed By: quark-zju
Differential Revision: D11353291
fbshipit-source-id: 9b30df9c7de3bbaa686bc610addfa529775b73cc
Summary:
Add label annotations to the blame template indicating how old the line is
(bucketed into various ranges). Define colors for these labels so that recent
lines are white, and older lines fade through yellow to black.
Reviewed By: phillco
Differential Revision: D10869068
fbshipit-source-id: 2b99c84c115c3f9e408468f52b5754ff820fcec5
Summary:
Make the space for Phabricator diff numbers larger, and right-justify the
output. This makes it look better.
Reviewed By: phillco
Differential Revision: D10868646
fbshipit-source-id: 7cf50677560a15ef77cc3681063e902d8d9e7a18
Summary:
The directaccess extension could be smarter to avoid walking through public
commits when marking ancestors as visible.
Reported by simpkins.
Reviewed By: DurhamG
Differential Revision: D12814546
fbshipit-source-id: 712db5b77afbb5108b696e1721d15c26c3a51176
Summary:
If the rust pack stores are used to access truncated pack files, currently they
panic. Instead, return a proper error showing what's wrong.
Reviewed By: quark-zju
Differential Revision: D10868299
fbshipit-source-id: 57fe5ec1ee4ee2a7bb10d2d5c5ca7082dc34125d
Summary:
D10516852 added the name of the pack file that was being scanned to the repack
progress bar. Implement this in the Rust repacking code.
Reviewed By: quark-zju
Differential Revision: D10557731
fbshipit-source-id: de2f0cc4a40005422235c3bd19d6a78a38ea44f3
Summary:
The `configlist` function converts a config value to a list of strings.
I have thought about using pest to parse it. However, pest might return errors
(ex. `a,",b` does not parse due to missing end quote), while the original logic
can happily parse everything (`a,",b` gets parsed into `['a', '"', 'b']`).
The code might be simplified to make it more obvious that `unwrap()` cannot
panic. But it handles so many corner cases that I'd like to port as-is for
correctness.
Reviewed By: DurhamG
Differential Revision: D9323743
fbshipit-source-id: 5f8be562b7437260b7551d87d751424558d76e8f
Summary:
This makes tests closer to production setup and removes a bunch of "saved
backup bundle to ..." messages.
With D9236657, this should not hurt server-side performance.
Unfortunately a lot tests cannot be migrated easily, mostly because revision
numbers are used. They are left with a TODO.
Reviewed By: DurhamG
Differential Revision: D9237694
fbshipit-source-id: c993fce18f07aba09f6d70964e248af8d501575a