Commit Graph

14436 Commits

Author SHA1 Message Date
Aleksei Kulikov
c193470431 snapshot: prohibit regular checkout on snapshot
Differential Revision: D17093630

fbshipit-source-id: 4425c90fbdecfa3edc9f34f677e0be6b771aa0af
2019-09-04 11:09:35 -07:00
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
Mateusz Kwapich
5ce2387e15 fix the problem with flags starting from --no
Summary:
When we had a "--no-something" flag registered providing "--something"
did the same thing as providing "--no-something" which is highly undesirable
(see task)

Reviewed By: quark-zju

Differential Revision: D16520376

fbshipit-source-id: 9d407b830067d095abdbd9c0cee674f424ffc0f9
2019-07-26 14:13:11 -07:00
Mateusz Kwapich
073fcf2078 show the problem with handling args prefixed with 'no-'
Summary: context: T47908435

Reviewed By: quark-zju

Differential Revision: D16519889

fbshipit-source-id: 952df74f381af2c527cecabe0cd804e7a51bed10
2019-07-26 14:13:11 -07:00
Shu-Ting Tseng
8419106c36 fix flaky tests from hgsubversion
Summary:
The shenanigan was introduced in D16337012 where I tried to reuse pushrevisionwithconfigs.

I am breaking the chain now as it's tooooo hard to reuse and we've spent 4-5 diffs on this now.

Reviewed By: xavierd

Differential Revision: D16520271

fbshipit-source-id: 94cf8580cf3b852ecf7897861893bb51ce03d564
2019-07-26 13:30:12 -07:00
Xavier Deguillard
efad0cf903 cstore: remove py-cdatapack
Summary:
With fastdatapack gone, the cdatapack bindings are no longer necessary and can
be removed.

Reviewed By: singhsrb

Differential Revision: D16476584

fbshipit-source-id: 130a9c5aed4e4f005876c420961f09d398f6e6aa
2019-07-26 10:35:46 -07:00
Xavier Deguillard
f36d8a8fe1 remotefilelog: remove basepack
Summary: This is no longer used anywhere, we can remove it.

Reviewed By: singhsrb

Differential Revision: D16476582

fbshipit-source-id: fe6a8f33cbc3c37fb1d8fb33226352e41bcbaa2a
2019-07-26 10:35:46 -07:00
Xavier Deguillard
28d7ef620b remotefilelog: remove fastdatapack
Summary: This code isn't used anywhere, let's get rid of it.

Reviewed By: singhsrb

Differential Revision: D16476583

fbshipit-source-id: d42376dbb2cf631a170ade3e2764d1f70922d882
2019-07-26 10:35:45 -07:00
Aleksei Kulikov
59bb951024 amend: make next prefer draft commits
Summary: Add an option `update.nextpreferdraft` that makes `hg next` prefer single draft child commits.

Reviewed By: markbt

Differential Revision: D16500162

fbshipit-source-id: 3a20bb487d35b7acf92792e9a7b7424c9b163b64
2019-07-26 10:00:07 -07:00
Shu-Ting Tseng
86bdaeb464 make pushes faster in our reverse sync case
Summary:
Our reverse sync job is too slow when pushing to svn. It seems like the slowness comes
keep doing push-pull-rebase which doesn't seem necessary in our case.

From my understanding, we need to do push-pull-rebase because we have multiple writers.
In our sync job, we only have one writer and therefore can we skip the pulls and rebases?

Reviewed By: DurhamG

Differential Revision: D16442559

fbshipit-source-id: 926d1c516e8e6d59298d310fc67927ace37f72c9
2019-07-26 07:21:37 -07:00
Shu-Ting Tseng
83b1186e2a fix flaky tests and re-add it
Summary:
This was removed in D16381346. The problem is in the ui which is always new. Lets keep a
reference to it when adding configs.

Reviewed By: xavierd

Differential Revision: D16494854

fbshipit-source-id: d206b6211c004e0fec57a2aeef6549b2f96cec17
2019-07-26 07:21:37 -07:00
Jun Wu
ddb31755dc test-revset: fix compatibility with Windows
Summary: Set timezone to UTC to produce the same commit hashes.

Reviewed By: sfilipco

Differential Revision: D16501046

fbshipit-source-id: 4d36da07c08a4337ff6b8cb4135eaea22404ad39
2019-07-25 17:43:42 -07:00
Jun Wu
5b543c3f59 test-command-template: fix compatibility on Windows
Summary: Fix various Windows compatibility issues in the test.

Reviewed By: sfilipco

Differential Revision: D16501049

fbshipit-source-id: 72de26fc80a5f9e023e4b30cc2111810c7ff4626
2019-07-25 17:43:42 -07:00
Jun Wu
11522e065c testutil/dott: normalize Windows path after decoding "(esc)"
Summary:
The old code replaces `\foo (esc)` to `/foo (esc)`, and break the `(esc)`
decoding. Change the order so we decode `(esc)` first before normalizing
the path.

Reviewed By: sfilipco

Differential Revision: D16501047

fbshipit-source-id: ac49fa89fe0123436a994548b045edc0cef0a982
2019-07-25 17:43:41 -07:00
Jun Wu
eaabc7f3c6 edenscm: move sys.path handling to top-level edenscm
Summary:
Make `import edenscm` take care of `sys.path` so as long as `import edenscm`
works, 3rd party pure Python dependencies and edenscmnative should be
importable.

This reduces adhoc sys.path handling in testutil.dott, and fixes an issue where
testing on Windows where `testuitl.dott` fails to run hg commands due to
missing 3rd party dependencies (because `edenscm.mercurial.entrypoint.run` is
not called, and edenscmdeps.zip is not in sys.path).

Reviewed By: sfilipco

Differential Revision: D16499458

fbshipit-source-id: 17e6e5754614dfcf352127d471c649ded4189e1a
2019-07-25 17:43:41 -07:00
Jun Wu
60cf7203a4 testutil/dott: add a note about endless output
Summary:
The `output` API is the thing that stops infinite output from being used.

If endless output is needed, it can be expressed using something like Python
generator. Then the callsites using `stdin` needs update as well.

Reviewed By: xavierd

Differential Revision: D16464660

fbshipit-source-id: 1b81c44c5089f03687aa63ed3ffda9a5399c199b
2019-07-24 14:32:29 -07:00
Jun Wu
2b63b9480e test-glog: fix the test
Summary:
Fix the Python code so the test actually runs.

