Commit Graph

14335 Commits

Author SHA1 Message Date
Jun Wu
484939a75d hgmain: make bindings a builtin module
Summary:
Global states (For example, the global blackbox instance, potentially some
logging / tracing libraries) are separate in the Rust and Python worlds.

That is because related code gets compiled separately:

  bindings.so (top-level)
   \_ blackbox

  hgmain (top-level)
   \_ blackbox (have a different global instance than the above blackbox)

To address it, make `bindings` a builtin module in `hgmain`.

The builtin module was renamed from `edenscmnative.bindings` to `bindings` so
it does not require importing anything else (For example, `edenscmnative`).

This unfortunately makes `hg` 100+ MB. Fortunately it can be compressed well
(gzip: 31MB).

Reviewed By: singhsrb

Differential Revision: D17429688

fbshipit-source-id: bf16910d7a260ca58db0d272fc95d8071d47bbc6
2019-09-20 18:32:36 -07:00
Jun Wu
c3355e8af9 run-tests: use "hg debugpython" instead of "python" to run tests
Summary: This makes the test runner compatible with the next change.

Reviewed By: singhsrb

Differential Revision: D17429690

fbshipit-source-id: 100d2c9f341cfc64be22137b7013f5b234005771
2019-09-20 18:32:35 -07:00
Jun Wu
4e8707262f tests: change some 'python' to 'hg debugpython'
Summary:
In the future `python` will no longer be able to import `bindings`.
Change them to `hg debugpython` so they stay compatible.

I dropped the "custom hghave" feature. It breaks and I don't think there
are users of it.

Reviewed By: singhsrb

Differential Revision: D17429689

fbshipit-source-id: 96e55ef25a027bd4ad33fc279f27c1d5cbed6861
2019-09-20 18:32:35 -07:00
Jun Wu
b4a8819c72 tests: remove web / cgi related test
Summary:
We don't care about hgweb / cgi right now. The tests use `$PYTHON` and import
the `bindings` module. In a future diff `$PYTHON` no longer has access to
`bindings`. Remove the tests so the test is compatibile.

Reviewed By: xavierd

Differential Revision: D17429692

fbshipit-source-id: b3d7c7de34bdb7f28d8b7989e9df822435b84fb2
2019-09-20 18:32:35 -07:00
Jun Wu
03daebc5cb test-clonebundles: remove the test
Summary: We don't use clonebundles. Remove the test to reduce support burden.

Reviewed By: singhsrb

Differential Revision: D17483628

fbshipit-source-id: f63070dcd7bb7283d249d33ac760bdebbbc4261a
2019-09-20 18:32:34 -07:00
Jun Wu
33216d5840 commands: add a command to run Python interpreter
Summary:
This makes it possible to use `hg debugpython -- ...` to replace `python ...`.
An upcoming change makes `edenscmnative.bindings` non-importable. To continue
support Python tests, we need an alternative way to run Python.

Reviewed By: singhsrb

Differential Revision: D17423797

fbshipit-source-id: 21ece4d35c2fdc09c281b10d5a07ee8af2e78384
2019-09-20 18:32:34 -07:00
Jun Wu
9703bfb0fe repoview: allow disabling repoview filtering
Summary:
The eventual goal is to disable repoview filtering once narrow-heads is set.

The repoview layer is using a blacklist approach - scan through all heads (or
all drafts), and figure out what to blacklist. The new dag structure has a
larger constant factor on time complexity when it comes to many heads.

This diff disables repoview filtering entirely if 'narrow-heads' gets turned
on, as the first step moving to the whitelist approach. There are other isues,
which will be fixed in upcoming diffs.

Reviewed By: sfilipco

Differential Revision: D17244557

fbshipit-source-id: 260214378abba4b0ecd0a0407d452352b6dc3c28
2019-09-20 13:36:19 -07:00
Jun Wu
35b7e438c4 test-narrow-heads: add a test about narrow-heads issues
Summary: The test contains issues in test-narrow-heads that need fixes.

