Commit Graph

14335 Commits

Author SHA1 Message Date
Stefan Filip
edfeb9f529 treemanifest: remove delta storing of manifest entries when autocreate
Summary:
It is somewhat difficult to fetch the raw entry on the p1 side in the Rust
Manifests. These entries are used to write deltas to revlogs or to datapacks.

Reviewed By: xavierd

Differential Revision: D17143551

fbshipit-source-id: 6624116324664354d199d5f6ac55712c8ed29b9d
2019-09-03 15:08:34 -07:00
Mark Thomas
013aa19333 mutation: don't allow divergence when rebasing
Summary:
In general, mutation tracking doesn't care about divergence.  However, in the
case of rebase, it doesn't make sense to allow divergence to occur if we can
avoid it by omitting some of the commits to rebase.

This makes rebase behaviour more like old obsmarker-based behaviour.  This
breaks a test for mutation copying markers, so update those to use metaedit,
which has the copying behaviour for both obsmarkers and mutation.  At some
point we should make rebase behave better in these cases.

Reviewed By: quark-zju

Differential Revision: D17136480

fbshipit-source-id: 9e465b7fc8bda33e7a746e4df68410713e2be37e
2019-09-02 03:13:51 -07:00
Mark Thomas
ebe5c4ae68 mutation: convert test-amend-nextrebase to mutation and visibility
Summary:
Convert the test case `test-amend-nextrebase` to use new mutation and visibility tracking.

In doing so, reveals a bug where `hg next --rebase` can rebase obsolete commits.

Reviewed By: quark-zju

Differential Revision: D17136483

fbshipit-source-id: dcda88d1e8c1f435d6211cf5b76791c5a76ee343
2019-09-02 03:13:50 -07:00
Mark Thomas
efe45b4a08 amend: add a test for next --rebase with visible predecessors
Summary:
Add a new test for `hg next --rebase` for when a predecessor of the commit
being rebased is also visible.  The predecessor should not be rebased.

Reviewed By: quark-zju

Differential Revision: D17136482

fbshipit-source-id: fa2c91ebc14c72f6a8c13c4549447809090489b3
2019-09-02 03:13:50 -07:00
Xavier Deguillard
4b28370d5e remotefilelog: local loosefiles should always be fully repacked
Summary:
The loosefiles repack was made incremental to greatly reduce the repack time
for users. Since the amount of local loosefiles should be way smaller than the
amount of shared ones, let's always run a full repack on the former. This
should allow us to kill all the local loosefiles, which will help in no longer
supporting them.

Reviewed By: quark-zju

Differential Revision: D17135975

fbshipit-source-id: 9480993b31aa57d0d6e6b7caffd282929183f782
2019-08-30 15:09:25 -07:00
Xavier Deguillard
91462ec10e remotefilelog: add a test to show incremental local data repack
Summary:
This illustrate that the local data repack isn't a full one. Note that the test
is a bit flaky due to 1) the underterministic nature of what folder to repack,
and 2) the choice of folder to repack being done twice (one for data, one for
history). Since I won't land this without the next one, this is probably fine.

Reviewed By: quark-zju

Differential Revision: D17135978

fbshipit-source-id: 641d257d0e308b2bb4d91fdc4c214b22e45b4911
2019-08-30 15:09:25 -07:00
Xavier Deguillard
6e0b6a2161 remotefilelog: Rust repack is the default
Summary:
Rust repack has been the default for a while now. Let's stop pretending we're
going to switch back to the Python repack by removing the config entirely.

Reviewed By: quark-zju

Differential Revision: D17135977

fbshipit-source-id: 5aaa0faa48e2b40a7314d5ab455f5eeaa4e4984d
2019-08-30 15:09:24 -07:00
Jun Wu
b178492317 changelog: disable inline revlog
Summary:
The inline revlog format merges `.i` and `.d` into one `.i` file. It was intended to reduce the
number of files for filelogs. For the changelog one extra file does not hurt.

This makes it easier to write native code parsing the changelog revlog index.

Reviewed By: xavierd

Differential Revision: D17125922

fbshipit-source-id: f48ffe0d2df71abec007a80e05b684dcbac71883
2019-08-30 14:58:02 -07:00
Thomas Orozco
fa4e12df09 wireproto logging: capture getpack
Summary:
ignore-conflict-markers

This updates Mercurial to add a loggetpack option for wire proto logging that
allows capturing getpack responses. This will be useful to verify correctness
for ovrsource on Mononoke (right now, Mononoke isn't serving traffic for hosts
that use getpack).

Reviewed By: StanislavGlebik

Differential Revision: D17091537

fbshipit-source-id: 755a429949d7645010dddab95202c613025f2984
2019-08-30 05:08:18 -07:00
Xavier Deguillard
309229fdf5 remotefilelog: do no build the entire ancestormap in remotefilectx.parents
Summary:
While working on a stack, I noticed that `hg amend -e` would sometimes download
a lot of history information. For a 4 files change, I saw 738 history entry
fetched individually...

Looking at the profile, this pointed towards remotefilectx.parents requesting
the entire ancestormap. Since that function really only need the nodeinfo,
let's only get that.

Reviewed By: DurhamG

Differential Revision: D17104263

fbshipit-source-id: fae1f673b2d2a641ae4f22d1099317cc5abd8447
2019-08-29 09:51:38 -07:00
Jun Wu
a459d31cae testutil/dott: use bindings.commands to run commands
Summary:
This makes it possible to execute Rust commands from the Python tests.

Test changes:
- test-command-template-t: non-utf8 command-line arguments are rejected at the
  function signature level
- test-dispatch-debug-prefix-t: the error is now printed by Rust code, which
  uses spaces instead of tabs.
- test-root-t: the test now passes

Reviewed By: xavierd

Differential Revision: D16866459

fbshipit-source-id: 386931c5497b04c53efc08fbb4de708812517ad9
2019-08-28 19:26:26 -07:00
Jun Wu
c18159134f testutil/dott: set commands.names
Summary:
This gives the Rust code path hints to names of Python command names.

Ideally, the Rust command dispatch logic can just load the Python command table
and figure out it more accurately, and more parts of dispatch.py (ex. extension
loading, debugger, profiler, atexit, etc) are moved to Rust clidispatch or
hgcommands. But that would be a larger change.

Reviewed By: xavierd

Differential Revision: D16866462

fbshipit-source-id: eb993091d5644710686b8f720fd07258b9a5968c
2019-08-28 19:26:26 -07:00
Aleksei Kulikov
33f371d27c snapshot: bugfix - do not miss the metadata in clean merge state
Summary:
So far we missed the metadata if there were no changes in the WC.
A metadata file was created but was not attached to the commit.