The test took 102s, and now takes 4.8s.

Reviewed By: xavierd

Differential Revision: D16435788

fbshipit-source-id: 8dc2219fd05fd5915a592396ff72dd54f1ec730b
2019-07-24 14:32:29 -07:00
Jun Wu
d59fb2f5e8 test-glog: auto translate the test
Summary:
This is done via:

  python -m testutil.dott.translate --black --verify test-glog.t
  hg mv --after test-glog.t test-glog-t.py

The test is currently broken (and skipped). It will be fixed in the next diff.

Reviewed By: xavierd

Differential Revision: D16452933

fbshipit-source-id: 40deb3c7f4c8d077de58ef4277be2129274b139c
2019-07-24 14:32:29 -07:00
Jun Wu
cc01957f18 test-glog: remove some tricky shell logic
Summary:
Remove logic printing rev numbers and comparing them with `log --no-graph`.
The test still tests rev numbers. But does not compare them with non-graph
log. This test is about `-G` after all.

This removes usage of programs including `sed`, `grep`, `cmp`, and `diff`.

Reviewed By: xavierd

Differential Revision: D16435790

fbshipit-source-id: 8d78a1d88ac0fb6feb32b8ec8516bac8a91fbdac
2019-07-24 14:32:29 -07:00
Jun Wu
53ae854e52 test-obsolete: remove the test
Summary:
This is the slowest `.t` test (108s). We're migrating away from obsmarkers.
The test also uses tricky shell functions that are hard to translate to `.py`.
Therefore just remove it.

Reviewed By: markbt

Differential Revision: D16435789

fbshipit-source-id: d8fca36d90525ed1db856239d1dafbcec73e7464
2019-07-24 14:32:28 -07:00
Jun Wu
586a9e3edd test-log: fix the test
Summary:
Fix the Python code so the test actually runs.

The test took 114s, and now takes 6.7s.

Reviewed By: xavierd

Differential Revision: D16435786

fbshipit-source-id: 84caa4985a1b40189d31f163a479401206425b58
2019-07-24 14:32:28 -07:00
Jun Wu
e92f297e03 test-log: auto translate the test
Summary:
This is done via:

  python -m testutil.dott.translate --black --verify test-log.t
  hg mv --after test-log.t test-log-t.py

The test is currently broken (and skipped). It will be fixed in the next diff.

Reviewed By: xavierd

Differential Revision: D16452930

fbshipit-source-id: 3376cebfe81bf9d103d041b2a79f53e7b303f7bd
2019-07-24 14:32:28 -07:00
Jun Wu
840c8f654d test-log: comment out a test case that cannot be translated
Summary: This makes the test translatable. The second next diff will recover the test case.

Reviewed By: xavierd

Differential Revision: D16452922

fbshipit-source-id: 179b536d22f11a7a6a1501b289a84dd63d36a17c
2019-07-24 14:32:27 -07:00
Jun Wu
4da37857d6 test-shelve: fix the test
Summary:
Fix the Python code so the test actually runs.

The test took 118s, and now takes 11s.

Reviewed By: xavierd

Differential Revision: D16452927

fbshipit-source-id: 6a975b76f64ec26c36c15aae4b21da3f4764276e
2019-07-24 14:32:27 -07:00
Jun Wu
eba05c3fe7 test-shelve: auto translate the test
Summary:
This is done via:

  python -m testutil.dott.translate --black --verify test-shelve.t
  hg mv --after test-shelve.t test-shelve-t.py

The test is currently broken (and skipped). It will be fixed in the next diff.

Reviewed By: xavierd

Differential Revision: D16452928

fbshipit-source-id: d5dde98055230e1ad5730bb0f73fe3b6221542b5
2019-07-24 14:32:27 -07:00
Jun Wu
e12b4c9b88 test-shelve: make it translatable
Summary: The t -> py translator is not smart about `  >>` in output. Workaround it.

Reviewed By: xavierd

Differential Revision: D16452934

fbshipit-source-id: 234b24a793cfc629650d63b9b0f56b17cdfa9a65
2019-07-24 14:32:27 -07:00
Jun Wu
d1597f8192 test-bookmarks-pushpull: remove the test
Summary:
In production we use remotenames, which is a very different code path and
covered by remotenames tests. Therefore remove the non-remotenames pushpull
test.

The test took 247s.

Reviewed By: xavierd

Differential Revision: D16435787

fbshipit-source-id: dd35a9fdd3412c4b0391edcce8b7668ccb7bcf34
2019-07-24 14:32:26 -07:00
Jun Wu
263d95d20f test-revset: fix the test
Summary:
Fix the Python code so the test actually runs.

The test took 143s, and now takes 5.5s.

Reviewed By: ikostia

Differential Revision: D16435791

fbshipit-source-id: 7eac98c371f78a90a5bb528350b9ff17f51a551c
2019-07-24 14:32:26 -07:00
Jun Wu
1fdb83c768 test-revset: auto translate the test
Summary:
This is done via:

  python -m testutil.dott.translate --black --verify test-revset.t
  hg mv --after test-revset.t test-revset-t.py

The test is currently broken (and skipped), though. It will be fixed in the next diff.

Reviewed By: xavierd

Differential Revision: D16452931

fbshipit-source-id: 281d3b9edae86d536d4ed4872dc4e38afcda5589
2019-07-24 14:32:26 -07:00
Jun Wu
84ae2cbc73 test-revset: comment out a test case that cannot be translated
Summary: This makes the test translatable. The second next diff will recover the test case.

Reviewed By: xavierd

Differential Revision: D16452923

fbshipit-source-id: ca45c42538012152f384a0cd8334a9c513507cad
2019-07-24 14:32:26 -07:00
Jun Wu
2e6455665f test-obsolete-bundle-strip: remove the test
Summary:
This is the 2nd slowest `.t` test. We're migrating away from bundles and
obsmarkers. The test also uses tricky shell functions that are hard to
translate to `.py`. Therefore just remove it.

Reviewed By: markbt

Differential Revision: D16435785

fbshipit-source-id: 93160ca12000c48c9cbd2b90de3631194cb913b1
2019-07-24 14:32:25 -07:00
Jun Wu
c07c411b27 test-command-template: fix the test
Summary:
Manually fix the test so it runs. This is done by removing incompatible
features (cmp, diff), and rewritting bash for loops to Python loops.

It took 183s before, and 6.6s now.