Reviewed By: sfilipco

Differential Revision: D17244550

fbshipit-source-id: aca6ffa51ab95436a32b3bdf40dbf05a376dbdbe
2019-09-20 13:36:19 -07:00
Jun Wu
dcf2ddb57a changelog: add experimental.narrow-heads to change head() behavior
Summary:
Add a config option `experimental.narrow-heads`. Once set, "heads" get
redefined by a whitelist (visibility heads + remote names).

This is one step towards removing the blacklist (filteredrev) approach,
which does not scale with the new changelog design.

Reviewed By: sfilipco

Differential Revision: D17199845

fbshipit-source-id: 0feb300ad3ad7b2e33dd7781b4fc181233609a10
2019-09-20 13:36:19 -07:00
Durham Goode
73517f0380 lfs: add test for lfs-downgrade-after-rename issue
Summary:
Normally, when you push an lfs blob the server doesn't need to ever
download the lfs blob content because it can just compare the hashes. There's a
special case though, when a commit makes a blob go from lfs to non-lfs and the
previous version of the blob was a rename, then Mercurial must actually read the
file contents and compare it to know if it changed.

This adds a test to cover the case.

Reviewed By: quark-zju

Differential Revision: D17488079

fbshipit-source-id: 4313ee01e103d3ad13463e4774096d866d420b2e
2019-09-20 11:40:27 -07:00
Stefan Filip
5d7a31d5dd tests: add treemanifest diff test
Summary:
Tree manifests want to have a different order than flat manifests.
This difference in orders can cause algorithms like diff to give wrong
results. This test aims to validate that the treemanifest implemetations
work correctly for cases where the orders are different.

Reviewed By: quark-zju

Differential Revision: D17492500

fbshipit-source-id: eabb5d0fed5804b3d81c12667621ec6d38e0bfce
2019-09-19 19:45:08 -07:00
Jun Wu
8d4d0a66a2 context: wait for wlock for dirstate fixup if watchman reports fresh instance
Summary:
This is an attempt to solve issues that watchman state in dirstate stays stale
and users have pretty bad experience.

Normally, `hg status` is a "read-only" operation that works in a lock-free way,
and `status` still work if other hg commands are taking a lock. However,
`hg status` does need to update watchman state (clock, need-check file list) to
stay performant.

In case watchman reports "fresh instance" case, watchman also returns all file
paths in the working copy, which means the current `status` has very bad
performance, and the next `status` call can still be bad if the watchman state
in dirstate does not get updated.

This diff adds special handling of "fresh instance", waits for the lock, and
attempts to update the watchman state. It should reduce user frustration about
continuously slow `hg status` commands. In case it failed to update the
watchman state, also print warning messages so the user is aware of the issue.
For example, if there is an ongoing `hg histedit` that waits for the editor.

Reviewed By: wez

Differential Revision: D17468790

fbshipit-source-id: ad06bb1d5d13c6904db328c42a470112c3ee9940
2019-09-19 19:07:50 -07:00
Jun Wu
ba26a79d75 testutil/dott: fix delayed exception handling
Summary:
D17277286 changed the error type to SystemExit to swallow the traceback and
make the error cleaner. But that breaks `except Exception` used in `__del__`,
because `isinstance(SystemExit, Exception)` is `False` (surprise !).

Fix it by listing `SystemExit` explicitly.

Also remove the noisy `exception ... in __del__ ignored` message by removing
the `raise`.

Make sure the delayed exception will be handled by adding an `atexit` handler.

Reviewed By: sfilipco

Differential Revision: D17493283

fbshipit-source-id: 2301e318e06708804486d8625118210ae2e42817
2019-09-19 19:05:45 -07:00
Durham Goode
a0a2518bf6 hgsubversion: skip empty commits when pushing
Summary:
We're down to just one use of hgsubversion. In that use it's convienent
to skip empty commits when pushing. Let's add logic to bypass empty commits.