Differential Revision: D17070211

fbshipit-source-id: 646c8bceb575f4302ec60e35472cc55de086d7e0
2019-08-28 03:56:13 -07:00
Stefan Filip
4be6f11ab5 localrepo: reorder remove operations so they happen before add
Summary:
The Rust Manifests prevent having both a file and a directory with the same
name. This is a problem for the localrepo commit logic which will first add
the new entry, be that file or directory, and then remove the old one.

Reviewed By: quark-zju

Differential Revision: D16775350

fbshipit-source-id: 4515e42f9d2b1b2bc4861c16a39d291225cddc2a
2019-08-26 10:48:08 -07:00
Stefan Filip
98b32be924 manifest: remove the dirs function from the manifest
Summary:
There is no custom implementation for manfiest.dirs(). Generally speaking
the custom implementation is a good thing but doing the migration in the
current python codebase doesn't seem worth while at the moment.

Reviewed By: quark-zju

Differential Revision: D16775351

fbshipit-source-id: c428860d21088a50a0f754dc20d6ee224d2eae32
2019-08-26 10:48:07 -07:00
Jun Wu
a6ad29eadf phase: use commit hash internally
Summary: This removes a false positive detection of "revision number" usage.

Reviewed By: singhsrb

Differential Revision: D16955290

fbshipit-source-id: 5d8762c21b0ceb9b7576f220e0d177db3918abc1
2019-08-22 13:00:13 -07:00
Jun Wu
17f66b3e1f smartlog: avoid false positive detection of revnum usage
Summary:
If `smartlog()` is the user input, the revnum detection is enabled for the
whole scope of smartlog revset implemenation. The use of rev numbers triggers
the warning. But the user didn't use any rev number.

Change smartlog to disable the revnum detection for its internal calculation.
Carefully choose the scope so `smartlog(1+2)` will still be warned.

Reviewed By: singhsrb

Differential Revision: D16954997

fbshipit-source-id: 1a3d32c1c2bcba08bfac908623b6416cf1cd63a8
2019-08-22 13:00:12 -07:00
Aleksei Kulikov
88ba91d3dc snapshot: add negative tests of broken metadata
Reviewed By: markbt

Differential Revision: D16961999

fbshipit-source-id: 730766962fab1ed94bfa8991256ac963a78cf4c0
2019-08-22 09:32:04 -07:00
Aleksei Kulikov
b8088a8a9e snapshot: rename commands to non-debug ones
Summary:
Instead of `debugsnapshot` and `debugcheckoutsnapshot` we will use
`snapshot create|checkout`.

Reviewed By: markbt

Differential Revision: D16961037

fbshipit-source-id: 142d072672376c2ce6a248a4dceffdd94d56a4df
2019-08-22 09:32:04 -07:00
Aleksei Kulikov
216bd69c29 snapshot: add version info to snapshot metadata
Reviewed By: markbt

Differential Revision: D16941087

fbshipit-source-id: 10d1857060dafcda2005a14d731758a2221ad7fd
2019-08-22 09:32:04 -07:00
Jun Wu
adbe2b2b32 alias: ignore alias definitions with ":" in name
Summary:
Aliases with `:doc` in name are not real commands. Do not treat them as
commands.

The upstream patch https://phab.mercurial-scm.org/D5087 added other metadata
including `:help` and `:category`. We might end up having some in the future
so I blacklisted names with `:` in them, not just `:doc`.

Reviewed By: chadaustin

Differential Revision: D16955596

fbshipit-source-id: b6f3e1129b632e0ba43c800e7e6fdd2b52d3b40c
2019-08-21 21:13:38 -07:00
Jun Wu
b6101a12e0 clidispatch: rework error handling
Summary:
Change error type in clidispatch from `DispatchError` to `failure::Error`.

Pros:
- `failure` will attach a backtrace for free. (otherwise, backtrace handling is
  manual)
- Wrapping other errors (ex. `io::Error`, `cliparser::Error`) is optional.
  (otherwise, wrapping other errors is mandatory, and needs to be careful to
  not lose information)

Cons:
- No longer able to enumerate *all* possible error types. (but can still
  downcast to specific errors)

This seems to be a good tradeoff especially because of the backtrace handling - I
ran into a few issues where the location where the error happened really helped
debugging.

Since we can no longer enumerate all possible error types, the enum was changed
to individual structs to make the code shorter (ex. the struct can be downcasted
directly, instead of down-casting to the enum, then matching its variant).

The `HighLevelError` handling was simplified and moved to `hgmain`.

The new code path falls back to Python less aggressively, therefore some behaviors
were tweaked (ex. `-R` takes a bundle path).

Reviewed By: sfilipco

Differential Revision: D16796400

fbshipit-source-id: 1b17eb8d62503644b118c6b799778182bf222538
2019-08-21 12:59:28 -07:00
Jun Wu
0bc2824c82 clidispatch: make use of HgGlobalOpts
Summary: Convert global flags to `HgGlobalOpts` struct to make code shorter.

Reviewed By: sfilipco

Differential Revision: D16796407

fbshipit-source-id: b9d4c3dbec68c81908d439da4c353249347ca74a
2019-08-21 12:16:36 -07:00
Jun Wu
210bf49f5e clidispatch: replace Dispatcher with CommandTable
Summary:
The `Dispatcher` provides lots of features but its internal state only contains
the command table. Replace it with `CommandTable` and make the methods free
functions.

This makes function dependencies more cleaner, for example things like "locating
a repo", "getting the args" etc. won't require a `Dispatcher`.

A side effect of this change is the non-utf8 command line arguments are no longer
supported. This is already broken since our hg wrapper (accidentally) enforced
utf-8 command line. Therefore related tests are removed.

Reviewed By: sfilipco

Differential Revision: D16796395

fbshipit-source-id: a793ce7b8befe7caf62405c582fc932eb3daa099
2019-08-21 12:16:35 -07:00
Aleksei Kulikov
e8c5b4830f snapshot: rename manifest to metadata
Summary: Snapshot `metadata` won't be confused with regular commit manifest.

Reviewed By: markbt

Differential Revision: D16929553