Reviewed By: xavierd

Differential Revision: D16435711

fbshipit-source-id: abf8889caa8b9b7b4137c873f3926ce1c6792f55
2019-07-24 14:32:25 -07:00
Jun Wu
0789866163 test-command-template: auto translate the test
Summary:
This is done via:

  python -m testutil.dott.translate --black --verify test-command-template.t
  hg mv --after test-command-template.t test-command-template-t.py

The test is currently broken, though. It will be fixed in the next diff.

Reviewed By: xavierd

Differential Revision: D16450199

fbshipit-source-id: 73f80fd616e34c402016ff82a37eb68651a75b6e
2019-07-24 14:32:25 -07:00
Jun Wu
55afd053a3 test-command-template: replace some '>' to '.'
Summary: This makes the test auto-translatable.

Reviewed By: xavierd

Differential Revision: D16450198

fbshipit-source-id: 93bba2359d5d375995f8e18efc6274b3318b95b0
2019-07-24 14:32:25 -07:00
Jun Wu
96c5c34019 testutil/dott: implement pipes, head and tail
Summary:
This makes it possible to write:

  sh % 'command' | 'head -2'

in tests

Reviewed By: xavierd

Differential Revision: D16452932

fbshipit-source-id: 8af1355cebc40085fb7af67ceb24a4d54783d388
2019-07-24 14:32:24 -07:00
Jun Wu
462a97942d testutil/dott: implement chmod +x
Summary: Some tests use `chmod +x`. Implement it.

Reviewed By: xavierd

Differential Revision: D16452926

fbshipit-source-id: e354e7e0be97422c8c7e0e7c620c34945481a982
2019-07-24 14:32:24 -07:00
Jun Wu
d49bdd9fed testutil/dott: restore cwd after a command
Summary:
In case the command is `hg --cwd ...`, the side effect of changing pwd should
be reverted at the end of the command.

Reviewed By: xavierd

Differential Revision: D16452924

fbshipit-source-id: 82f96b66ad3fed123cb2e906fc51d6627b16c1f0
2019-07-24 14:32:24 -07:00
Jun Wu
4ee9de2bd7 testutil/dott: fix (re) pattern matching
Summary:
Fixes 2 obvious mistakes:
- Other code uses `trailing space` instead of `trailing spaces`.
- The second `re.match` was mistyped.

Reviewed By: xavierd

Differential Revision: D16452929

fbshipit-source-id: d13cb1f792c2a7275e130ff5314d733b307dd635
2019-07-24 14:32:24 -07:00
Jun Wu
ca42b02813 testutil/dott: fix test command
Summary: The "succeed" code path was missing in the `test` command.

Reviewed By: xavierd

Differential Revision: D16452921

fbshipit-source-id: a276b774c528edaf60e0ecbbad00c15ddd8ba1d1
2019-07-24 14:32:23 -07:00
Jun Wu
b88812e338 testutil: stop generating lines with trailing spaces
Summary:
The `_repr` implementation can generate docstrings with trailing spaces if
`indent` is > 0.

Fix it by special handling the blank line case.

Reviewed By: xavierd

Differential Revision: D16452935

fbshipit-source-id: 99704ba3fb30b93aa35ba4fb16c1d853c58c6635
2019-07-24 14:32:23 -07:00
Jun Wu
8beb778255 testutil/dott: fix translator dropping redirections
Summary:
In case there are multiple commands in a line, and the first command uses
redirections:

  foo > bar && baz

The `> bar` got lost after translation. This is because the same `opts` Python
object (including `> bar` information) was returned and it was mutated.

Solve it by returning a copy of `opts` per command.

Reviewed By: xavierd

Differential Revision: D16452936

fbshipit-source-id: a7ab55cc44ebe628817f821412576e17f6f68a6f
2019-07-24 14:32:23 -07:00
Jun Wu
6cd7d1799c encoding: add a way to change HGENCODING at runtime
Summary:
Make it possible to change the internal state of HGENCODING so we can run hg
logic within a single process without shelling out in the new dott test
framework.

Update testutil/dott to use it.

Reviewed By: xavierd

Differential Revision: D16452925

fbshipit-source-id: d21329854eeee171cc5d02d4f42f11dd273f2150
2019-07-24 14:32:23 -07:00
Xavier Deguillard
5d9d464558 tests: remove mutablehistorypack from tests
Summary: Only one place was using it, remove it.

Reviewed By: quark-zju

Differential Revision: D16423138

fbshipit-source-id: 8a679c5d841f9e404099ba69023d98e02fa6a65b
2019-07-24 10:34:31 -07:00
Xavier Deguillard
c6dccb4955 remotefilelog: all the tests are now using rust mutable datapack
Summary: There is no longer any code depending on the python mutabledatapack.

Reviewed By: kulshrax

Differential Revision: D16392286

fbshipit-source-id: 7fa2a622d1df4e32846c5ab93639fd2d5b509a3e
2019-07-24 10:34:31 -07:00
Xavier Deguillard
334e0c0c2e remotefilelog: the rust mutable stores are the default
Summary: This is now enabled for the entire fleet, let's hardcode this in the code now.

Reviewed By: kulshrax

Differential Revision: D16392289

fbshipit-source-id: 462152ded12d00cf8218526d51a911d6fe5975ca
2019-07-24 10:34:30 -07:00
Zeyi (Rice) Fan
a62bf843cf Back out "RFC: hg: make zsh completion to return list of draft commits"
Summary:
Original commit changeset: 3493895a12ae

This is breaking `arc pull` in fbsource S183062

 #commitClose

Reviewed By: mitrandir77, singhsrb, xavierd

Differential Revision: D16441944

fbshipit-source-id: fd3f5c7027be1468bd8194e6b24dd136b9b767d2
2019-07-23 13:07:14 -07:00
Jared Bosco
089e77642a dispatch: replace final fancyopts call with native rust
Summary: Remove final fancyopts call to have all python parsing being done through native rust codepath, as well as clean-up some deprecated flags that would be special handling.

Reviewed By: quark-zju

Differential Revision: D16156284

fbshipit-source-id: ec5ccaeb982c78426e12ff1d7342b4ea6653e98e
2019-07-20 01:06:35 -07:00
Jared Bosco
93949f4629 dispatch: replace alias expansion and fancyopts parsing call with native rust
Summary:
Replace the second to last fancyopts call with pure rust code parsing and error handling.