Differential Revision: D17452527

fbshipit-source-id: 5ef76df7d0a44f2d43f4ea0d8678e4174c0286ee
2019-09-19 15:44:19 -07:00
Jun Wu
099650d781 testutil/dott: remove unused logic in feature.py
Summary: Those belong to testtmp.py

Reviewed By: sfilipco

Differential Revision: D17483074

fbshipit-source-id: cbd27efca04ca5a9b8651f6612a5f78bedaea678
2019-09-19 11:41:41 -07:00
Jun Wu
b227af9b12 testutil/dott: do not rewrite $HGRCPATH
Summary: In case run-tests.py prepares $HGRCPATH, it should not be rewritten.

Reviewed By: sfilipco

Differential Revision: D17483075

fbshipit-source-id: d5d32aa65833dde68b37229802a39a75a32b37d0
2019-09-19 11:41:41 -07:00
Jun Wu
b737973619 merge: make it possible to manually specify a rename destination
Summary:
When the rebase destination has renamed a file, and copytrace failed to figure
out anything useful, make it possible to manually input the rename destination.

I'm using it to resolve conflicts caused by landing the bindings rename.

Reviewed By: xavierd

Differential Revision: D17367857

fbshipit-source-id: 55d9ed3a9641e40cc43518e9662fd803cbc00620
2019-09-18 20:44:05 -07:00
Ron Mordechai
4d1577a9c2 merge-tools: look for merge-tools inside repo when relative path is supplied
Summary:
This is useful when writing merge tools that are checked into the repo. We can now reference a tool in the repo. Suggested use case:

  [merge-tools]
  mytool =
  mytool.executable = scripts/mytool.py

Reviewed By: quark-zju

Differential Revision: D17342897

fbshipit-source-id: ffdb160dfea8404721c4fc94fdfcab2d86cca08d
2019-09-18 07:12:18 -07:00
Jun Wu
75ebf84a46 changelog: add a method to get public/draft nodes from remotenames
Summary:
One step towards redefining heads with remote heads.

Debugshell was teached to skip IPython for non-interactive input.

(For some reason most part of this diff got folded into the previous one)

Reviewed By: sfilipco

Differential Revision: D17199842

fbshipit-source-id: 1594658e3e5f2f2c51f817bc1074d28329df7786
2019-09-17 18:15:19 -07:00
Jun Wu
a0ede6c4c6 progressfile: include pid in progress information
Summary:
This provides a way to check if the hg process was gone unexpectedly.
The motivation was to make it less likely that Nuclide shows an hg operation
was ongoing but the process was long gone.

Reviewed By: xavierd

Differential Revision: D17372808

fbshipit-source-id: 19e51f8bbd0fdf14b7e0a4bdb8247d1b4277ee48
2019-09-16 19:02:38 -07:00
Jun Wu
bbd4b91102 remotenames: move 'remotenames' state to storevfs
Summary:
In the future the changelog would need to access 'remotenames' to figure out
public heads. Move the state file to svfs so it can be read by the changelog
object, which only has access to svfs.

Reviewed By: sfilipco

Differential Revision: D17199834

fbshipit-source-id: 9000e0d8e8bb8d398d6c77b5b395da904fef6418
2019-09-13 20:19:09 -07:00
Jun Wu
b2b78f66b9 test-fncache: remove the test
Summary:
We don't use fncache. It does not scale. The test break with narrow-heads.
This diff just removes the fncache test.

Reviewed By: singhsrb

Differential Revision: D17293478

fbshipit-source-id: b41dba333276ad63973b7556dfc400f4b33f6f5d
2019-09-13 17:36:17 -07:00
Jun Wu
14d1ae5689 amend: do not rebase obsoleted commits for next --rebase
Summary:
I hit this when editing the dag stack. This resolves a "BUG" in the
test-amend-nextrebase.t test.