fbshipit-source-id: 466b167aa1cc30f137e0c0b4601d70876509e03c
2019-08-21 10:36:34 -07:00
Aleksei Kulikov
71a0402c8a snapshot: fix dirstate behavior during snapshot checkout
Summary:
At first, that aim was to create a good and consistent test plan of snapshots:
```
# Snapshot test plan:
# 1) Empty snapshot (no changes);
# 2) Snapshot with an empty manifest (changes only in tracked files);
# 3) Snapshot with a manifest (merge state + mixed changes);
# 4) Same as 3 but test the --clean flag on creation;
# 5) Same as 3 but test the --force flag on restore.
```
Then I discovered some bugs while writing the tests.
1) In case of an empty manifest the `snapshotmanifestid` extra should be an empty string, not `None`.
This is because of the extra serialization rules.
2) The initial approach for doing the checkout did some unnecessary operations with dirstate,
which required it to rollback later.
Now the overhead is gone, and the strategy of checking out is as follows:
```
1. Regular hg update to the (1st) parent of the snapshot;
2. Apply all the changes via mergemod.update without pushing it to the dirstate;
3. Register these changes in the dirstate;
4. Tie the second snapshot parent to the working context, if it exists.

Reviewed By: markbt

Differential Revision: D16929417

fbshipit-source-id: 0319ac0e81f80956cdef5b2a696b642cc782f48d
2019-08-21 10:36:34 -07:00
Aleksei Kulikov
c9be937325 snapshot: remove --hidden flag when expicitly accessing snapshots
Summary: Snapshots have invisible commits underneath them, so that flag is redundant.

Reviewed By: markbt

Differential Revision: D16916268

fbshipit-source-id: 294f34af5aa7942be0bb2b58f0dc65979d593157
2019-08-21 10:36:34 -07:00
Aleksei Kulikov
2401518de9 snapshot: bugfix - make files missing instead of removed on checkout
Summary: Due to a bug the missing files from the snapshot manifest were marked as removed after checkout.

Reviewed By: markbt

Differential Revision: D16831796

fbshipit-source-id: 200ccf34b16392a73d38294f1fcb43bfa9a94690
2019-08-21 10:36:33 -07:00
Aleksei Kulikov
8cebfd9c65 snapshot: add --clean option to snapshot cmd
Summary:
It cleans the working copy, equivalent of `hg checkout --clean && hg
purge`.

Reviewed By: markbt

Differential Revision: D16831349

fbshipit-source-id: d765f2f36f561786ec57bc1e54fdf81695f1e7e0
2019-08-21 10:36:33 -07:00
Jun Wu
b6ab106a37 revset: detect revision numbers optimized in _list revset
Summary:
A revset optimization pass rewrites revsets like 1+2+3 to use the `_list`
revset function that has a fast path to bypass the `stringset` function.
Change `_list` to detect revision numbers too.

Reviewed By: singhsrb

Differential Revision: D16910791

fbshipit-source-id: 51036b7d6f16b5388bbaf996864946df91a9f093
2019-08-20 17:21:10 -07:00
Mark Thomas
540f1f0828 amend: use commit hashes rather than revision numbers for moverelative
Summary:
Use of revision number is being deprecated.  Change the moverelative commands
(`next`, `previous`, ...) to use nodes internally.

Reviewed By: mitrandir77

Differential Revision: D16898856

fbshipit-source-id: 71f6fc32776e2912795f086d11897d36b942b608
2019-08-20 11:45:23 -07:00
Jun Wu
36f974ebae clidispatch: register commands without CommandDefinition
Summary:
Previously, the command table state in `Dispatcher` is confusing:

    command_table: BTreeMap<String, CommandFunc>,
    commands: BTreeMap<String, CommandDefinition>,

Question: In what case do these BTreeMaps have different keys?

It does not make much sense. Therefore merge `CommandFunc` into
`CommandDefinition`, and remove the `command_table` field.

This affects the `register` API:

		fn register(&mut self, command: CommandDefinition, f: FN)

`f` is part of `CommandFunc`, which duplicates with `CommandDefinition`.

`CommandDefinition` contains 3 things: name, doc, and flags.

In the new `define_flags!` world, `flags` can be inferred from the type
of the function, so only `name` and `doc` are needed. Therefore change
the register function to:

		fn register(&mut self, f: FN, name: &str, doc: &str)

Update `hgcommands` to use the newer APIs. Commands can now be registered
without going through `CommandDefinition` explicitly.

Reviewed By: sfilipco

Differential Revision: D16733275

fbshipit-source-id: 68e404a5b271b72aad52f640123b1c083f31d76c
2019-08-19 19:27:31 -07:00
Jun Wu
ec304e1d1e commands: assign 'd' alias to 'diff'
Summary:
Git does not have command name prefix matching. We now use `commands.names`
config options as a hint to avoid going to the Python land for command
prefix matching. It works but is not "correct". If we drop the prefix matching
feature, then the problems are gone - fast paths won't need prefix matching
aka. the command name list, and slow path (ex. wrong command) can afford
loading Python for all command names.

`hg d` is the single most used prefix matching command. Assign an explicit
alias to it to avoid regression if we do drop prefix matching (or, make
that more expensive than resolving commands direcly).

Reviewed By: sfilipco

Differential Revision: D16733274

fbshipit-source-id: 8904288b8a1ddf1fc6e6ec54ffaa36e503ebdb77
2019-08-19 19:27:29 -07:00
Jun Wu
d0cf5aacfa dispatch: remove Python alias handling
Summary:
This removes Python alias handling so the alias handling is done entirely in
Rust.

There are some subtle changes - alias using prefix mathcing to ambiguous
commands will not show other aliases. Hopefully that won't be a big issue.
Users can always avoid prefix matching in alias to solve the issue.

Reviewed By: sfilipco

Differential Revision: D16733270

fbshipit-source-id: 54a4915d49c2b2f6e8664a225a9c0f25e1c38d17
2019-08-19 19:27:29 -07:00
Jun Wu
42e4cc19fc test-lfs-test-server: disable the test
Summary:
This test is currently broken if lfs-test-server is installed. Disable it
instead of relying on the test system does not have lfs-test-server.

Reviewed By: sfilipco

Differential Revision: D16733271

fbshipit-source-id: de0c9beb8e981e33e32e43435e2d06181cbae70e
2019-08-19 19:27:29 -07:00
Jun Wu
2f3cf9b23b dispatch: do not show help on UnknownCommand
Summary:
Similar to D14151200, instead of printing a long help that might flush out
important messages, make the error short but still point the user to `hg help`.

This makes the error message much shorter, and make the test change by the
upcoming diff smaller.

Besides, we no longer check disabled extensions, as we don't expect users to
tweak extension config by themselves.

Reviewed By: sfilipco

Differential Revision: D16733273

fbshipit-source-id: b39bd4b2af6f315273484ec582094609b8e331ae
2019-08-19 19:27:28 -07:00
Jun Wu
37b7928dc8 help: resolve aliases using Rust
Summary:
Resolve aliases directly in command help. This removes the dependency of the
Python alias handling.

There are some minor behavior changes. But they look reasonable.

Reviewed By: sfilipco

Differential Revision: D16733276

fbshipit-source-id: ad97def2c60828236bbd8784ffd8202abfdeeb15
2019-08-19 19:27:28 -07:00
Jun Wu
38a0a8ff95 dispatch: translate shell aliases to hg commands
Summary:
Translate alias like `echo = !echo foo` to `echo = debugrunshell '--cmd=echo
foo'`.  This enables the Rust shell alias handling code path. The Python
shell alias handling was removed.