Make slightly nicer help messages for ambiguous commands instead of just saying every possible command possible.

Reviewed By: quark-zju

Differential Revision: D16063049

fbshipit-source-id: bfd9e58649b1de2d3485069ce8d5646927bc77f4
2019-07-20 01:06:34 -07:00
Jared Bosco
ae89e32851 cliparser: expose method to perform alias expansion on arguments
Summary:
Alias expansion originally occurs in mercurial through a chain of command handlers that point at their alias.

Now, aliases can be fully expanded early on into parsing to only resolve actual commands and not have to follow a chain of executions.

Reviewed By: quark-zju

Differential Revision: D16059122

fbshipit-source-id: cf28fba4a131ab29ceda87bc3e90d7a434e06625
2019-07-20 01:06:34 -07:00
Jared Bosco
5f02e5cd5c dispatch: replace _parse's call to fancyopts with native code
Summary: Replacing another fancyopts call to be parsed by native Rust code.  This diff introduces slightly hacky feeling behavior in order to handle cycles and resolving aliases, but will be fixed in a follow-up diff where Rust will fully expand the aliases completely removing the need for this confusing alias resolving, chaining, and execution.

Reviewed By: quark-zju

Differential Revision: D15902758

fbshipit-source-id: 11d9a479989a23de09bf96f8020d2fded6c06351
2019-07-20 01:06:33 -07:00
Jared Bosco
3c30d27350 copytrace: remove copytrace flag from mutating global options table
Summary:
Copytrace modified the global definitions table which was making it very difficult to keep track of side-effects as the code was executed, as well as making it harder to replace the fancyopts calls with native Rust.

Since the copytrace behavior can be achieved through a configuration, it now will no longer modify the global definitions table, and will display the correct flag for a user to use in order to get this same behavior.

Reviewed By: quark-zju

Differential Revision: D15902449

fbshipit-source-id: 1c254162d56823e65085b7047bb37513f187b487
2019-07-20 01:06:33 -07:00
Jared Bosco
ee1fcc3d2d bindings: create cliparser native binding to replace fancyopts early parsing
Summary:
The current Python parsing library fancyopts does an early parse for global flags, as well as slightly different logic for parsing out flags.

Switching this fancyopts call should allow fancyopts to be completely replaced by the native code path, and start using Rust parsing for hg.

This enforces command line arguments to be utf8. At Facebook, our `hg` wrapper already crashes if that is not the case. So it shouldn't cause new issues.

Reviewed By: quark-zju

Differential Revision: D15837079

fbshipit-source-id: 95634ebc814f8865960181f23282e5283068057c
2019-07-20 01:06:32 -07:00
Jared Bosco
95b0be5bdc dispatch: remove strictflags and related tests
Reviewed By: quark-zju

Differential Revision: D15833690

fbshipit-source-id: 3469d8def660b116c0f82c674a19f06b18f29211
2019-07-20 01:06:32 -07:00
Jun Wu
c2027cc740 test-revset-age: migrate to Python and stablize it
Summary:
The test was flaky:

  --- test-revset-age.t
  +++ test-revset-age.t.err
  @@ -13,7 +13,6 @@

   Check age ranges
     $ hg log -T '{rev} {desc}\n' -r 'age("<30")'
  -  5 Changeset 5 seconds ago
     $ hg log -T '{rev} {desc}\n' -r 'age("<7m30s")'
     4 Changeset 420 seconds ago
     5 Changeset 5 seconds ago
  @@ -22,7 +21,6 @@
     4 Changeset 420 seconds ago
     5 Changeset 5 seconds ago
     $ hg log -T '{rev} {desc}\n' -r 'age("<1d")'
  -  2 Changeset 86369 seconds ago
     3 Changeset 3800 seconds ago
     4 Changeset 420 seconds ago
     5 Changeset 5 seconds ago
  @@ -53,10 +51,10 @@
     $ hg log -T '{rev} {desc}\n' -r 'age(">1d")'
     0 Changeset 31536000 seconds ago
     1 Changeset 86401 seconds ago
  +  2 Changeset 86369 seconds ago
     $ hg log -T '{rev} {desc}\n' -r 'age(">365d")'
     0 Changeset 31536000 seconds ago
     $ hg log -T '{rev} {desc}\n' -r 'age("<64m")'
  -  3 Changeset 3800 seconds ago
     4 Changeset 420 seconds ago
     5 Changeset 5 seconds ago
     $ hg log -T '{rev} {desc}\n' -r 'age("<60m500s")'
  @@ -87,16 +85,16 @@
     hg: parse error: invalid age in age range: 5h-10d
     [255]
     $ hg log -T '{rev} {desc}\n' -r 'ancestorsaged(., "<1d")'
  -  2 Changeset 86369 seconds ago
     3 Changeset 3800 seconds ago
     4 Changeset 420 seconds ago
     5 Changeset 5 seconds ago
     $ hg log -T '{rev} {desc}\n' -r 'ancestorsaged(.^, "<1d")'
  -  2 Changeset 86369 seconds ago
     3 Changeset 3800 seconds ago
     4 Changeset 420 seconds ago
     $ hg log -T '{rev} {desc}\n' -r 'ancestorsaged(., "1d-20d")'
     1 Changeset 86401 seconds ago
  +  2 Changeset 86369 seconds ago
     $ hg log -T '{rev} {desc}\n' -r 'ancestorsaged(., ">1d")'
     0 Changeset 31536000 seconds ago
     1 Changeset 86401 seconds ago
  +  2 Changeset 86369 seconds ago

Translate it to Python and patch `time.time` to stablize it.

Reviewed By: xavierd

Differential Revision: D16396479

fbshipit-source-id: 553bfe36094b2a2cbe939319606a627323cfc9eb
2019-07-19 19:36:33 -07:00
Jun Wu
3f21de52f4 test-fb-hgext-remotefilelog-local: try to make it less flaky
Summary:
The test was flaky:

  --- test-fb-hgext-remotefilelog-local.t
  +++ test-fb-hgext-remotefilelog-local.t.err
  @@ -31,7 +31,6 @@
     M x
     M y
     ? a
  -  1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over 0.00s
     $ hg add a
     $ hg status
     M x

Reviewed By: xavierd

Differential Revision: D16393051

