Summary: I would like to call into this script directly from dott tests.
Reviewed By: quark-zju
Differential Revision: D17630870
fbshipit-source-id: 169ab3f1706d77cb1cdc1461b2a6fce2bc77a877
Summary:
Renaming it to `generateworkingcopystates`. This is a valid module name.
The goal is to convert this script to a module. While we are converting
tests it needs to be accessible in both script form and module.
Reviewed By: singhsrb
Differential Revision: D17611370
fbshipit-source-id: 0b2d0de71f0da7cd6efd7874c505d9aa77f7b296
Summary:
`util.hgcmd()` can report an incorrect hg path in the buck build case, since
the buck target is a wrapper script.
Fix it by setting the executable path explicitly.
Reviewed By: simpkins
Differential Revision: D17632684
fbshipit-source-id: d6c208fa1981180f6248bf7b57cc57031f53946e
Summary:
This test is currently failing and its not worth fixing since we only
needed this during the `WWW` Subversion deprecation which has already happened.
Reviewed By: quark-zju
Differential Revision: D17629893
fbshipit-source-id: 60f56b84a3cdcd8ddc56d46a155b1f14f2c00646
Summary:
Change the `//scm/hg:hg` target to use an `sh_binary()` rule that invokes the
`:hg_rust` binary with the proper environment so it can find its dependencies,
rather than copying the binary and all of its dependencies into a new
subdirectory.
In dev mode builds the `hg_rust` binary isn't guaranteed to work anywhere
other than its original location, due to the way that dev mode builds use
`$ORIGIN` in the binary's `RPATH` setting. This happened to work up until now
as the hg_rust binary did not have any separate libraries, but I plan to add
one on the `chg` library.
Reviewed By: quark-zju
Differential Revision: D17109104
fbshipit-source-id: ae8bb1126969f012d1d2fb7d04e80867a310b9a8
Summary:
We want to get rid of `hgsubversion` now that Subversion is almost
dead. Lets move the functionality still provided by the `hgsubversion`
extension to the `globalrevs` extension.
Reviewed By: quark-zju
Differential Revision: D17611443
fbshipit-source-id: 31e1b5a80ecf453e70a7e4ca929d805865579ab3
Summary:
Make the Python test pass, mainly:
- avoid `grep`, use `hg log -T` instead
- rewrite shell `for` loops
- rewrite `python foo.py` to inline python function
Remove a few less important, and hard-to-translate cases.
Reviewed By: xavierd
Differential Revision: D17611805
fbshipit-source-id: a2cd5de8815b60e632b3f46b8d4493575f9388f8
Summary:
The Python test only supports HGEDITOR=cat. Therefore update all HGEDITOR
usecases to `cat`.
Reviewed By: xavierd
Differential Revision: D17611801
fbshipit-source-id: f1fc4ed95bb424fbb1cb717ed8174fee1415ab9f
Summary:
Those tests use HGEDITOR in a weired way that cannot be simply migrated to
Python tests.
Those are subtle cases that don't really belong to the "import" feature.
We already have ideas changing how transaction work, in a way that in-memory
content always gets flushed to disk before running external processes. That
will make the related "in-memory state" less relevant.
Reviewed By: xavierd
Differential Revision: D17611800
fbshipit-source-id: c5bf9dc36362174dc42a16c91b7065a150e93220
Summary: Migrate to Python so the test runs faster (70s down to 4s).
Reviewed By: singhsrb
Differential Revision: D17608330
fbshipit-source-id: 9a2e21774ba8f2f18a14d45bbd640ada76070481
Summary:
We should be always using `globalrevs` in `crdump` instead of
`hgsubversion` but we had code supporting both the `hgsubversion` and
`globalrevs` during the `WWW` Subversion deprecation.
Reviewed By: quark-zju
Differential Revision: D17610488
fbshipit-source-id: e1cafa25bbc981cf6a2286ee1e6418194fec7853
Summary:
`hg hide <snapshot id>` should remove it from the list of snapshots (=> no sync and not shown in smartlog).
`hg unhide <snapshot id>` should restore the snapshot in the list, but do not unhide the underlying commit.
Reviewed By: markbt
Differential Revision: D17570798
fbshipit-source-id: 895f7b53464860b80f4f2498ea97f8db270b4d67
Summary:
The script does:
- Run the Python translate script.
- With `--verify` so the test will be disabled if it does not pass.
- With `--black` so the test file is formatted.
- With `--hgmv` so the test is marked as a "rename", and `hg log` on it can
trace back to the old history.
- Make a commit, so the manual edits are easier to review.
Reviewed By: xavierd
Differential Revision: D17609337
fbshipit-source-id: 0ce61e8a2e1a1d4424b1d3f15426f44a6fcaa739
Summary:
Change `debugobsolete` to take revsets so we don't need to use the shell
substitution feature. This makes it easier to migrate the test to Python.
Reviewed By: singhsrb
Differential Revision: D17608329
fbshipit-source-id: 5f1201b8f16aebe39de14fdbda17a7bfc485dba2
Summary:
The cycle tests will break with an upcoming change. Our desired cycle
handling behavior is different from upstream, and our main 2nd-order
history storage is the mutation store, which has its own cycle tests
in test-mutation-loops.t. Therefore remove this test section.
Reviewed By: singhsrb
Differential Revision: D17608331
fbshipit-source-id: 658b04cf9c30811a12614cef822a1cdf80551e67
Summary:
When there's a change in a binary file, it's useful for it to appear
in the output of hg diff in some format. The options today are just to get
a text message saying that there is a change or a large binary blob of the
change. This introduces a middleground where we see the hash of the final
binary.
Reviewed By: quark-zju
Differential Revision: D17579217
fbshipit-source-id: ca204bb0ee28bfef327d57eea8236d7421bf933f
Summary:
Storing nodes in a `set` does not make much sense because of possible aliases etc.
It is possible to remove duplicates via `util.removeduplicates` function.
List, on the other hand, preserves order and there will be less conversions during sync (later in the stack).
Differential Revision: D17397594
fbshipit-source-id: ba76e0a1f53516544f055355356d0beaf1c8bfa8
Summary:
Right now `hg pull -r REV` marks all pulled revs as visible.
This makes sense for regular commits (if they exist in the cloud, then they are not hidden).
For snapshots, it is wrong, thus we need not to mark snapshots as visible when pulling.
Differential Revision: D17289438
fbshipit-source-id: d16237b9e471f49bb44317104bc445472bedc16c
Summary:
Add a warning when a user enables a sparse profile on the command line that does not exist.
Triggering the check from multiple places, to not have to clutter the `_config` function. The `_config` function is called from other places as well (eg cloning a sparse repo) and I didn't want to add another guard parameter to it for such a benign functionality.
Besides the `_checknonexistingprofiles` function is only called in 3 situtations:
1. `hg sparse {enable|enableprofile}`
2. `hg sparse --enable-profile` (which is actually deprecated)
3. `hg clone --enable-profile`
Special care has been taken when cloning a sparse repo to do the check after the clone.
Reviewed By: markbt
Differential Revision: D17571442
fbshipit-source-id: 882dbe8b142bf192754dd17d0729d1bb0b472a83
Summary: Make the test use the modern features.
Reviewed By: sfilipco
Differential Revision: D17199835
fbshipit-source-id: 7301b6178e20b6286d765f12ffadb111bb348113
Summary:
With visibility and narrow-heads, undo can just track visible heads and replace
visible heads without messing up with mutation records. This diff implements
that.
Support for `--branch` is dropped. If it is actually used, we can implement a
visible head-based version in the future.
Reviewed By: sfilipco
Differential Revision: D17244563
fbshipit-source-id: 55b62a277018f456fa88903d9cc7c0edc9f7006b
Summary:
Copy the test with modern configs: visibility, mutation, remotenames, and
narrow-heads.
It does not pass right now, which will be fixed by upcoming diffs.
Reviewed By: sfilipco
Differential Revision: D17244559
fbshipit-source-id: 178a105d28dd6064ea040b2baba303493c700e25
Summary:
`tip` and `default` are changed to `master` (bookmark) to make it more
explicit. `log --hidden` was changed to `log -r predecessors(all())`.
I didn't investigate why `(+1 heads)` message get missing. I think we
should probably just remove the message.
Reviewed By: sfilipco
Differential Revision: D17199838
fbshipit-source-id: 0dbe982300f4c4c5e7429c0bf017e0cc97af6872
Summary:
Use narrow-heads for the test so we get some confidence that it works with our
production setup.
Some test changes:
- `predecessors()` revset now shows all commits regardless of "hidden" or not.
Reviewed By: sfilipco
Differential Revision: D17244564
fbshipit-source-id: 9053adbbb913c28d1e7b421155e6325c15790fc5
Summary:
Use narrow-heads for the test so we get some confidence that it works with our
production setup.
A `master` bookmark was added to mark commit public on the server repo.
Reviewed By: sfilipco
Differential Revision: D17244551
fbshipit-source-id: bf65c3aaf0a2fb46c9e7f1af36cc845ae40f44c6
Summary:
This will be used to preserve the `--hidden` behavior by using a more complete
list of heads.
A test introduced by 6563438219
was removed as it does not make sense to me to force changing read size from 65536 to 1.
That commit itself does not have useful commit message, and I cannot find email review thread for it.
Reviewed By: sfilipco
Differential Revision: D17264382
fbshipit-source-id: cc17e98eef4a4743e5207795a7054db59aa71fc0
Summary:
This test is causing trouble in upcoming changes. We don't really care about
the code path - they are migrating *ancient* formats to some formats that we've
been using for years.
For modern migration, like flat dirstate -> tree dirstate, we have seperate
code paths and seperate tests.
Reviewed By: sfilipco
Differential Revision: D17581267
fbshipit-source-id: 7154489ccf46bb4add1c1ec882eafae507af94d3
Summary:
It's possible for a file to appear in the `added` list but is not actually
changed. In that case the Rust manifest has a different behavior that returns
None that breaks the code. Fix it by "correcting" to p1 manifest node.
Reviewed By: sfilipco
Differential Revision: D17512350
fbshipit-source-id: 7c74ffb4e73ed1af5378fe509ed4f06a512995ae
Summary:
AR/VR Engineering does AOSP development using Git and Google Repo. This is rough at times because FB Dev Infra doesn't support these tools in a lot of critical use cases. This commit contains a very rough prototype of a hg convert extension to support Google Repo as a source.
What this commit does:
1. Finds all of the heads in all of the git projects in the Grepo and imports their commit histories into mercurial.
2. Merges those commits into a single commit history that represents the default manifest in the current branch.
What this commit doesn't do:
1. Explore the space of all manifests that have ever existed in the manifest project and update directory branches based on those.
Reviewed By: tchebb
Differential Revision: D14944252
fbshipit-source-id: b292025ccac06d02b347e35839215eedfd151a5d
Summary:
This updates readauthforuri to allow for multiple credentials for the same
host, with a preference for credentials that do exist on the filesystem, and
otherwise a fallback to configurable priorities.
Reviewed By: farnz
Differential Revision: D17528631
fbshipit-source-id: 0b8f255572415b9f60c1aa687728282451f637c4
Summary:
By ignoring unknown working parent, and treating working parent as `null`,
various operations wouold be painfully slow, because `status` would return the
entire working copyp as "untracked".
I hit it today due to some transaction related issues. What I did:
- `hg commit` from one terminal, keeping the editor
- `hg revert -i` from another terminal, waiting for lock
- `hg commit` completed
- `hg revert -i` appears to have loaded the updated dirstate, but not the
updated changelog. So it cannot find the new commit and prints the `ignoring
unknown working parent` message.
It's very hard to reason about the current related code. We'll probably get a
better transaction model to make this less likely to happen. So I didn't write
a test for the legacy code.
Reviewed By: xavierd
Differential Revision: D17532554
fbshipit-source-id: a06b56d78ef4cc129ee7d302c179668747881a69
Summary:
With 'narrow-heads', repoview filtering is bypassed. So we need another
way to make 'invisible' commits disapper from 'all'.
Reviewed By: sfilipco
Differential Revision: D17244549
fbshipit-source-id: 6fd4d4ff5ca96f300a5d79a796fb643060662e9b
Summary:
With 'narrow-heads', repoview filtering is bypassed. So we need another
way to make 'invisible' commits disapper from 'children'.
Reviewed By: sfilipco
Differential Revision: D17244556
fbshipit-source-id: 47d6f59523d910e5d9865d40251954d8de0ee055
Summary:
This resolves an issue where commits get selected incorrectly in the `x::`
case.
Reviewed By: sfilipco
Differential Revision: D17244561
fbshipit-source-id: e9e633509c0e335d24e13cef0ac06e242816e479
Summary:
See the test change. Basically, phases are defined by visibility heads and
remotenames. This resolves the issue after disabling repoview, `draft()`
contains unwanted commits.
Reviewed By: sfilipco
Differential Revision: D17244558
fbshipit-source-id: 84fc4a8b7830d613babf101079cb3c5b7909f23f
Summary:
Snapshots are essentially hidden commits that can be backed up/synced via infinitepush.
When we back up the repo state, we want it to access snapshots without explicitly specifying that they are hidden.
Differential Revision: D17260966
fbshipit-source-id: aa7f24043dddb052cab89c1ba939440887e99339
Summary: This is better that `json` because it will allow to store any binary data inside the metadata (e.g. file content).
Reviewed By: quark-zju
Differential Revision: D17464502
fbshipit-source-id: 3d559f390cc7827300fc51c23f004f1d833f0ab4
Summary: They became redundant and impose restrictions on the code.
Reviewed By: quark-zju
Differential Revision: D17463968
fbshipit-source-id: 83cb8d9dca037747e62f9e8c41a4081259c92e91
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