Reviewed By: singhsrb

Differential Revision: D17357387

fbshipit-source-id: 309efe34dee71180abdbdb5a9fe2e7b731230051
2019-09-12 20:00:28 -07:00
Jun Wu
d678fe1702 encoding: replace 'ascii' with 'utf-8' automatically
Summary:
`ascii` was used as the default / fallback, which is not a user-friendly choice.
Nowadays utf-8 dominates:

- Rust stdlib is utf-8.
- Ruby since 1.9 is utf-8 by default.
- Python 3 is unicode by default.
- Windows 10 adds utf-8 code page.

Given the fact that:

- Our CI sets HGENCODING to utf-8
- Nuclide passes `--encoding=utf-8` to every command.
- Some people have messed up with `LC_*` and complained about hg crashes.
- utf-8 is a super set of ascii, nobody complains that they want `ascii`
  encoding and the `utf-8` encoding messed their setup up.

Let's just use `utf-8` as the default encoding. More aggressively, if someone
sets `ascii` as the encoding, it's almost always a mistake. Auto-correct that
to `utf-8` too.

This should also make future integration with Rust easier (where it's enforced
utf-8 and does not have an option to change the encoding). In the future we
might just drop the flexibility of choosing customized encoding, so this diff
autofixes `ascii` to `utf-8`, instead of allowing `ascii` to be set. We cannot
enforce `utf-8` yet, because of Windows.

Here is our encoding strategy vs the upstream's:

| item           | upstream |          | ours          | ours  |
|                | current  | ideal    | current       | ideal |
| CLI argv       | bytes    | bytes    | utf-8 [1]     | utf-8 |
| path           | bytes    | auto [3] | migrating [2] | utf-8 |
| commit message | utf-8    | utf-8    | utf-8         | utf-8 |
| bookmark name  | utf-8    | utf-8    | utf-8         | utf-8 |
| file content   | bytes    | bytes    | bytes         | bytes |

[1]: Argv was accidentally enforced utf-8 for command-line arguments by a Rust
wrapper.  But it simplified a lot of things and is kind of ok: everything that
can be passed as CLI arguments are utf-8: -M commit message, -b bookmark, paths,
etc. There is no "file content" passed via CLI arguments.

[2]: Path is controversial, because it's possible for systems to have non-utf8
paths. The upstream behavior is incorrect if a repo gets shared among different
encoding systems (ex. both Linux and Windows). We have to know the encoding of
paths to be able to convert them suitable for the local system. One way is to
enforce UTF-8 for paths. The other is to keep encoding information stored with
individual paths (like Ruby strings). The UTF-8 approach is much simpler with
the tradeoff that non-utf-8 paths become unsupported, which seems to be a
reasonable trade-off.

[3]: See https://www.mercurial-scm.org/wiki/WindowsUTF8Plan.

Reviewed By: singhsrb

Differential Revision: D17098991

fbshipit-source-id: c0ff1e586a887233bd43cdb854fb3538aa9b70c2
2019-09-12 15:06:36 -07:00
Jun Wu
0b501bab67 test-fb-hgext-treemanifest-treeonly-copyamend: stablize the test
Summary:
It can fail with:

  test-fb-hgext-treemanifest-treeonly-copyamend.t ...
  --- test-fb-hgext-treemanifest-treeonly-copyamend.t
  +++ test-fb-hgext-treemanifest-treeonly-copyamend.t.err
  @@ -124,6 +124,7 @@
     adding a/b/c/d/e/f/g/h/i/j/file3
     fetching tree '' efa8fa4352b919302f90e85924e691a632d6bea0, found via 9f95b8f1011f
     11 trees fetched over *s (glob)
  +  5 files fetched over 1 fetches - (5 misses, 0.00% hit ratio) over 0.00s