fbshipit-source-id: 3dad1970200388b8339bc2e73b7a092336edc70d
2019-07-19 19:36:33 -07:00
Jun Wu
a77e9a4d5a test-fb-hgext-remotefilelog-bgprefetch: try to make it less flaky
Summary:
The test was flaky:

  --- test-fb-hgext-remotefilelog-bgprefetch.t
  +++ test-fb-hgext-remotefilelog-bgprefetch.t.err
  @@ -211,7 +211,6 @@
     $ find $CACHEDIR -type f | sort
     $ echo b > b
     $ hg commit -qAm b
  -  * files fetched over 1 fetches - (* misses, 0.00% hit ratio) over *s (glob)
     $ hg bookmark temporary
     $ sleep 1
     $ hg debugwaitonprefetch >/dev/null 2>%1
  @@ -266,7 +265,7 @@
     $ hg rebase -s temporary -d foo
     rebasing 3:58147a5b5242 "b" (temporary tip)
     saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/58147a5b5242-c3678817-rebase.hg (glob)
  -  3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over *s (glob)
  +  2 files fetched over 2 fetches - (2 misses, 0.00% hit ratio) over 0.00s
     $ sleep 1
     $ hg debugwaitonprefetch >/dev/null 2>%1
     $ sleep 1

Reviewed By: xavierd

Differential Revision: D16393049

fbshipit-source-id: fb558e9c7f9cc51b1b133471220ac4862b985098
2019-07-19 19:36:32 -07:00
Jun Wu
b785df33a4 test-shelve: try to make it less flaky
Summary:
`...s ago` is flaky.

    --- test-shelve.t
    +++ test-shelve.t.err
    @@ -885,7 +885,7 @@
       +patch a
     No-argument --patch should also work
       $ hg shelve --patch
    -  default-01      (*s ago)    shelve changes to: create conflict (glob)
    +  default-01      (15s ago)   shelve changes to: create conflict

       diff --git a/shelf-patch-b b/shelf-patch-b
       new file mode 100644

Reviewed By: xavierd

Differential Revision: D16393050

fbshipit-source-id: 3906eabfd7ba9e4b11e7c4c8f236324afc607fff
2019-07-19 19:36:32 -07:00
Jun Wu
fa23fa1a77 test-fb-hgext-treemanifest-prefetch: try to make it less flaky
Summary:
`sleep ...` makes test flaky.

   --- test-fb-hgext-treemanifest-prefetch.t
   +++ test-fb-hgext-treemanifest-prefetch.t.remotefilelog.true.shallowrepo.false.err
   @@ -554,7 +554,7 @@
      $ sleep 1
      $ hg debugwaitonrepack
      $ ls_l $CACHEDIR/master/packs/manifests | grep datapack | wc -l
   -  \s*1 (re)
   +  3
    #endif

Reviewed By: xavierd

Differential Revision: D16391376

fbshipit-source-id: 3dc1ee3d1c8b85bc6b0a58570443b89aef86f55a
2019-07-19 19:36:32 -07:00
Jun Wu
237846d4ca tests: try to make build_nupkg.py test work
Summary:
build_nupkg.py test will copy tests/ to build/embedded/tests/ before running
them. That breaks testutil.dott "edenscm" module discovery. Try to fix it by
making "edenscm" module discovery consider "build/embedded/python27.zip".

Reviewed By: xavierd

Differential Revision: D16383017

fbshipit-source-id: 52e19182d3e5e7267221244bd39d9a146928d8df
2019-07-19 15:08:17 -07:00
Jun Wu
bc191c2aa5 test-dirstate-completion: fix the test
Summary: Avoid creating the same repo.

Reviewed By: xavierd

Differential Revision: D16381413

fbshipit-source-id: 9f1d6bee685af5cec26e40e7669ef794ce6b23ce
2019-07-19 13:27:08 -07:00
Xavier Deguillard
f0a2127ace tests: remove newly added flaky test in test-hgsubversion-push-command.py
Summary: This newly added test keeps failing. Let's remove it from now.

Reviewed By: DurhamG

Differential Revision: D16381346

fbshipit-source-id: 11146d44fbbcd1e1c960fe4a0b6e3c28854f456d
2019-07-19 13:09:23 -07:00
Matt Glazar
9b88f1e59b Fix slow rebase for commits which move files
Summary:
When rebasing or showing a diff for a commit which moved files, remotefilectx.ancestors (called by _tracefile) calculates the linkrev for each ancestor. Sometimes [1], this is a disaster:

* remotefilectx._linkrev executes its slow path and scans the change log.
* For each entry in the change log, remotefilectx._linkrev downloads trees if needed.
* Hg downloads trees one-by-one (as of D15964145).

remotefilectx.ancestors is only calculating linkrevs so it can sort the ancestors topologically. _tracefile only needs the ancestors to be ordered topologically, not by linkrev. remotefilectx.ancestors's calls to remotefilectx._linkrev are redundant.

Optimize _tracefile's use of remotefilectx.ancestors: order remotefilectx objects topologically (breadth-first) without sorting by linkrev. Create a new function for this purpose (topological_ancestors) to avoid possibly breaking other callers of remotefilectx.ancestors. As a side effect, make this new function return remotefilectx objects lazily, similar to the filectx.ancestors function.

On my machine, with warm caches, this speeds up 'hg diff -c' and 'hg rebase' for a modestly-sized commit. 'hg diff -c' takes 0.64 seconds, down from 65.6 seconds.

[1] Hypothesis: After 'hg amend', 'hg bundle' packages linkrevs which refer to the pre-amend commit (which is not serialized into the bundle) rather than the post-amend commit. 'hg unbundle' thus creates linkrevs referring to a missing commit.

Reviewed By: DurhamG

Differential Revision: D16297426

fbshipit-source-id: 407597d5e36fc06b33719c28f5ea5052e01dc7a3
2019-07-19 12:35:22 -07:00
Xavier Deguillard
ec9ec06360 run-tests: add testpilot test runner
Summary:
Testpilot can give us a lot of things for free, including the automatic
detection of flaky tests, disabling of them, re-enabling too, easy retries on
failure, timeouts, better tracking, and the list goes on.

At a first step, I'd like to make the testpilot runner the default in hgbuild
to get all the benefits listed above.

Reviewed By: quark-zju

Differential Revision: D16294182

fbshipit-source-id: aadfbac9eb05e9d64336daba7a50a6263e38c162
2019-07-19 11:47:04 -07:00
Xavier Deguillard
9151a3cc24 tests: fix test-run-tests.t
Summary: When all tests are skipped, run-tests.py no longer return a 80 error code.