The majority part of `test-alias.t` still passes. That includes some "weird"
shell alias features.

This has some test changes, through:

- `$HG_ARGS` is no longer supported. And tests depending on it are changed.
  `$@` will be the alternative for most cases.
  Practically, our `$HG_ARGS` users seem to come from
  https://stackoverflow.com/a/833387, which does not seem to use `$HG_ARGS`
  correctly (since `$HG_ARGS` includes the command name).
- Early-parse commands (ex. `hg log -b '--config=alias.log=!echo
  howdy'`) no longer works.
- The warning `--repository ignored` now shows up, since `debugrunshell`
  is a "no-repo" command.
- Global flags can no longer be used after shell aliases. Supporting them
  is a head-ache.
- `circular alias` error message changed because it's now reported by the Rust
  code, which does not report all alias names right now.

Reviewed By: sfilipco

Differential Revision: D16733266

fbshipit-source-id: b06bc7f8fc2f1c2701a17407d6a1656e17e4ba55
2019-08-19 19:27:28 -07:00
Jun Wu
53e9fbd706 test-alias: make shell alias tests easier to read
Summary:
The shell alias tests are hard to read because:

- It uses `cat << EOF`, which will escape the heredoc block.
- It uses `sh -c`, which adds another layer.

Change `EOF` to `'EOF'` to prevent escaping heredoc, and remove `sh -c` to make
the test easier to read. The `escaped3` test now works as expected.

Reviewed By: sfilipco

Differential Revision: D16819451

fbshipit-source-id: 687e9ce78dfed7d76b53cf90e6d871dffd3ab84d
2019-08-19 19:27:28 -07:00
Jun Wu
399556389a commands: add a way to run shell commands
Summary: This will make shell aliases fit in the normal hg command framework.

Reviewed By: sfilipco

Differential Revision: D16530521

fbshipit-source-id: c1b158bc2895add03fa92099564830e55e02f1b7
2019-08-19 19:27:27 -07:00
Stefan Filip
c527354cc8 help: fix test-check-help.t to recognize fold
Summary:
The latest update in the documentation references the `hg fold` subcommand
from the "core" mercurial files. This makes the `test-check-help.t` test
want to verify the `help` for `fold`. The problem is that the test does not
enable the `amend` extension that provides the fold command.

Following a previous fix to this test, I am enabling the amend extension for
the test. It makes sense to me given the current setup.

Reviewed By: singhsrb

Differential Revision: D16907781

fbshipit-source-id: b0ba31518b6d4c210eb5b8cc7985a945ab1180e4
2019-08-19 16:59:05 -07:00
Saurabh Singh
76b785da63 hgsubversion: fix the tests
Summary:
Essentially the commit hashes changed and thats fine. See D16836997
for more context.

Reviewed By: quark-zju

Differential Revision: D16860590

fbshipit-source-id: ddd82dfbcdfbea9d5ace68adaedeb05bda6e3d7a
2019-08-16 13:27:04 -07:00
Mark Thomas
43bc04968a commitcloud: backup and sync all non-public commits
Summary:
Commit cloud and infinitepush currently only back up draft commits, omitting
secret ones.  However, commit cloud sync with visibility enabled will try to
sync all visible commits, including the secret ones.  This means users with
secret commits won't be able to sync them to their other machines as they won't
have been backed up.

We eventually want to get rid of the secret phase, which means all non-public
commits should be synced.  Update commit cloud to backup and sync all
non-public commits, including secret ones.

Currently secret commits become draft when they are received by the other
machine.  Since we're planning to get rid of the secret phase, this should be
fine.

Reviewed By: mitrandir77

Differential Revision: D16830832

fbshipit-source-id: 2ce4447ffa750a2edcb194cdf92321c1393ff805
2019-08-16 10:24:44 -07:00
Aleksei Kulikov
0f11c07409 snapshot: fix windows tests and make hashes deterministic
Summary:
So far the hashes of manifest/commits may vary, mostly because of
different path separators on different platforms (`/` vs `\\`) and its serialization to string in the snapshot manifest.

Reviewed By: markbt

Differential Revision: D16856130

fbshipit-source-id: a19dff113b9b24f1c7f387b9bc5a5e39e83ef8af
2019-08-16 10:15:05 -07:00
Shu-Ting Tseng
150798aac8 translate from hg to git hash should use the extras
Summary:
Now that we are writing the git hash inside the commit itself, if we are translating
from hg to git hash, we should just use that rather than loading the entire map and
build a dict and look it up.

The performance of this translation will also improve quite a lot.

Some small sample benchmarking:

```
suiting@devvm5006:configerator  (659199b|remote/master)$ time ~/fbcode/scm/hg/hg log -r master -T '{node} || {gitnode}\n' --config exte
nsions.fbconduit=! --config extensions.hggit=
659199bf7c7850ea9ffa9e0ad50eb84597977dea || 69f05aeec13f09c44dd00d2a85fe9d461ba6841e

real    0m0.563s
user    0m0.004s
sys     0m0.007s
suiting@devvm5006:configerator  (659199b|remote/master)$ time ~/fbcode/scm/hg/hg log -r master -T '{node} || {gitnode}\n'
659199bf7c7850ea9ffa9e0ad50eb84597977dea || 69f05aeec13f09c44dd00d2a85fe9d461ba6841e

real    0m14.706s
user    0m0.006s
sys     0m0.006s
```

Reviewed By: quark-zju

Differential Revision: D16833526

fbshipit-source-id: 7d3096649cf24967d13596e70463bc125081ba4f
2019-08-16 07:09:31 -07:00
Carolyn Busch
09ceebfcac Debugstore command
Summary: New degbugstore command prints contents of blob in store give filenname and hash.

Reviewed By: xavierd

Differential Revision: D16791780