or:

  --- test-fb-hgext-treemanifest-treeonly-copyamend.t
  +++ test-fb-hgext-treemanifest-treeonly-copyamend.t.err
  @@ -124,6 +124,7 @@
     adding a/b/c/d/e/f/g/h/i/j/file3
     fetching tree '' efa8fa4352b919302f90e85924e691a632d6bea0, found via 9f95b8f1011f
     11 trees fetched over *s (glob)
  +  12 files fetched over 1 fetches - (12 misses, 0.00% hit ratio) over 0.00s

It fails more easily on Ubuntu. But it's also possible on CentOS.

Stabilize the test by allowing the optional output.

Reviewed By: singhsrb

Differential Revision: D17346110

fbshipit-source-id: ca6d1de5163e1b2bcb7bea5c619220d6f5e2c864
2019-09-12 10:53:23 -07:00
Jun Wu
43f081c18a test-scm-prompt: fix tests
Summary: `scm-prompt` is a bit special. They didn't trigger those tests when modified.

Reviewed By: wez

Differential Revision: D17346163

fbshipit-source-id: ffafc017373031905cbf1fc2f80a3a8e8a606094
2019-09-12 10:00:55 -07:00
Aleksei Kulikov
a0e092de37 snapshot: add a command to list the local snapshots
Reviewed By: markbt

Differential Revision: D17227370

fbshipit-source-id: 363f45431824b574cc298eb5c0f40c334f1d916b
2019-09-11 06:38:41 -07:00
Jun Wu
a55fe385eb dispatch: change 'no repository found' message
Summary:
Change the message so it looks more like a user error, not a crash in the
software. This is motivated by some people reporting `hg rage` crash with
`abort: no repository found` messages.

Reviewed By: sfilipco

Differential Revision: D17292658

fbshipit-source-id: 9988f54f2ff8fd48949bcd35c13309c117f3afc6
2019-09-10 18:29:50 -07:00
Xavier Deguillard
9e88acbdf7 remotefilelog: remove local loosefile generation
Summary:
The `remotefilelog.packlocaldata` has been on for a while now. Instead of
keeping the code around, let's simply remove it and fix all the tests that
assume a commit will generate loosefiles.

Reviewed By: quark-zju

Differential Revision: D17244837

fbshipit-source-id: e65ed16c9818be61be9ccbe19ce3fa18c890d70b
2019-09-10 13:10:42 -07:00
Jun Wu
57e6e896ad testutil/dott: simplify error messages
Summary:
The current error message is a bit noisy. Let's just get to the point about the
filename and line number that is interesting without tracebacks. This only
affects functions using the `autofix.eq` API, other kinds of exceptions will
have tracebacks as usual.

Before, run-tests.py (19 lines):

  --- test-empty-t.py.out
  +++ test-empty-t.py.err
  @@ -0,0 +1,14 @@
  +Traceback (most recent call last):
  +  File "hg/tests/test-empty-t.py", line 71, in <module>
  +    """
  +  File "hg/tests/testutil/dott/shobj.py", line 89, in __eq__
  +    autofix.eq(out, rhs, nested=1, eqfunc=eqglob)
  +  File "hg/tests/testutil/autofix.py", line 93, in eq
  +    raise AssertionError("actual != expected\n%s" % diff)
  +AssertionError: actual != expected
  +--- expected
  ++++ actual
  +@@ -1 +1 @@
  +-someheads
  ++allheads
  +

  ERROR: test-empty-t.py output changed

Before, run directly via python (13 lines):

  Traceback (most recent call last):
    File "test-empty-t.py", line 71, in <module>
      """
    File "hg/tests/testutil/dott/shobj.py", line 89, in __eq__
      autofix.eq(out, rhs, nested=1, eqfunc=eqglob)
    File "hg/tests/testutil/autofix.py", line 93, in eq
      raise AssertionError("actual != expected\n%s" % diff)
  AssertionError: actual != expected
  --- expected
  +++ actual
  @@ -1 +1 @@
  -someheads
  +allheads