Reviewed By: singhsrb

Differential Revision: D16380129

fbshipit-source-id: e84a3558df8c2c4ebef9a382a1172d859a47e220
2019-07-19 11:39:56 -07:00
Aida Getoeva
1fb44ce297 remotenames: disable selectivepull on clone
Summary:
Streaming clone works only if we fetch all data from the server, however with selective pull feature hg specifies the particular heads it needs to pull. It causes downgrade in clone performance.
I decided to disable selective pull just before the clone operation, so the feature will be working everywhere else. Also I still store, even after clone, only "subscribed" remote bookmarks.

There are, however, artifacts of such behaviour, they are shown by changes in `test-commitcloud-sync-remote-bookmarks.t`: the whole tree of commits now is available locally, except of the remote bookmarks.

Reviewed By: simpkins

Differential Revision: D16223458

fbshipit-source-id: 0564ac23a16fe54d245e0a6ce9db5be4b6e3532f
2019-07-19 10:04:26 -07:00
Aida Getoeva
3c81066860 commitcloud: fix sync when remotebooks sync disabled on one of the copies
Summary:
If one of the repo checkouts doesn't have remote bookmarks synchronization enabled, it must not affect the Cloud's remote bookmarks state.

I also changed `localserver` (is used for our tests) because Commit Cloud server deletes the "old" bookmark names from the db and inserts "new". However, the `localserver` just set the "new" books dictionary as a new state, which is not quite correct.

Reviewed By: simpkins

Differential Revision: D16338257

fbshipit-source-id: d77d9218b1c35ea1a097bbe7393d0910ce7b4d38
2019-07-19 10:04:25 -07:00
Zeyi (Rice) Fan
e2655fac28 RFC: hg: make zsh completion to return list of draft commits
Summary:
By default the zsh completion will give me a list of bookmark names which personally I don't think it is useful at all.

I think making it giving me the list of draft commits is much better.

Reviewed By: quark-zju

Differential Revision: D16094724

fbshipit-source-id: 3493895a12ae02df011560b53dd5e55c8d183c79
2019-07-18 22:26:01 -07:00
Xavier Deguillard
3ce0ed8fa2 tests: fix test-hgsubversion-externals.py
Summary:
This was failing in our contbuild on centos. For some reason the memoization of
repo and ui was what made it fail.

Reviewed By: DurhamG

Differential Revision: D16368137

fbshipit-source-id: c3bec702bfa311f4be438f5aaf4939e6e725c63b
2019-07-18 22:20:35 -07:00
Xavier Deguillard
f9b4c4917a run-tests: return a success error code when tests are skipped
Summary:
As run-tests.py will be used with testpilot and at diff time, we do not
want to fail a run when all the tests were simply skipped. Let's make
that a success instead.

Reviewed By: quark-zju

Differential Revision: D16364297

fbshipit-source-id: ef8e912ddde91bd5be52784fceaf012857841eea
2019-07-18 15:54:21 -07:00
Jun Wu
2ec82860a2 test-dirstate: fix testcase handling in new tests
Summary:
`#testcases` was translated to `for testcase in ...`, which is subtly
different since the for loop does not clean up states. Insert `cd $TESTTMP`
to make sure `setconfig` sets the global config, instead of the repo one.

Reviewed By: singhsrb

Differential Revision: D16363261

fbshipit-source-id: ea20c758e9131268f9329b98759e7423d9f1aa87
2019-07-18 15:06:45 -07:00
Saurabh Singh
c137206645 globalrevs: return globalrevs while resolving svnrev template keyword
Reviewed By: quark-zju

Differential Revision: D16361887

fbshipit-source-id: 547b03af9c17aa7ab033f9d1bd733f4a63830d07
2019-07-18 12:23:00 -07:00
Jun Wu
53cc0f0766 test-contrib-check-code: update the test
Summary:
D16344714 made some rules only apply to edenscm/. Update the test to reflect
the changes.

Some formatting rules (ex. "string join across lines") are less important since
all files are formatted by black.

Reviewed By: xavierd

Differential Revision: D16360508

fbshipit-source-id: 9d38d710501eaf71c033ca49328774b8688fb5e0
2019-07-18 11:38:02 -07:00
Shu-Ting Tseng
fd5abc16e3 rewrite svn commit message with hg hash
Summary:
When we are migrating www to hg as source of truth, we would like to maintain the
reverse sync for some time in case we need to rollback.

In order to achieve that, we need to know the latest svn and hg commit to operate on. We
would like to record this information in the svn commit itself so it doesn't require
extra syncing and transaction.

In ordre to get this info, we can run `svn log -l 1` and parse the commit message from
there.

Reviewed By: quark-zju

Differential Revision: D16337012

fbshipit-source-id: acf66babdb48c07f95e9eb49daac0d3d3e6a96a0
2019-07-18 10:06:05 -07:00
Jun Wu
0c36fd8b5e tests: translate some .t tests to Python
Summary:
Those tests were converted using:

  echo *.t | xargs -P20 -n1 python -m testutil.dott.translate --black --verify

They run 5x faster (via run-tests.py), and 10x faster (via python directly).

run-tests.py on old .t files, 652 CPU seconds:

  % time ./run-tests.py `cat list-t.txt`  --noprogress
  .................................................................................................................................
  # Ran 129 tests, 0 skipped, 0 failed.
  ./run-tests.py `cat list-t.txt` --noprogress  505.30s user 146.37s system 1451% cpu 44.899 total

run-tests.py on new py tests, 135 CPU seconds:

  % time ./run-tests.py `cat list-py.txt` --noprogress
  .............................................................................................................................
  # Ran 125 tests, 0 skipped, 0 failed.
  ./run-tests.py `cat list-py.txt` --noprogress  55.73s user 78.80s system 744% cpu 18.061 total

vanilla python on new tests, 59 CPU seconds:

  % time (for i in `cat list-py.txt`; do python $i; done;)
  ( for i in `cat list-py.txt`; do; python $i; done; )  41.61s user 17.47s system 90% cpu 1:05.31 total

The new tests also have auto fix ability. `python test-foo-t.py --fix` will
autofix the code.

Reviewed By: xavierd

Differential Revision: D16172902

fbshipit-source-id: dda53990a7dfff5ac214c1237e4206a4d67e8e48
2019-07-17 21:11:32 -07:00
Jun Wu
59c9cee23a testutil/dott: append '(trailing spaces)' to lines with trailing spaces
Summary:
Some linters or editers are unhappy with trailing spaces in heredoc.
Workaround it.