fbshipit-source-id: d4529f3f368677b4f65a5772f82a1655552fefa5
2019-08-15 19:36:31 -07:00
Xavier Deguillard
8a27f4d915 tests: fix hgsubversion tests
Summary:
Since D16681230, a commit made with no file changes will re-use it's parent
manifest. This can trigger the commit hash to be different, which broke some
subversion tests. Since hgsubversion will be going away soon, I took the
approach of using run-tests.py -i and in test-hgsubversion-custom-layout.py to
not run the test that fails.

Reviewed By: sfilipco

Differential Revision: D16836997

fbshipit-source-id: 58e50a9147c8c263fca74158af120ec8ec5d8c52
2019-08-15 15:47:49 -07:00
Jun Wu
8b4c670550 changelog: get access to config options
Summary: Pass `uiconfig` to changelog so it can read config options.

Reviewed By: sfilipco

Differential Revision: D16683785

fbshipit-source-id: a64cfbe2cefa6b20ec695d2766bcfe878c764323
2019-08-15 12:47:35 -07:00
Jun Wu
6d7c287ab2 ui: split config handling to a separate class
Summary:
A large portion of `ui` is config handling. Split it to a separate class so we
can pass that separate class to places that need pure configuration.

Some `develwarn`s are skipped since the new class does not have access to fout
or ferr.

Reviewed By: DurhamG

Differential Revision: D16683787

fbshipit-source-id: d823b9e5fc6f8ed08fff3401ab3502ad3c434f00
2019-08-15 12:47:35 -07:00
Adam Simpkins
ce3bf61c80 fix copyright headers in a few files
Summary: Fix copyright headers to pass our lint rules.

Reviewed By: xavierd

Differential Revision: D16824227

fbshipit-source-id: f9bc74f42e2c9d5c112f527eec479da9e1ce56fb
2019-08-15 11:33:07 -07:00
Aleksei Kulikov
ad771fcaec snapshot: minor codestyle fixes
Summary: Minor changes.

Reviewed By: mitrandir77

Differential Revision: D16829944

fbshipit-source-id: 08876408bab9a367b852e85e1d7ca86dc0da08a3
2019-08-15 10:48:42 -07:00
Aleksei Kulikov
97c6c6ddaf snapshot: add debugcheckoutsnapshot command
Summary:
Allow the user to check out on the snapshot by its revision id.
Snapshot == "a commit with extra containing a key `snapshotmanifestid`".
This corresponding value can be `None`, that would mean that snapshot does not contain untracked/missing/merge files.

Reviewed By: mitrandir77

Differential Revision: D16788479

fbshipit-source-id: bf4a9508acc940290b18123d3dd7b7fefae83782
2019-08-15 10:48:41 -07:00
Aleksei Kulikov
b45ba7a551 snapshot: add --force option to manifest checkout
Summary:
Now `hg debugcheckoutsnapshotmanifest` overwrites files if given the `--force` flag.
It also gives a more detailed output on the changes it makes.

Reviewed By: mitrandir77

Differential Revision: D16786334

fbshipit-source-id: b41d6241ffb478bd6c30a01c154b095d1ea92d78
2019-08-15 10:48:41 -07:00
Aleksei Kulikov
169465460a snapshot: add debugsnapshot command
Summary:
Add the `debugsnapshot` command, which will be renamed to `snapshot` later.

It creates a snapshot manifest that features information about
* untracked files,
* missing files,
* merge state artifacts from `.hg/merge` and `.hg/rebasestate`.
The snapshot manifest is stored in local lfs.

Then it creates the actual snapshot -- a fake commit, which has the snapshot oid in extra data.
It does not handle unresolved merge conflicts and other difficult states on this stage.

~~Finally, it restores the working copy and dirstate to status quo.~~
It doesn't need to be done, now we create only the commitctx, which does not wreck the dirstate.

Reviewed By: mitrandir77

Differential Revision: D16716359

fbshipit-source-id: 743f7427ce89c3fca6f844487bac1c456338e613
2019-08-15 10:48:41 -07:00
Mohammad Ayoub
075801c976 sync checkout locations on update
Summary:
Whenever a checkout is done, the new commit is sent to commitcloud.
This currently works with the hook on update, but the hooks on commit are not working

Reviewed By: mitrandir77

Differential Revision: D16687423

fbshipit-source-id: a0b861d301c84764f31787454cdec594b0519fa3
2019-08-15 08:37:14 -07:00
Stefan Filip
85d53547a3 remove: fix root path ("") exception handling
Summary:
Remove has special handling for the root path which wasn't updated when we
updated the root path representation from "." to "".

Reviewed By: singhsrb

Differential Revision: D16794418

fbshipit-source-id: bb769ce67128041c01010fa2d256c1db5091c564
2019-08-13 18:53:11 -07:00
Xavier Deguillard
33feafa95a localrepo: properly handle no manifest changes
Summary:
We've had a couple of users reporting Rust panics due to an history entry where
its node is also its own parent. The most recent report shows that during a rebase
the commit context contained a removed file while the file itself isn't present
in either parents.

Several fix for this were considered but abandoned, leaving us with a simple
workaround the issue.

Reviewed By: quark-zju

Differential Revision: D16681230

fbshipit-source-id: d5305477792b4450475137d304fe7b22dc0977af
2019-08-13 13:48:26 -07:00
Xavier Deguillard
3f21c278d4 remotefilelog: Rust repack is the default
Summary:
This option has been on for several months now, let's enable it by default in
the tests too. Since the behavior is slightly different, the tests had to be
adjusted:
  - The packfile hashes are different due to a different repack algorithm,
  - test-fb-hgext-remotefilelog-gcrepack.t removed due to gc not being a thing
    with the Rust repack,
  - test-fb-hgext-remotefilelog-repack-corrupt.t corrupt packs aren't detected
    and removed at repack time, but later,
  - test-fb-hgext-remotefilelog-repack.t we no longer re-delta context in the
    Rust repack

Reviewed By: quark-zju

Differential Revision: D16774858

fbshipit-source-id: 7b7a3d96598c1ded0f64237047c3d97510050e4a
2019-08-13 10:50:02 -07:00
Stefan Filip
07545bd75e util: make util.dirs() and util.finddirs() include root directory (API)
Summary:
Change originally made by martinvonz in the mercurial repository:
https://phab.mercurial-scm.org/D6403

> This changes the behavior of test-origbackup-conflict.t so it no
longer errors out when the backup path points to an existing
file. Instead, it replaces the file by a directory. That seems
reasonable to me.

Reviewed By: quark-zju

Differential Revision: D16716742

fbshipit-source-id: b40ff1637fa75ea0c140cb861999d2cea83197cb
2019-08-12 14:34:36 -07:00
Stefan Filip
e985cb2472 match: use "" instead of "." for root directory (API)
Summary:
Change originally made by martinvonz in the mercurial repository:
Backporting https://phab.mercurial-scm.org/D6401

