Summary:
Filename expansion is probably used a lot in our tests. I think that our
migration path is going to be simplified if we do filename expansion as
part of shobj. The current implementation works for the test that I was
migrating, test-revert.
Reviewed By: quark-zju
Differential Revision: D17630872
fbshipit-source-id: b8312e3d1fee9d331a661849a4cc5ef06ed5b091
Summary: Following a similar implementation to `chmod +x`.
Reviewed By: quark-zju
Differential Revision: D17630871
fbshipit-source-id: 115fe8fd0cca214f7f739bec66301c9116edb250
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:
This test checks that a directory without modifications between tree
and parent is not going to be materialized.
Reviewed By: quark-zju
Differential Revision: D17540173
fbshipit-source-id: 465f1e0410c42a55665bcd6903d75266c61d5e80
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: Remove the DFS diff implementation and replace it with the BFS implementation.
Reviewed By: xavierd
Differential Revision: D17618818
fbshipit-source-id: d486642caae924f866a200d3c82fa5a4cb7d5286
Summary: In order to support efficient data fetching, eventually BFS diff will need to be the default diff algorithm. As an initial step towards this, enable `treemanifest.bfsdiff` by default to validate that the BFS diff algorithm works as a drop-in replacement for the existing diff algorithm. Once we have confidence in this, we can land the next diff in this stack wherein we remove DFS diff entirely.
Reviewed By: xavierd
Differential Revision: D17618819
fbshipit-source-id: 444cb05874913e4eb267a24bd0596e6dde2e099e
Summary: To ensure feature parity between BFS diff and DFS diff, copy the DFS tests into the BFS module and ensure they pass.
Reviewed By: xavierd
Differential Revision: D17618820
fbshipit-source-id: b516abbfa4e231fdc383293d94d8965333f2ab99
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:
The use of `fdopen` was to change the buffer size. It's not fatal if buffer
size cannot be changed. This fixes a crash in `nohup hg root`.
Reviewed By: aditya7fb
Differential Revision: D17628883
fbshipit-source-id: 58f75e8e99fbe4cea8da2e3b48a092ee1331db6f
Summary: Python binding for working copy rust library. Walker is initialized with the root of the repo and the python matcher, iteratively returns the matching files in the working copy. Modified Walker and PythonMatcher to allow Walker to have Send trait.
Reviewed By: xavierd
Differential Revision: D17403235
fbshipit-source-id: b8b84928aac7c79c4388a8ba8aa5475aac0c5219
Summary:
Remove py from python matcher, because of RC, so python matcher will have send trait.
The python matcher needs to be stored by the python walker, and pyclasses can only
store data that is Send + 'static. Python pathmatcher methods should only be called
by python methods.
Reviewed By: xavierd
Differential Revision: D17511705
fbshipit-source-id: 00a4938fb00c30244ae04cb38362e8875c72fa47
Summary:
Define the `with_chg` feature when building hg_rust, and link in the chg C
code.
Reviewed By: ikostia
Differential Revision: D17109105
fbshipit-source-id: b8e210df19ff5695553d54047ed561cf7397738f
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:
According to the [manifest specification][1], the `path` attribute of a
`<project>` is "An optional path ... If not supplied the project name is
used". Respect this when we parse manifests ourselves.
We may want to consider importing the manifest-parsing module from `repo`
itself and using that instead of rolling our own parsing code. That would
prevent bugs like this from happening at all.
[1] https://gerrit.googlesource.com/git-repo/+/master/docs/manifest-format.md
Reviewed By: mwdevine
Differential Revision: D17542715
fbshipit-source-id: 13d963f4d9b8bf30bcd5f5593aef0ad9da90e7ec
Summary:
Python doesn't recursively import submodules, so we need to specify the
exact module we're using if we want to be able to access it. I don't know
why this works in Michael's development environment, but running the
converter fails locally for me unless I do this.
Reviewed By: mwdevine
Differential Revision: D17542716
fbshipit-source-id: 5b769e193a964f8499ee35033e61d71cf0ccef90
Summary:
Both xavierd and I noticed that characters typed in the terminal sometimes got
eaten. In my case, killing the background cloud sync processes solves it.
It turns out that the cloud sync erroed out like:
ServiceError: service error: 500 ...: Mysql error 1062. Duplicate entry 'fbsource-user/quark/default-remote-fbobjc/stable' for key 'PRIMARY' to db ...
And the `cloud sync` command started ipdb, which starts eating characters :/.
D17621846 should have fixed it. Let's just make it safer by redirecting
stdin of background processes to /dev/null.
Reviewed By: xavierd
Differential Revision: D17622250
fbshipit-source-id: d804aea4aa0aeb50bba0307f93a41eb94e8529fc
Summary:
xavierd encountered an issue where the user name becomes `test`. It turned out
to be chgserver was started using the `TESTTMP` environment and `util.getuser`
got defined wrong.
Fix it by making `util` redefine those functions for every chg invocation.
Reviewed By: xavierd
Differential Revision: D17622095
fbshipit-source-id: e12665317957eeeb85a1796c2bc252a487805cef
Summary:
It turns out that `ui.interactive()` only checks if input is a tty or not,
we also need to check output. That's `ui.formatted()`.
Reviewed By: xavierd
Differential Revision: D17621846
fbshipit-source-id: 5ed30e3dfd59ed8e50261d0b085fbfded43b1c19
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: We do not have network access in Sandcastle but Mercurial needs some external crates to build. So we download the tp2 crates io tar from LFS and set up cargo to be able to find external crates from it.
Reviewed By: wez
Differential Revision: D17407962
fbshipit-source-id: 4fe6be42d52c79340b33687d13723fcbcd63754e
Summary:
StringIO in Python3 expect strings, while we use it with bytes, the pycompat
module handles the difference properly.
Reviewed By: ikostia
Differential Revision: D17609687
fbshipit-source-id: 16a06c8ffceaed3d3c4acf93b94102e3c9d5c11d
Summary: The xrange function doesn't exist in python3, use the pycompat version instead.
Reviewed By: ikostia
Differential Revision: D17607522
fbshipit-source-id: c7b992071ad7933372033892ca99e240aa11ccba
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:
This will make using xdiff much easier.
In the next diff I'm planning to also add a function that converts the output of this function to a textual diff (the one with `+`'s and `-`'s).
Reviewed By: quark-zju
Differential Revision: D17551184
fbshipit-source-id: cda332e817f733d7aa32aeeb7b2d312d971826dd
Summary:
These are limited (not all features are exposed) bindings for xdiff - the diff library used by git and our version of hg. We need them to be able to generate diffs in Mononoke.
In the next diff I'll add more rust-friendly wrapper library.
Reviewed By: quark-zju
Differential Revision: D17548528
fbshipit-source-id: f23c8a65d11d2c5de8f0456d32883f16b19a98e2
Summary:
Both Index and Log requires their on-disk files to be append-only.
Detect non-append-only changes and return errors. This might help
us get better error messages if the case actually happens.
Reviewed By: markbt
Differential Revision: D17592914
fbshipit-source-id: b12791177ceb04f2373e93a679101e8b96e2bc98
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