Reviewed By: xavierd

Differential Revision: D16344717

fbshipit-source-id: 63be8b992e2e4718faea1a55655c592f0e87b206
2019-07-17 21:11:32 -07:00
Jun Wu
77dbcbbf24 testutil/dott: add a script to translate .t files
Summary:
Add a script to automatically translate .t tests to .py tests using
testutil.dott.

Reviewed By: xavierd

Differential Revision: D16172903

fbshipit-source-id: a1d736ae3e8035ac254af59c6dff5eb9f204f1fb
2019-07-17 21:11:31 -07:00
Jun Wu
4853d63b69 testutil/dott: implement per-command environment variables
Summary: This allows FOO=bar to work in some tests.

Reviewed By: xavierd

Differential Revision: D16344718

fbshipit-source-id: b600d928a42e9e8e36a2ab9f5db97fd489878d02
2019-07-17 21:11:31 -07:00
Jun Wu
b8f57dbe27 testutil/dott: implement feature test
Summary:
`.t` tests use `hghave` to test features, and can have `#testcases` for
multiple test cases. Implement them.

Reviewed By: xavierd

Differential Revision: D16209201

fbshipit-source-id: 1e8ea32d966f922efcf94e555cc9ab946cc85b27
2019-07-17 21:11:31 -07:00
Jun Wu
4a0d11f14f testutil/dott: implement "source library.sh"
Summary:
Tests use "source" to enable new features. One the main sources is
"library.sh", which includes remotefilelog utilties. Implement it.

Reviewed By: xavierd

Differential Revision: D16209209

fbshipit-source-id: 3bce4296861947e753e37bccf83c05129960dece
2019-07-17 21:11:30 -07:00
Jun Wu
57483c41b1 testutil/dott: implement some tinit.sh functions
Summary: tinit.sh provides some handy functions. Implement them.

Reviewed By: xavierd

Differential Revision: D16209205

fbshipit-source-id: 084669833086fef61e215865e792260dc2e35794
2019-07-17 21:11:30 -07:00
Jun Wu
c5a7b31dbf testutil/dott: implement "hg"
Summary:
Implement hg commands. This uses the dispatch code path to run hg commands
without startup overhead. It's possible that some side effects in the Python
world can cause unwanted behavior. Therefore a "reload" function was provided.

Once we have Rust as the entry point, we might still want to have some Python
binding to the Rust logic so the test code can use them.

Reviewed By: xavierd

Differential Revision: D16209204

fbshipit-source-id: e510f59629b46afd6b140c7bec9de07698b523b9
2019-07-17 21:11:30 -07:00
Jun Wu
1364b3a3ae testutil/dott: implement a subset of coreutils
Summary: Implement a subset of coreutils so functions used by .t can run.

Reviewed By: xavierd

Differential Revision: D16209202

fbshipit-source-id: 953bebbfdc09cf191e8aa04c5ee1468c764b4360
2019-07-17 21:11:30 -07:00
Jun Wu
6977426d45 testutil/dott: remove indentation from heredoc
Summary:
To make the code look better, indentation gets added to heredoc content.
Remove them. This replaces `inspect.cleandoc`. The difference is
`inspect.cleandoc` special handles the first line, which is undesirable.

Reviewed By: xavierd

Differential Revision: D16344716

fbshipit-source-id: c69c20607ddc5292bc6bcdd840587258276016ed
2019-07-17 21:11:29 -07:00
Jun Wu
744a504d00 testutil/dott: implement TESTTMP support
Summary:
TESTTMP was handled by run-tests.py. This diff extracts a subset of TESTTMP
logic so tests using testutil/dott can run via Python directly without using
run-tests.py

Reviewed By: xavierd

Differential Revision: D16209203

fbshipit-source-id: 7605505a725c30c9d07d83b7d3bfe92ec215cefc
2019-07-17 21:11:29 -07:00
Jun Wu
b87a92215f testutil/dott: implement advanced output matching
Summary:
`run-tests.py` supports `(glob)`, `(re)`, `(esc)` for output matching.
Implement them.

Note: `(?)` is harder to implement. It is not implemented in this diff.

Reviewed By: xavierd

Differential Revision: D16209212

fbshipit-source-id: 52172158c41286a0673e6ae25bde2c774ac24c52
2019-07-17 21:11:28 -07:00
Jun Wu
08c15a105a testutil/dott: normalize error messages
Summary:
run-tests.py uses common-pattern.py to normalize error messages to things
like `$ENOENT$`. Implement that behavior.

Reviewed By: xavierd

Differential Revision: D16209208

fbshipit-source-id: 3e609cc16442f80b844264f93dce9ea46517458d
2019-07-17 21:11:28 -07:00
Jun Wu
27908b883c testutil/dott: initial framework
Summary:
The testutil/dott module is to be "somehow" compatible with ".t" tests.
At its core, it emulates "bash" syntax using Python functions.

This diff adds the core "sh" syntax to call into Python functions.
The test code can be written as:

  from testutil.dott import sh

  sh % "echo foo" == "foo\n"
  sh % "echo remotefilelog" > ".hg/requires"
  sh % "cat" << "[extensions]\nrebase=" > ".hg/hgrc"

This is similar to ".t" test:

  $ echo foo
  foo
  $ echo remotefilelog > .hg/requires
  $ cat << EOF > .hg/hgrc
  > [extensions]
  > rebase=
  > EOF

And is compat even after black formatting.

Reviewed By: xavierd

Differential Revision: D16172901

fbshipit-source-id: 7bb666e7e1621536ffdd6516542a468ac419d80a
2019-07-17 21:11:28 -07:00
Jun Wu
2232a26c42 testutil: add "eq" assertion with autofix ability
Summary: The "eq" API is similar to `assert_eq!` in Rust, with the autofix ability.

Reviewed By: xavierd

Differential Revision: D16168821

fbshipit-source-id: bf7dcfd24c42dee30c54aeeaa71eccab78a8f0f6
2019-07-17 21:11:27 -07:00
Jun Wu
dd1b0586c0 testutil: add a utility to calculate argument positions
Summary:
The utility is used by a later change which provides the "autofix" feature for
Python code.

Reviewed By: xavierd

Differential Revision: D16168823