> I think '' is generally a better value for the root directory than '.'
is. For example, os.path.join('', 'foo') => 'foo', while
os.path.join('.', 'foo') => './foo'.
This patch mostly makes it so we use '' internally in
match.py. However, it also affects the API in visitdir(),
visitchildrenset() and files(). The two former now also accept '' as
input. I've updated the callers of these methods. I've also added a
deprecation warning for passing '.' (for external callers). The only
caller I could find that was affected by files() returning '' instead
of '.' was in dirstate.walk(). I've updated that.
The next few patches show some workarounds we can remove by using ''
instead of '.'.

Reviewed By: quark-zju

Differential Revision: D16716743

fbshipit-source-id: 4cc18b8cdf2f8a9dc44c42729fb46796a16c3244
2019-08-12 14:34:36 -07:00
Aleksei Kulikov
98ae814cd0 snapshot: add merge/rebase data to snapshot
Summary:
This diff adds handling of mergestate and rebasestate -related data from the `.hg` directory.
That is the whole `.hg/merge` folder (both for merge and rebase state) and the `.hg/rebasestate` file.

We do not store any other information in lfs (e.g. number of parents for merge state).
Snapshot manifest oid will be added as an extra field to a fake snapshot commit, which will contain such data.

Differential Revision: D16708733

fbshipit-source-id: efc9b72b7593d85063307528c713c363e061065b
2019-08-12 03:51:58 -07:00
Jun Wu
0cced641f0 statichttprepo: remove statichttprepo
Summary:
We don't use statichttprepo. Remove it so future changelog changes won't need
to take it into consideration.

Reviewed By: markbt

Differential Revision: D16683789

fbshipit-source-id: de4f486e8eb6d372acfab5053769f7ad91c12db8
2019-08-09 16:17:54 -07:00
Jun Wu
168402664c unionrepo: remove unionrepo
Summary:
We don't use unionrepo. Remove it so future changelog changes won't need to
take it into consideration.

Reviewed By: markbt

Differential Revision: D16683788

fbshipit-source-id: bfc474d51d957959a6266e9c8eceda3c11d3cf0d
2019-08-09 16:17:54 -07:00
Jun Wu
330516f923 dagparser: add a binary dag serialization format
Summary:
The binary format allows us to checkin a large repo's dag and use it for
testing. The format is designed to be compat and easy for machine parsing.

`hg debugbindag` was added to generate such format from an existing repo,
and `hg debugpreviewbindag` was added to preview such binary format.

Size of serialized DAGs:

  repo     | method      | size (KB) | size (KB), zstd -19
  --------------------------------------------------------
  mozilla  | debugbindag |    101    |    66
           | debugdag    |    193    |    72
           | changelog.i | 213925    | 80118
  --------------------------------------------------------
  fbsource | debugbindag |   1400    |   700
           | debugdag    |    n/a *  |   n/a
  --------------------------------------------------------
  www      | debugbindag |    5.6    |   3.2
           | debugdag    |    n/a    |   n/a

Note:
`hg debugdag` and `hg debugbuilddag` exist, and they compress
relatively well. However, they have some (critical) issues:

- crashes on fbsource and www (*)
- complex syntax
- does not support selecting a subset of revs (ex. "::master")

Therefore I decided to invent something new.

Reviewed By: sfilipco

Differential Revision: D16294467

fbshipit-source-id: 754ab8942359ef73f5f53c427c7d38d94641fa75
2019-08-09 16:17:49 -07:00
Xavier Deguillard
405ca2d5e8 bindings: remove datastore
Summary:
This class can be used to use a Python store in Python but going through Rust.
We don't need this use case, so let's get rid of it.

Reviewed By: quark-zju

Differential Revision: D16726162

fbshipit-source-id: a0121bf61b178447ad958e2907185e97962046ee
2019-08-09 10:19:19 -07:00
Xavier Deguillard
d7399a765f tests: set tweakdefaults.rebasekeepdate to True
Summary: Rebase tests can be unpredictible otherwise.

Reviewed By: farnz

Differential Revision: D16701186

fbshipit-source-id: 3c7af531c27ada15ace16c616799e0f569e285a2
2019-08-08 10:22:21 -07:00
Aleksei Kulikov
1bb26d4ad2 snapshot: refactor extension code
Summary:
Created some classes and refactored the code.
Now it looks better. :)

Reviewed By: markbt

Differential Revision: D16690240

fbshipit-source-id: f26127d55c5cace7b88e225c85ec13cc278150c8
2019-08-08 04:13:39 -07:00
Aleksei Kulikov
6b7127c966 snapshot: add debug command to checkout on snapshot manifest
Summary:
It would really help to be able to checkout the manifests, restoring all the data from them.
Deleting the missing files, creating the unknown files, adding mergestate info to svfs (not available yet :) ).

Reviewed By: mitrandir77

Differential Revision: D16668312

fbshipit-source-id: 62af8a1fb11541c162f7b5ceb8d6d058cad9a319
2019-08-08 04:13:38 -07:00
Mark Thomas
6a6c0fea7a commitcloud: add automigrate to automatically connect to commitcloud
Summary:
Add automigrate to commitcloud, which will automatically connect the user's
repo to commit cloud on pull.

Reviewed By: mitrandir77

Differential Revision: D16666810

fbshipit-source-id: a1d0857164d2ce6bf1db5784360681f04d35ed90
2019-08-08 03:09:24 -07:00
Mark Thomas
2e3cda1ade commitcloud: cloud leave should always clear the workspace name
Summary:
Running `hg cloud leave` on a repo that was never connected should mark the
repo as explicitly disconnected so that automatic joining will not try to
connect the repo later on.

Reviewed By: quark-zju

Differential Revision: D16687470

fbshipit-source-id: 0552ffa42a1dac40874bba30eeb93509a2227aeb
2019-08-08 03:09:24 -07:00
Mark Thomas
be096ab1c6 commitcloud: make cloud rejoin always join if possible
Summary:
`hg cloud rejoin` limits joining to when the user has an authentication token
and the workspace already exists.  If the user uses a different authentication
method, or if the workspace is brand new, the rejoin does nothing.

Change this to always attempting to join, and only printing a message if the
join failed because of an authentication error, prompting the user to authenticate.

Reviewed By: mitrandir77

Differential Revision: D16666365

