Summary: This will help figuring out "who called this command".
Reviewed By: singhsrb
Differential Revision: D17467214
fbshipit-source-id: f691fce5b5d3da765c4ce14fec7722accb2816b4
Summary:
This has a bunch of benefits:
- "duration_ms" counts Python startup overhead, and does not count the missing
"chg pager blocked" at the end of chg process.
It's more desirable than other kinds of "duration"s.
- Max RSS is logged. So we might get rid of a seprate wrapper eventually.
Reviewed By: singhsrb
Differential Revision: D17423799
fbshipit-source-id: 94121787506d435875a22cc03d638297120dad00
Summary:
This will provide the "fullargs" information needed by telemetry.
Log in "hgcommands", instead of "hgmain", or "clidispatch", because:
- "clidispatch" does not have argv[0], and might be called multiple times
(from Rust, then from the fallback Python -> bindings)
- Logs in "hgmain" won't be written to disk if chg is used.
I removed "env", since "hgcommands" does not have access to hgrc to decide what
env to log. It seems desirable if the "env" logging is move to a fb-only
backgroud logging binary.
Reviewed By: singhsrb
Differential Revision: D17423796
fbshipit-source-id: da3c54e916203f8368f8389fc7eed91e5299a75d
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
Summary: This makes the test runner compatible with the next change.
Reviewed By: singhsrb
Differential Revision: D17429690
fbshipit-source-id: 100d2c9f341cfc64be22137b7013f5b234005771
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
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
Summary: We don't use clonebundles. Remove the test to reduce support burden.
Reviewed By: singhsrb
Differential Revision: D17483628
fbshipit-source-id: f63070dcd7bb7283d249d33ac760bdebbbc4261a
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
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
Summary: The test contains issues in test-narrow-heads that need fixes.
Reviewed By: sfilipco
Differential Revision: D17244550
fbshipit-source-id: aca6ffa51ab95436a32b3bdf40dbf05a376dbdbe
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
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
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
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
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
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
Summary: In case run-tests.py prepares $HGRCPATH, it should not be rewritten.
Reviewed By: sfilipco
Differential Revision: D17483075
fbshipit-source-id: d5d32aa65833dde68b37229802a39a75a32b37d0
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Summary: Also remove debug commands that are strictly related to remote lfs.
Reviewed By: markbt
Differential Revision: D17184902
fbshipit-source-id: da38a2150212500bab62191ddcfab0990276605e
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
Summary: In the next diff I will replace remote lfs with bundle2
Reviewed By: markbt
Differential Revision: D17132405
fbshipit-source-id: a0dfff3ebad067abb0231cf31de08ae62affe7ce
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
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
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
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
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
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
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
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
Summary: It will be used by snapshot extension too.
Reviewed By: markbt
Differential Revision: D17132134
fbshipit-source-id: 6c9fc285e0f1eb445bfa0abe0b6f4de4a1bd1db0
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Summary:
Instead of `debugsnapshot` and `debugcheckoutsnapshot` we will use
`snapshot create|checkout`.
Reviewed By: markbt
Differential Revision: D16961037
fbshipit-source-id: 142d072672376c2ce6a248a4dceffdd94d56a4df
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
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
Summary: Convert global flags to `HgGlobalOpts` struct to make code shorter.
Reviewed By: sfilipco
Differential Revision: D16796407
fbshipit-source-id: b9d4c3dbec68c81908d439da4c353249347ca74a
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
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
Summary: Snapshots have invisible commits underneath them, so that flag is redundant.
Reviewed By: markbt
Differential Revision: D16916268
fbshipit-source-id: 294f34af5aa7942be0bb2b58f0dc65979d593157
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
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
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
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
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
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
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
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
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
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
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
Summary: This will make shell aliases fit in the normal hg command framework.
Reviewed By: sfilipco
Differential Revision: D16530521
fbshipit-source-id: c1b158bc2895add03fa92099564830e55e02f1b7
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
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
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
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
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
Summary: New degbugstore command prints contents of blob in store give filenname and hash.
Reviewed By: xavierd
Differential Revision: D16791780
fbshipit-source-id: d4529f3f368677b4f65a5772f82a1655552fefa5
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
Summary: Pass `uiconfig` to changelog so it can read config options.
Reviewed By: sfilipco
Differential Revision: D16683785
fbshipit-source-id: a64cfbe2cefa6b20ec695d2766bcfe878c764323
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Summary: Rebase tests can be unpredictible otherwise.
Reviewed By: farnz
Differential Revision: D16701186
fbshipit-source-id: 3c7af531c27ada15ace16c616799e0f569e285a2
Summary:
Created some classes and refactored the code.
Now it looks better. :)
Reviewed By: markbt
Differential Revision: D16690240
fbshipit-source-id: f26127d55c5cace7b88e225c85ec13cc278150c8
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
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
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
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
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
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
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
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
Summary: Previously, `|` was treated as an argument of a command. Fix it.
Reviewed By: singhsrb
Differential Revision: D16473729
fbshipit-source-id: 0c9a76cd01fc3a22bd43cd0b7d96ce9c6e61ce37
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
Summary: The test lists noticable features provided by the translator.
Reviewed By: xavierd
Differential Revision: D16473727
fbshipit-source-id: 617296886243a77b2af8e26d4ea576e63ff88fd3
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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