Summary: This newly added test keeps failing. Let's remove it from now.
Reviewed By: DurhamG
Differential Revision: D16381346
fbshipit-source-id: 11146d44fbbcd1e1c960fe4a0b6e3c28854f456d
Summary:
When rebasing or showing a diff for a commit which moved files, remotefilectx.ancestors (called by _tracefile) calculates the linkrev for each ancestor. Sometimes [1], this is a disaster:
* remotefilectx._linkrev executes its slow path and scans the change log.
* For each entry in the change log, remotefilectx._linkrev downloads trees if needed.
* Hg downloads trees one-by-one (as of D15964145).
remotefilectx.ancestors is only calculating linkrevs so it can sort the ancestors topologically. _tracefile only needs the ancestors to be ordered topologically, not by linkrev. remotefilectx.ancestors's calls to remotefilectx._linkrev are redundant.
Optimize _tracefile's use of remotefilectx.ancestors: order remotefilectx objects topologically (breadth-first) without sorting by linkrev. Create a new function for this purpose (topological_ancestors) to avoid possibly breaking other callers of remotefilectx.ancestors. As a side effect, make this new function return remotefilectx objects lazily, similar to the filectx.ancestors function.
On my machine, with warm caches, this speeds up 'hg diff -c' and 'hg rebase' for a modestly-sized commit. 'hg diff -c' takes 0.64 seconds, down from 65.6 seconds.
[1] Hypothesis: After 'hg amend', 'hg bundle' packages linkrevs which refer to the pre-amend commit (which is not serialized into the bundle) rather than the post-amend commit. 'hg unbundle' thus creates linkrevs referring to a missing commit.
Reviewed By: DurhamG
Differential Revision: D16297426
fbshipit-source-id: 407597d5e36fc06b33719c28f5ea5052e01dc7a3
Summary:
Testpilot can give us a lot of things for free, including the automatic
detection of flaky tests, disabling of them, re-enabling too, easy retries on
failure, timeouts, better tracking, and the list goes on.
At a first step, I'd like to make the testpilot runner the default in hgbuild
to get all the benefits listed above.
Reviewed By: quark-zju
Differential Revision: D16294182
fbshipit-source-id: aadfbac9eb05e9d64336daba7a50a6263e38c162
Summary: When all tests are skipped, run-tests.py no longer return a 80 error code.
Reviewed By: singhsrb
Differential Revision: D16380129
fbshipit-source-id: e84a3558df8c2c4ebef9a382a1172d859a47e220
Summary:
Streaming clone works only if we fetch all data from the server, however with selective pull feature hg specifies the particular heads it needs to pull. It causes downgrade in clone performance.
I decided to disable selective pull just before the clone operation, so the feature will be working everywhere else. Also I still store, even after clone, only "subscribed" remote bookmarks.
There are, however, artifacts of such behaviour, they are shown by changes in `test-commitcloud-sync-remote-bookmarks.t`: the whole tree of commits now is available locally, except of the remote bookmarks.
Reviewed By: simpkins
Differential Revision: D16223458
fbshipit-source-id: 0564ac23a16fe54d245e0a6ce9db5be4b6e3532f
Summary:
If one of the repo checkouts doesn't have remote bookmarks synchronization enabled, it must not affect the Cloud's remote bookmarks state.
I also changed `localserver` (is used for our tests) because Commit Cloud server deletes the "old" bookmark names from the db and inserts "new". However, the `localserver` just set the "new" books dictionary as a new state, which is not quite correct.
Reviewed By: simpkins
Differential Revision: D16338257
fbshipit-source-id: d77d9218b1c35ea1a097bbe7393d0910ce7b4d38
Summary: While checking if one public commit is an ancestor of another public commit, I used string hashes instead of binary nodes. Fixing.
Reviewed By: farnz
Differential Revision: D16338256
fbshipit-source-id: e27ed8d79ec9ed3a188cdee93366ab2f96526152
Summary:
By default the zsh completion will give me a list of bookmark names which personally I don't think it is useful at all.
I think making it giving me the list of draft commits is much better.
Reviewed By: quark-zju
Differential Revision: D16094724
fbshipit-source-id: 3493895a12ae02df011560b53dd5e55c8d183c79
Summary:
This was failing in our contbuild on centos. For some reason the memoization of
repo and ui was what made it fail.
Reviewed By: DurhamG
Differential Revision: D16368137
fbshipit-source-id: c3bec702bfa311f4be438f5aaf4939e6e725c63b
Summary:
As run-tests.py will be used with testpilot and at diff time, we do not
want to fail a run when all the tests were simply skipped. Let's make
that a success instead.
Reviewed By: quark-zju
Differential Revision: D16364297
fbshipit-source-id: ef8e912ddde91bd5be52784fceaf012857841eea
Summary:
The `msg` variable was unintentionally changed in the "killed" case. Use a
different variable name to solve it.
This diff changes:
[legacy][command_finish] killed!
exited -1 after 1.60 seconds
to:
[legacy][command_finish] <command> exited -1 after 1.60 seconds
Reviewed By: singhsrb
Differential Revision: D16360967
fbshipit-source-id: fb52025cd743a49c18116275c2eeac7b5c436e3b
Summary:
This allows us to preserve logs before the blackbox initialization.
In the edenscm usecase, we might want to log a "process start" event before
knowing the location of the blackbox.
Reviewed By: xavierd
Differential Revision: D16044038
fbshipit-source-id: 7f41994989bb3a83e9ded3014e5afeae00f3350c
Summary:
Use the new in-memory features from indexedlog and always create a blackbox
instance. This will allows us to buffer blackbox logs before `init` gets
called.
Reviewed By: xavierd
Differential Revision: D16044034
fbshipit-source-id: d137fdc3af8876c0c3dc3149c7478eb46025f457
Summary: This makes it possible to create RotateLog without writing to filesystem.
Reviewed By: xavierd
Differential Revision: D16044037
fbshipit-source-id: 451adaf8c2f97f0bd46bb2e5f42a33047d2ddfb0
Summary: This allows using the Log without side effects on the filesystem.
Reviewed By: xavierd
Differential Revision: D16044036
fbshipit-source-id: 20182a58a51e61deea87c98b87f5598b98dadbb2
Summary:
Change some functions to support emtpy dir, and create in-memory-only indexes.
This would allow creating in-memory-only Log.
Reviewed By: xavierd
Differential Revision: D16044039
fbshipit-source-id: 278662d3ab0093e4072e9321f3e8d4336b80ddfe
Summary: This allows Log to be constructed without a "dir".
Reviewed By: xavierd
Differential Revision: D16044040
fbshipit-source-id: 035416603f37af09be1ec75d1865e552ced89229
Summary: This allows using the Index without side effects on disk.
Reviewed By: xavierd
Differential Revision: D16044041
fbshipit-source-id: dba6edd76e7e7a09628d836d3aa50b2defcd2555
Summary:
This makes it possible to create an Index instance without providing a
file. It's used in later changes.
Reviewed By: xavierd
Differential Revision: D16044035
fbshipit-source-id: e7b52b9cb342cc82567c6583902eecd003ac0949
Summary:
This starts a series of changes to make indexedlog work in "in-memory-only"
mode. It is useful in 2 cases:
- buffering blackbox writes (short term)
- reused in Mononoke which does not want side-effect on disk (longer term)
Reviewed By: sfilipco
Differential Revision: D16044042
fbshipit-source-id: bdf35a9565e39e65c9ba4ddb949aa86412b4d496
Summary:
`#testcases` was translated to `for testcase in ...`, which is subtly
different since the for loop does not clean up states. Insert `cd $TESTTMP`
to make sure `setconfig` sets the global config, instead of the repo one.
Reviewed By: singhsrb
Differential Revision: D16363261
fbshipit-source-id: ea20c758e9131268f9329b98759e7423d9f1aa87
Summary:
This commit is just a simple refactor of the method for the resolving
the `svnrev` template keyword. In particular, we split the method so that it
can be easily wrapped by other extensions like globalrevs in D16361887.
Reviewed By: quark-zju
Differential Revision: D16361888
fbshipit-source-id: 9f20fb33afd2b286c4f30571fa257b8284f2bb54
Summary:
D16344714 made some rules only apply to edenscm/. Update the test to reflect
the changes.
Some formatting rules (ex. "string join across lines") are less important since
all files are formatted by black.
Reviewed By: xavierd
Differential Revision: D16360508
fbshipit-source-id: 9d38d710501eaf71c033ca49328774b8688fb5e0
Summary:
When we are migrating www to hg as source of truth, we would like to maintain the
reverse sync for some time in case we need to rollback.
In order to achieve that, we need to know the latest svn and hg commit to operate on. We
would like to record this information in the svn commit itself so it doesn't require
extra syncing and transaction.
In ordre to get this info, we can run `svn log -l 1` and parse the commit message from
there.
Reviewed By: quark-zju
Differential Revision: D16337012
fbshipit-source-id: acf66babdb48c07f95e9eb49daac0d3d3e6a96a0
Summary:
Those tests were converted using:
echo *.t | xargs -P20 -n1 python -m testutil.dott.translate --black --verify
They run 5x faster (via run-tests.py), and 10x faster (via python directly).
run-tests.py on old .t files, 652 CPU seconds:
% time ./run-tests.py `cat list-t.txt` --noprogress
.................................................................................................................................
# Ran 129 tests, 0 skipped, 0 failed.
./run-tests.py `cat list-t.txt` --noprogress 505.30s user 146.37s system 1451% cpu 44.899 total
run-tests.py on new py tests, 135 CPU seconds:
% time ./run-tests.py `cat list-py.txt` --noprogress
.............................................................................................................................
# Ran 125 tests, 0 skipped, 0 failed.
./run-tests.py `cat list-py.txt` --noprogress 55.73s user 78.80s system 744% cpu 18.061 total
vanilla python on new tests, 59 CPU seconds:
% time (for i in `cat list-py.txt`; do python $i; done;)
( for i in `cat list-py.txt`; do; python $i; done; ) 41.61s user 17.47s system 90% cpu 1:05.31 total
The new tests also have auto fix ability. `python test-foo-t.py --fix` will
autofix the code.
Reviewed By: xavierd
Differential Revision: D16172902
fbshipit-source-id: dda53990a7dfff5ac214c1237e4206a4d67e8e48
Summary:
Some linters or editers are unhappy with trailing spaces in heredoc.
Workaround it.
Reviewed By: xavierd
Differential Revision: D16344717
fbshipit-source-id: 63be8b992e2e4718faea1a55655c592f0e87b206
Summary: This allows FOO=bar to work in some tests.
Reviewed By: xavierd
Differential Revision: D16344718
fbshipit-source-id: b600d928a42e9e8e36a2ab9f5db97fd489878d02
Summary:
`.t` tests use `hghave` to test features, and can have `#testcases` for
multiple test cases. Implement them.
Reviewed By: xavierd
Differential Revision: D16209201
fbshipit-source-id: 1e8ea32d966f922efcf94e555cc9ab946cc85b27
Summary:
Tests use "source" to enable new features. One the main sources is
"library.sh", which includes remotefilelog utilties. Implement it.
Reviewed By: xavierd
Differential Revision: D16209209
fbshipit-source-id: 3bce4296861947e753e37bccf83c05129960dece
Summary:
Implement hg commands. This uses the dispatch code path to run hg commands
without startup overhead. It's possible that some side effects in the Python
world can cause unwanted behavior. Therefore a "reload" function was provided.
Once we have Rust as the entry point, we might still want to have some Python
binding to the Rust logic so the test code can use them.
Reviewed By: xavierd
Differential Revision: D16209204
fbshipit-source-id: e510f59629b46afd6b140c7bec9de07698b523b9
Summary: Implement a subset of coreutils so functions used by .t can run.
Reviewed By: xavierd
Differential Revision: D16209202
fbshipit-source-id: 953bebbfdc09cf191e8aa04c5ee1468c764b4360
Summary:
To make the code look better, indentation gets added to heredoc content.
Remove them. This replaces `inspect.cleandoc`. The difference is
`inspect.cleandoc` special handles the first line, which is undesirable.
Reviewed By: xavierd
Differential Revision: D16344716
fbshipit-source-id: c69c20607ddc5292bc6bcdd840587258276016ed
Summary:
There are multiple places that want to know whether the code is running inside
tests or not. Add `util.istest` for that and migrate those callsites to use it.
Reviewed By: xavierd
Differential Revision: D16344715
fbshipit-source-id: faa4261c83e4d889d59d63968b440954c4cac2ce
Summary:
TESTTMP was handled by run-tests.py. This diff extracts a subset of TESTTMP
logic so tests using testutil/dott can run via Python directly without using
run-tests.py
Reviewed By: xavierd
Differential Revision: D16209203
fbshipit-source-id: 7605505a725c30c9d07d83b7d3bfe92ec215cefc
Summary:
`run-tests.py` supports `(glob)`, `(re)`, `(esc)` for output matching.
Implement them.
Note: `(?)` is harder to implement. It is not implemented in this diff.
Reviewed By: xavierd
Differential Revision: D16209212
fbshipit-source-id: 52172158c41286a0673e6ae25bde2c774ac24c52
Summary:
run-tests.py uses common-pattern.py to normalize error messages to things
like `$ENOENT$`. Implement that behavior.
Reviewed By: xavierd
Differential Revision: D16209208
fbshipit-source-id: 3e609cc16442f80b844264f93dce9ea46517458d
Summary:
The testutil/dott module is to be "somehow" compatible with ".t" tests.
At its core, it emulates "bash" syntax using Python functions.
This diff adds the core "sh" syntax to call into Python functions.
The test code can be written as:
from testutil.dott import sh
sh % "echo foo" == "foo\n"
sh % "echo remotefilelog" > ".hg/requires"
sh % "cat" << "[extensions]\nrebase=" > ".hg/hgrc"
This is similar to ".t" test:
$ echo foo
foo
$ echo remotefilelog > .hg/requires
$ cat << EOF > .hg/hgrc
> [extensions]
> rebase=
> EOF
And is compat even after black formatting.
Reviewed By: xavierd
Differential Revision: D16172901
fbshipit-source-id: 7bb666e7e1621536ffdd6516542a468ac419d80a
Summary: The "eq" API is similar to `assert_eq!` in Rust, with the autofix ability.
Reviewed By: xavierd
Differential Revision: D16168821
fbshipit-source-id: bf7dcfd24c42dee30c54aeeaa71eccab78a8f0f6
Summary: Clear hintutil state after each command invocation so the code path can be reused.
Reviewed By: xavierd
Differential Revision: D16209207
fbshipit-source-id: 7c0ac4352aafa4c2b1fcd1c75e7f2a69daea0b47
Summary: For cases where the editor is "cat" or "cat>", avoid shelling out.
Reviewed By: xavierd
Differential Revision: D16209206
fbshipit-source-id: 1ee28e56a5e40a9b7c17dc1f9fbd7599e4b1b0d9
Summary:
The utility is used by a later change which provides the "autofix" feature for
Python code.
Reviewed By: xavierd
Differential Revision: D16168823
fbshipit-source-id: feb55a9e6ba5e78ad0f490cadeeafbcc1306e8ca
Summary:
Some of the check-code rules assume `mercurial.util` or `ui` is available,
which is not true for all Python scripts. Move those rules to a separate
set of patterns that only applies to `edenscm`.
Reviewed By: xavierd
Differential Revision: D16344714
fbshipit-source-id: 9cb5751887b8b2e1277cef617b47d520525a3cc2
Summary:
The difference between `&'static T` and `*const T` is, the former implies the
LLVM "noalias" intrinsic, which is not correct in this use. Replace it with
`*const T`.
Reviewed By: xavierd
Differential Revision: D16297631
fbshipit-source-id: 3052cb084968e504de1d2629540bf8fb9e58e17e
Summary: IPython.zip contains not only just IPyhton dependencies. Rename it to clarify.
Reviewed By: xavierd
Differential Revision: D16167579
fbshipit-source-id: c7bbd24c8efd58ed322bfb4520b9b2454b919978
Summary:
We've had issues in the perforce and svn converter where a node's parent was
itself, causing mayhem. Durham fixed this (D16189602) in the python code, but
since the python code is going away very soon, let's have this check in the
Rust code too.
Reviewed By: quark-zju
Differential Revision: D16346625
fbshipit-source-id: 54cec11a7822510ede91824eaf8663a9c1b7a0aa
Summary:
This exposes a subset of "dag" features to the Python world so we can actually
use it to build segments, and calculate common ancestors.
It does not expose the "SpanSet" concept yet, although that's planned.
Reviewed By: sfilipco
Differential Revision: D15404620
fbshipit-source-id: d05143f7b88bb398e96b5723a38d246ff02c1050