fbshipit-source-id: 3ea4542125a1b5266711fab2c31d9455ab764cef
2019-08-08 03:09:23 -07:00
Mark Thomas
80819cbf5b debugexistingcasecollisions: add command to check for existing case collisions
Summary:
Add a new command `hg debugexistingcasecollisions` which checks if any
directories contains two or more entries which may have the same filename on
case-insensitive filesystem.

Reviewed By: suitingtseng

Differential Revision: D16687557

fbshipit-source-id: cb032467e9b8a73fc1f6bf107387bc54c223c2ba
2019-08-08 03:01:44 -07:00
Aleksei Kulikov
cf0570d74a snapshot: add a command to upload snapshot manifest to remote lfs
Summary:
Add the `debuguploadsnapshotmanifest oid` command.

It checks that the local lfs has `oid`, then uploads it and all the related blobs to remote lfs.

Differential Revision: D16667158

fbshipit-source-id: 2978a6c0e7c58c3710f8253cf7b9ab36b24886ce
2019-08-07 05:57:45 -07:00
Aleksei Kulikov
cbf11e8ca8 snapshot: add command debugcreatesnapshotmanifest
Summary:
Add a self-descriptive command `debugcreatesnapshotmanifest`.
For now it supports only deleted and unknown files.

1) Uploads all the untracked files to the local lfs storage.
2) Creates a json-like snapshot with the following structure:
```
{
  "deleted": {
    "path/to/file": None, # this is done for consistency
    "path/to/another/file": None
  },
  "unknown": {
    "added": {
        "oid": "oid in local blobstore",
        "size": 42
    }
    "another/added": {
        "oid": "another oid in local blobstore",
        "size": 24
    }
  }
}
```
...and stores it in the local blobstore.

Reviewed By: markbt

Differential Revision: D16621864

fbshipit-source-id: 6c497d1bb756561b3c3368483b838a2307b0b5f9
2019-08-05 11:10:17 -07:00
Shu-Ting Tseng
bbc6d19715 use manifest lookup to speed up operations
Summary:
The original code path is extremely slow because it has to iterate all files in manifest.
The new path instead only has to lookup the entries in keptdirs and therefore is O(change).

Reviewed By: mitrandir77

Differential Revision: D16646075

fbshipit-source-id: cb2c152d236ffa6f01349c223c9470205c540379
2019-08-05 05:22:40 -07:00
Jun Wu
cadeb66132 testutil/dott: translate piped commands correctly
Summary: Previously, `|` was treated as an argument of a command. Fix it.

Reviewed By: singhsrb

Differential Revision: D16473729

fbshipit-source-id: 0c9a76cd01fc3a22bd43cd0b7d96ce9c6e61ce37
2019-08-02 17:04:00 -07:00
Jun Wu
30dfd6217b bindings: add bindings to stackdesc
Summary:
This exposes the stackdesc feature to Python. The API is polished to use Python
decorators.

Reviewed By: sfilipco

Differential Revision: D16023307

fbshipit-source-id: edcee59e77e7fe55cdb52d031a4fa3e483909ea0
2019-08-01 19:53:56 -07:00
Jun Wu
a3a7a6c860 testutil/dott: add a test about the translator
Summary: The test lists noticable features provided by the translator.

Reviewed By: xavierd

Differential Revision: D16473727

fbshipit-source-id: 617296886243a77b2af8e26d4ea576e63ff88fd3
2019-08-01 17:59:20 -07:00
Jun Wu
6253e8a50e testutil/dott: make translate use posix shell quote
Summary:
`util.shellquote` is platform-dependent. In case of the translator, it always
uses `shlex.split`. Therefore the posix shell quote should be used.

This makes the the test stable across multiple platforms. Namely, `"` is not
used on Windows.

Reviewed By: xavierd

Differential Revision: D16606904

fbshipit-source-id: 879e06b54fc427a6ad1aa959927a0df52f33269a
2019-08-01 17:59:20 -07:00
Jun Wu
5e701ebdaf testutil/dott: fix parsecmd
Summary:
`parsecmd` uses `for name in dictobj`, which can get different results due to
different random seed being used. Use an explicit list instead to avoid the issue.

Reviewed By: xavierd

Differential Revision: D16596261

fbshipit-source-id: c81665cb550a0ce76885aa7f3caee959d63f7b67
2019-08-01 17:59:20 -07:00
Jun Wu
5f1e0890a0 testutil/dott: split the translate function
Summary:
This makes it possible to test the translate behavior without writing anything
to filesystem.

Reviewed By: xavierd

Differential Revision: D16473728

fbshipit-source-id: 3c07b2b5e41d40444b98e7f02de840d2105082fe
2019-08-01 17:59:19 -07:00
Stefan Filip
71bff70aea manifest: rename filesnotin argument from match to matcher
Summary:
Similar to diff, the `match` argument can't be easily expressed using CPython
crate bindings. This argument is not used a lot so we can rename it.

Reviewed By: quark-zju

Differential Revision: D16571840

fbshipit-source-id: 19c7dea82924b7ec4c0b66d1675b9ad4569f8b62
2019-08-01 10:35:53 -07:00
Mohammad Ayoub
c3bb7153e0 change cloud sl --version_number to --workspace-version
Summary: Change --version_number flag to --workspace-version

Reviewed By: quark-zju

Differential Revision: D16561670

fbshipit-source-id: 797a7b2fee2c3e260263ae3029d793452def3033
2019-08-01 02:18:05 -07:00
Stefan Filip
71ab0b4b3d manifest: rename match to matcher in diff argument list
Summary:
`match` is a keyword in Rust. This is causing troubles in adding Rust bindings
for functions that use that as a keyword argument. Renaming the argument to
something else seems to be the easiest path forward.

Reviewed By: quark-zju

Differential Revision: D16496134

fbshipit-source-id: c923f49577564527a99d43dda3d3d9da43122b3e
2019-07-31 10:06:48 -07:00
Stefan Filip
5d1f390ca0 manifest: remove the clean argument from diff
Summary:
The diff algorithm takes the `clean` flag. When `clean` is used all the files
that are not changed between the two manifests are returned. In short the set
of files is equal to |files(M1) U files(M2)|.

This functionality would have to be implemented in the Rust manifest. I don't
feel that a flag on the diff algorithm should be used in this case. First, I
don't like how it interacts with the core diff algorithm, it changes it to the
point where it feel like it should be a different function. Second is that this
behavior can be achieved by getting all the files in the manifest and removing
the items in the diff. Third is that this operation is done quite rarely, being
so expensive.

The downside is that the places where this flag is used get a bit more
expensive.

Reviewed By: quark-zju

Differential Revision: D16496136