After, run-tests.py (8 lines):

  --- test-empty-t.py:71 (expected)
  +++ test-empty-t.py:71 (actual)
  @@ -1 +1 @@
  -someheads
  +allheads

  ERROR: test-empty-t.py output changed

After, run directly (5 lines):

  % python test-empty-t.py
  --- test-empty-t.py:71 (expected)
  +++ test-empty-t.py:71 (actual)
  @@ -1 +1 @@
  -someheads
  +allheads

Reviewed By: xavierd

Differential Revision: D17277286

fbshipit-source-id: a48d4d1e817f67e221a901977e0c0f8bdc1a62ab
2019-09-10 13:01:33 -07:00
Jun Wu
1493c68d40 run-tests: make -i/--update-output/--fix autofix Python t.py tests
Summary:
Previously `python --fix test-foo-t.py` is the only way to autofix the test.
That's a bit annoying because `run-tests.py` has more features (ex. run many
tests together).

This diff changes `run-tests.py` to pass `--fix` to Python `-t.py` tests so
the autofix works in a familiar way. `--fix` was added as an alias to
`--update-output` to make it consistent with the Python UX.

Reviewed By: xavierd

Differential Revision: D17277287

fbshipit-source-id: e815a79895161862d844de165710cc36d6709727
2019-09-10 13:01:33 -07:00
Jun Wu
379d5e5490 testutil/dott: implement autofix for commands without outputs
Summary:
Comparing to `.t` tests, `dott` Python tests cannot autofix commands without
outputs.  This diff makes it able to do so. It's less strict than the AST
parsing (for example, it does not handle `#` comments precisely). But
practically it might be good enough. We can update it to use real AST parsing
if it becomes an issue.

This should make `dott` Python tests easier to use.

Reviewed By: xavierd

Differential Revision: D17277285

fbshipit-source-id: 11ef6ec4327a6547d49b544c63bc000a3c351947
2019-09-10 13:01:32 -07:00
Jun Wu
771fa19f18 testutil/dott: raise exceptions with better tracebacks
Summary:
The current `dott` library enforces `sh % "foo"` to output nothing. That's
done by checking in `__del__`. `__del__` is special and cannot raise exceptions
so the current code put exceptions in a "delayed" list and raise it later.
However, the "later" raise uses a new traceback that is useless.

This diff changes it to use `sys.exc_info` to save the traceback information
so we can re-raise with more accurate exception:

For example, the exception before looks like:

  % python test-empty-t.py
  Traceback (most recent call last):
    File "test-empty-t.py", line 71, in <module>
      sh % "cd .."
    File "fbcode/scm/hg/tests/testutil/dott/shobj.py", line 151, in __mod__
      return LazyCommand(command)
    File "fbcode/scm/hg/tests/testutil/dott/shobj.py", line 28, in __init__
      raise _delayedexception[0]
  UnboundLocalError: local variable 'code' referenced before assignment

The `shobj.py` in traceback is pointless.

With the change, it now looks like:

  % python test-empty-t.py
  Traceback (most recent call last):
    File "test-empty-t.py", line 71, in <module>
      sh % "cd .."
    File "fbcode/scm/hg/tests/testutil/dott/shobj.py", line 153, in __mod__
      return LazyCommand(command)
    File "fbcode/scm/hg/tests/testutil/dott/shobj.py", line 97, in __del__
      autofix.eq(out, "", nested=1, fixfunc=_fixoutput)
    File "fbcode/scm/hg/tests/testutil/autofix.py", line 74, in eq
      fix = fixfunc(code, parse, lineno, parse(path))
  UnboundLocalError: local variable 'code' referenced before assignment

Reviewed By: xavierd

Differential Revision: D17277288