fbshipit-source-id: feb55a9e6ba5e78ad0f490cadeeafbcc1306e8ca
2019-07-17 21:11:27 -07:00
Marla Azriel
36d7d7604d commands: help text for undo
Summary: Updated help text for hg undo and fixed test

Reviewed By: kulshrax

Differential Revision: D15937058

fbshipit-source-id: 577d05fb9c16237f8b879ef9ebf60341d5fdf37e
2019-07-17 10:43:01 -07:00
Mohammad Ayoub
ed8cf87d5e Add date and version options to hg cloud sl
Summary: Modified the hg cloud sl command to have two options --date and --version_number that display that historical version of the smartlog

Reviewed By: mitrandir77

Differential Revision: D16120273

fbshipit-source-id: 4f202ed49488247f43bd682574ff52dcf17c958e
2019-07-17 00:58:50 -07:00
Xavier Deguillard
fcb82b9dc5 test: fix test-fb-hgext-treemanifest-bad-tree.t
Summary: The deleted line was probably added by mistake, remove it.

Reviewed By: HarveyHunt

Differential Revision: D16264017

fbshipit-source-id: f220d000ac0394f8cca2d742d4c3dabe9d769d06
2019-07-15 11:44:24 -07:00
Durham Goode
97b7106d24 historypack: add logic to prevent history cycles
Summary:
Bad callers could try to add nodes that had the same value as the
parent. Let's catch this and prevent it.

Reviewed By: quark-zju

Differential Revision: D16189602

fbshipit-source-id: 08220c18ee96743e4eda00e5e953a5946b40d95c
2019-07-12 10:47:29 -07:00
Durham Goode
18bedf75e0 treemanifest: add test to catch bad tree writing
Summary:
We've seen a couple cases where hgsubversion and p4importer create
incorrect memctx's that claim to modify files without actually modifying them.
This results in some weird behavior with treemanifest when the manifest claims
to be created but results in the same hash as the parent. This breaks
historypack serialization and results in missing data in the pack.

This diff adds a test demonstrating the error. Future diffs will fix it.

Reviewed By: quark-zju

Differential Revision: D16189603

fbshipit-source-id: de6e18396dc25c70beec84e57ebdd27672a0294e
2019-07-12 10:47:29 -07:00
Mateusz Kwapich
04072a3896 wait more in prefetch tests
Summary:
This atttemps to mitigate this failure in the following tests by adding more waiting to avoid races between background prefetches and repacks and the test code. out of last 30 builds about 20 failed because flakiness in those areas

    --- test-fb-hgext-remotefilelog-bgprefetch.t
    +++ test-fb-hgext-remotefilelog-bgprefetch.t.err
    @@ -261,7 +261,7 @@
       $ hg rebase -s temporary -d foo
       rebasing 3:58147a5b5242 "b" (temporary tip)
       saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/58147a5b5242-c3678817-rebase.hg (glob)
    -  3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over *s (glob)
    +  1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over 0.00s
       $ sleep 1

    --- test-fb-hgext-treemanifest-prefetch.t
    +++ test-fb-hgext-treemanifest-prefetch.t.remotefilelog.true.shallowrepo.false.err
    @@ -554,7 +554,7 @@
       $ sleep 0.5
       $ hg debugwaitonrepack
       $ ls_l $CACHEDIR/master/packs/manifests | grep datapack | wc -l
    -  \s*1 (re)
    +  3

    --- test-fb-hgext-remotefilelog-bgprefetch.t
    +++ test-fb-hgext-remotefilelog-bgprefetch.t.err
    @@ -210,7 +210,6 @@
       $ find $CACHEDIR -type f | sort
       $ echo b > b
       $ hg commit -qAm b
    -  * files fetched over 1 fetches - (* misses, 0.00% hit ratio) over *s (glob)
       $ hg bookmark temporary
       $ sleep 1
       $ hg debugwaitonprefetch >/dev/null 2>%1

Reviewed By: ikostia

Differential Revision: D16201308

fbshipit-source-id: 9b89ec845176bc1aedc8ff49038f75d8fcab13bc
2019-07-11 06:42:07 -07:00
Durham Goode
2a6a9fed8a push: add option to block hg push if no reason is provided
Summary:
We want to start tracking down why people use hg push instead of arc
land. To begin with, let's add an option that will require they provide a reason
to run hg push directly. Later we may block pushes or limit it to a whitelist in
some way.

Reviewed By: quark-zju

Differential Revision: D16156871

fbshipit-source-id: f46c039a91073fa3380d3b4b7f35722829eeb72a
2019-07-10 20:18:48 -07:00
Mark Thomas
398067390d remotefilelog: disable descendantrevfastpath by default
Summary:
With treemanifest and the eden api, descendantrevfastpath (which downloads all
the manifests) is slower than just downloading the history from the eden api.

We still want to record the descendantrev if we already know the real linkrev
of the current filenode, as that will still be fast.

Reviewed By: quark-zju

Differential Revision: D15943076

fbshipit-source-id: c6013801822bdfa3196e60cbcd34a9ce184c5c5f
2019-07-10 16:41:54 -07:00
Shu-Ting Tseng
435bb980f7 run hgsubversion tests with sqlite revmap format
Summary: At Facebook, we only use the sqlite revmap implementation. Lets run the test in sqlite.

Reviewed By: farnz

Differential Revision: D16181057

fbshipit-source-id: f4e74f05419d614c7d82772d5ac3e39443e84599
2019-07-10 12:47:44 -07:00
Shu-Ting Tseng
10125c8e19 make the svn call lazy
Summary:
Previously I tried to not call to SVN if we have the 2 configs set. However I made a
mistake that the args will always be evulated anyway (computer science 101).

Let make it really lazy and add a test for that.

Reviewed By: ikostia

Differential Revision: D16163470

fbshipit-source-id: 6ec0f855b10164ae9a210bc70789b2f59fd19858
2019-07-10 05:27:59 -07:00
Tim Hatch
f16e275319 Unbreak scm/hg/tests:hg_run_tests
Reviewed By: DinoV

Differential Revision: D16175298

fbshipit-source-id: 764329207fde4abda05a9e1b227ab4be5d323e9d
2019-07-10 01:03:40 -07:00
Tim Hatch
4155d5df93 Fix interpreter lines for files with python2-only syntax.
Reviewed By: lisroach

Differential Revision: D15362271

fbshipit-source-id: 48fab12ab6e55a8537b19b4623d2545ca9950ec5
2019-07-09 10:51:40 -07:00