fbshipit-source-id: 205dcc23517b896de5c14634683bcbd5f2aa6666
2019-07-31 10:06:47 -07:00
Shu-Ting Tseng
acec61a376 hg svn info should print globalrev
Summary:
This is used by Jellyfish and sent to Phabricator. In the future, we won't have svnrev
and therefore we should use globalrev instead.

More context: https://fb.workplace.com/groups/248282915800791/permalink/372855146676900/

Reviewed By: singhsrb

Differential Revision: D16561651

fbshipit-source-id: 284ad26b1bf77f222086bb7e2104b1c2dbf65449
2019-07-31 09:16:23 -07:00
Shu-Ting Tseng
01394c9202 hg debugcrdump should also use globalrev
Summary:
This command uses svnrev directly. However once we migrate to www-hg, this fields will
go and we can only use globalrev instead.

Let's add that and put it behind a config.

More context: https://fb.workplace.com/groups/248282915800791/permalink/372855146676900/

Differential Revision: D16560447

fbshipit-source-id: de3100ed1e6cc39eaaeff2fe11af04d2f1e2c41a
2019-07-31 09:16:23 -07:00
Mateusz Kwapich
bfc5ee0878 fix O(workingcopy) hg amend <file> behaviour
Summary:
context: Mercurial is slow for peoople that can't use watchman and eden https://fb.workplace.com/groups/scm/permalink/2133433800039562/

Please let me know if this approach (hacking the wctx) is acceptable in your
opinion

Reviewed By: quark-zju

Differential Revision: D15668362

fbshipit-source-id: a94f39be2d845e751a8bb69ca8ca000ef46d9d2d
2019-07-31 08:48:20 -07:00
Jun Wu
bd75a8e099 cliparser: fix regression on error message
Summary:
Fix the regression caused by D16557266 on error message. The fix is not the
most efficient, though. But it should restore the behavior.

Reviewed By: singhsrb

Differential Revision: D16557654

fbshipit-source-id: 2eb6956f99c931f94201b875c8bebb2219a794f0
2019-07-30 08:43:39 -07:00
Mateusz Kwapich
6b7f8fe167 autoformat all of fbcode/scm with black
Summary: blackpylogo

Reviewed By: krallin

Differential Revision: D16543521

fbshipit-source-id: 75977d00329e1068a92a344c99e0ad0392601c54
2019-07-30 08:21:05 -07:00
Jun Wu
bf5047760d test-alias: update test showing a regression
Summary:
The last diff D16557266 caused a regression on the error message. Update the
test to show that.

Reviewed By: singhsrb

Differential Revision: D16557653

fbshipit-source-id: ce4a039f4c91a7bd61ea8e570de960880abae937
2019-07-30 01:10:33 -07:00
Jun Wu
5c24ff642e cliparser: special handle debug commands
Summary:
When doing command name prefix match, if there are a unique match for non-debug
commands, use it. This solves `hg d` regression.

Note: we cannot simply use `starts_with("debug")` to test debug commands. That
is because debug commands can have aliases (ex. `debug|dbsh` as the command
name definition, and `dbsh` is also a debug command that does not starts with
`debug`). Therefore it gets a bit complex.

Reviewed By: kulshrax

Differential Revision: D16557266

fbshipit-source-id: 42d814940c9217d9e554bd0fe2769a53e0ee467f
2019-07-29 19:35:32 -07:00
Jun Wu
28a78e89a5 tests: add a test showing "hg d" regression
Summary: `hg d` should not match debug commands.

Reviewed By: kulshrax

Differential Revision: D16557267

fbshipit-source-id: d7936ab530fce4e302b7e410f8abbe619898e941
2019-07-29 19:35:32 -07:00
Jun Wu
d878cea953 dispatch: expand aliases correctly
Summary:
Use the "first argument position" reported by the parsing library to expand the
command name correctly.

Before this patch:

    --repo foo foo
           ^^^ this foo gets expanded (incorrectly)

After this patch:

    --repo foo foo
               ^^^ this foo gets expanded

Reviewed By: kulshrax

Differential Revision: D16556869

fbshipit-source-id: 8eca98d80cdd8f0d3d329040d6f2eb81653db99f
2019-07-29 19:35:31 -07:00
Jun Wu
12968fc5b5 test-alias: add a test showing incorrect behavior
Summary:
Patterns like `--globalopt name name` could confuse the current logic. Add test
cases for it.

Reviewed By: kulshrax

Differential Revision: D16553454

fbshipit-source-id: dac5fd1a9f98093d13dbd85794e3b455c17dcf64
2019-07-29 19:35:30 -07:00
Jun Wu
72e3fc1d9a cliparser: simplify expand_aliases a bit
Summary:
The loop body can be changed to reduce some identation.

This changes the behavior a bit - an alias expanding to an emtpy string is now
an error. That's consistent with the original behavior.

Reviewed By: kulshrax

Differential Revision: D16530516

fbshipit-source-id: 3f5c2ebe9d8d1727cac706e4ff11f2678567c525
2019-07-29 19:35:28 -07:00
Jun Wu
5dd0629478 cliparser: add an error type about illegal alias
Summary:
When the alias cannot be split via shlex::split, raise an error directly
instead of silently ignoring it and fallback to Python error handling.

Reviewed By: kulshrax

Differential Revision: D16530519

fbshipit-source-id: d81534b198555b256f062dc4e6520fa40ace7700
2019-07-29 19:35:28 -07:00
Saurabh Singh
459d04df3f hgsubversion: allow disabling the svnrev template keyword
Reviewed By: quark-zju

Differential Revision: D16546466

fbshipit-source-id: d3d3005b250856d2e93fbd52f178e9cd8bdf6ef2
2019-07-29 13:29:39 -07:00
Jared Bosco
01465ad1d5 hgmain: replace hg root entirely with a native implementation
Summary: Replace original Python `hg root` implementation with Rust `hg root` implemented with the new command line dispatch library.

Reviewed By: quark-zju

Differential Revision: D16497604

fbshipit-source-id: e3d0e60d4bd4203897260c16e070ca3768ff1d22
2019-07-26 20:38:50 -07:00
Jared Bosco
6bf5f920ee hgmain: implement native hg root command with new dispatch library
Summary:
Implement `hg root` in Rust with the `clidispatch` library as well as adding all current Python commands so that prefix matching still works as expected.

This diff does not remove `hg root` from Python or expose native command documentation to Python, which will be the next diff.

Reviewed By: quark-zju

Differential Revision: D16454053

fbshipit-source-id: 78a9c70aeefb9adbb85c77001b15eab652417b2c
2019-07-26 20:38:50 -07:00