fbshipit-source-id: 91f22b75b2e2efd632f5844b1d2554e7406be926
2019-09-10 13:01:32 -07:00
Xavier Deguillard
63e18be4d6 treemanifest: use Rust repack for server treemanifest repack
Summary:
We were still using the Python based repack, let's switch to the Rust one. As
far as I can tell, this code is unused, so the test change should be safe to
do.

Reviewed By: quark-zju

Differential Revision: D17207643

fbshipit-source-id: 89d0ba85327077dfc4e26c55ade3284beeb44b50
2019-09-10 11:36:00 -07:00
Aleksei Kulikov
b7ee506bfa snapshot: keep a list of snapshots in .hg/store/snapshotlist
Reviewed By: markbt

Differential Revision: D17226709

fbshipit-source-id: fefa31227f77295793ccaa3448f4488274f70848
2019-09-09 10:38:22 -07:00
Wez Furlong
0f9b49b65e hg: add debug command to trigger update hooks
Summary:
For Eden we currently have a gap in our post-mount behavior;
we don't perform the update hooks for a freshly cloned and mounted repo.

The thought is that we'll explicitly trigger them by invoking `hg
debugedenrunpostupdatehook` at the end of the mount sequence.

Reviewed By: quark-zju

Differential Revision: D17237197

fbshipit-source-id: 9c2212c61735068c287eb98761503ce31bfee8a6
2019-09-07 10:21:48 -07:00
Aleksei Kulikov
377e1200a7 snapshot: add -m option to set up a custom snapshot message
Reviewed By: markbt

Differential Revision: D17206496

fbshipit-source-id: a6e190ca87aa5309e359a5cecd6c6bc40634ca8d
2019-09-06 08:18:36 -07:00
Aleksei Kulikov
ccc05d0d65 snapshot: remove lfs dependency completely
Summary: Also remove debug commands that are strictly related to remote lfs.

Reviewed By: markbt

Differential Revision: D17184902

fbshipit-source-id: da38a2150212500bab62191ddcfab0990276605e
2019-09-06 08:18:35 -07:00
Aleksei Kulikov
22dce8230d snapshot: bundle metadata and the related files
Summary:
Instead of the lfs remote storage it was chosen to send the snapshot metadata via bundles.
Snapshot metadata consists of: the actual metadata blob + several other blobs (untracked files etc).
If we have several snapshot revisions in a single bundle, the blobs could repeat.
Then we should store each blob as a separate entry in a binary stream, keeping its id and contents.

Here we introduce a new bundle part type `"b2x:snapshotmetadataparttype"`.
```
1 byte of version info
[ # a list of binary entries, each corresponds to a separate file
  # (either a metadata file itself or a related -- externally stored -- file)
  <oid><length><data>
  :oid: is a 64char string with the hash of the file
  :length: is an unsigned int with length of the data
  :data: is binary data of length <length>, the actual file contents
]
```

So far there is an ongoing discussion on the exact format of serialization.
Actual state is at [the quip doc](https://fb.quip.com/R5OVAzabX8oo).

Reviewed By: markbt

Differential Revision: D17184222

fbshipit-source-id: 90f833ec71556e90d513e3be3f3efa7f870b037d
2019-09-06 08:18:35 -07:00
Aleksei Kulikov
732a5baa9a snapshot: use local snapshot storage instead of lfs
Summary: In the next diff I will replace remote lfs with bundle2

Reviewed By: markbt

Differential Revision: D17132405

fbshipit-source-id: a0dfff3ebad067abb0231cf31de08ae62affe7ce
2019-09-06 08:18:35 -07:00
Mark Thomas
465e91bbe5 debugmutation: don't use the unfiltered repo by default
Summary:
The `debugmutation` command uses the unfiltered repo to resolve the
user-provided revs.  It shouldn't do this unless the user passes `--hidden`.

Reviewed By: mitrandir77

Differential Revision: D17156722

fbshipit-source-id: 5ab7704acc598cf8b7c1640a3096ba0ce6ac73e9
2019-09-06 00:44:13 -07:00
Mark Thomas
8dc0110c6d debugmutation: improve format and render successors
Summary:
Update the debugmutation format to collapse long chains.  Add
`hg debugmutation -s` to follow the successor relationship (printing what the
commit became) instead of the predecessor relationship.

Reviewed By: mitrandir77

Differential Revision: D17156463

fbshipit-source-id: 44a68692e3bdea6a2fe2ef9f53b533199136eab1
2019-09-06 00:44:12 -07:00
Mark Thomas
d21fc6233a treemanifest: don't purge shared packs while repack is running
Summary:
If treemanifest finds there are too many shared packs (more than
`packs.maxpackfilecount`) then it will purge them.  This is a shame if there is
currently a repack in progress, as it will purge the packfiles from underneath
the repack, deleting lots of cache data that will be imminently repacked).

Skip the purge if there is a repack ongoing.

Reviewed By: mitrandir77

Differential Revision: D17155854

fbshipit-source-id: 20d46f29c252e508177b1fde08ca7a69841dcd7e
2019-09-06 00:40:52 -07:00
Jun Wu
0b570f65a7 stablerev: pass information using environment variables
Summary:
Instead of hardcoding `--target <target>` and hardcode `$2` in the script.
Let's just use environment variables so `target` and other things have explicit
names.

Explicit set `REAL_CWD` so the script can learn the current directory before
it gets reset to the repo root.

Reviewed By: xavierd

Differential Revision: D17213186

fbshipit-source-id: 6a4fc4cf2cbf6e2c623400bc6bc13f7758a46c49
2019-09-05 15:53:37 -07:00
Jun Wu
d66ac32198 metaedit: support -M / --reuse-message
Summary:
This makes metaedit support `-M / --reuse-message`, which I found handy when
rewriting prototype commits to formal commits.

Reviewed By: xavierd

Differential Revision: D17168991

fbshipit-source-id: fa768a2916ea3ef4db4c31a48989d10897379e92
2019-09-04 17:06:36 -07:00
Jun Wu
fd071d2076 cmdutil: change logmessage to take a repo
Summary:
Change `cmdutil.logmessage` to take a `repo` instead of `ui`. This makes the
next change easier.

Reviewed By: xavierd

Differential Revision: D17168990

fbshipit-source-id: 47c1707e5a9dbf06d07452b4c400903453992379
2019-09-04 17:06:35 -07:00
Jun Wu
1e027a58e7 fsmonitor: warn about slow full-repo scans
Summary:
I have seen multiple user complaints about slow hg commands that turned out to
be fsmonitor scanning the whole working copy. Print a warning in those cases.
Hopefully this can reduce our oncall burden a bit.

Reviewed By: xavierd

Differential Revision: D17170520

fbshipit-source-id: 8fd5721d123853136c84229d936c3e0c999f3d87
2019-09-04 14:14:51 -07:00
Jun Wu
5def63525a sigtrace: use smarttraceback and print to stderr
Summary:
Make sigtrace use smarttraceback so it prints more context.
As we're here, also make it print to stderr so we don't need to find the
traceback from /tmp.

Reviewed By: xavierd

Differential Revision: D17066277

fbshipit-source-id: 9a1000803fed27a71ec381b8ddbd76400dae99c9
2019-09-04 13:37:39 -07:00
Aleksei Kulikov
bead18e577 lfs: move abstract local blobstore to core mercurial
Summary: It will be used by snapshot extension too.

Reviewed By: markbt

Differential Revision: D17132134

fbshipit-source-id: 6c9fc285e0f1eb445bfa0abe0b6f4de4a1bd1db0
2019-09-04 11:09:36 -07:00
Aleksei Kulikov
c193470431 snapshot: prohibit regular checkout on snapshot
Differential Revision: D17093630

fbshipit-source-id: 4425c90fbdecfa3edc9f34f677e0be6b771aa0af
2019-09-04 11:09:35 -07:00