Commit Graph

14393 Commits

Author SHA1 Message Date
Xavier Deguillard
f0e98e6104 tests: auto translate "test-bisect.t"
Summary:
This is done by running:

  ./translate "test-bisect.t"

Reviewed By: quark-zju

Differential Revision: D17620101

fbshipit-source-id: 461299cb6b74eac7a4febc2fa495ea65e65eea8e
2019-09-27 17:24:00 -07:00
Saurabh Singh
16da1518e5 perforce: remove p4fastimport
Summary:
I think we moved the last perforce based repository into `fbsource`.
From the Scuba logs, this doesn't seem to be used any more:
https://fburl.com/scuba/lc6vgy3v. We can revive the extension if required for a
future Perforce repository import.

Reviewed By: quark-zju

Differential Revision: D17630314

fbshipit-source-id: e3ca1a97974aff5fc262b8c724b70d4548280325
2019-09-27 16:31:34 -07:00
Stefan Filip
e96a1efb2d tests: migrate test-revert to dott
Summary:
The test is mostly automatic conversion and easy fixes.
No refactoring to simplify code, on the contrary, more
direct printing.

Reviewed By: quark-zju

Differential Revision: D17630869

fbshipit-source-id: 45e57de5fd965d0cc913c2612a6f52cb3c8bd977
2019-09-27 13:44:59 -07:00
Stefan Filip
45784815c1 dott: update shobj to expand filename patterns
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
2019-09-27 13:44:59 -07:00
Stefan Filip
9454158308 dott: update chmod to support -x
Summary: Following a similar implementation to `chmod +x`.

Reviewed By: quark-zju

Differential Revision: D17630871

fbshipit-source-id: 115fe8fd0cca214f7f739bec66301c9116edb250
2019-09-27 13:44:59 -07:00
Stefan Filip
e16d63bb2d tests: update generateworkingcopystates to work as a module
Summary: I would like to call into this script directly from dott tests.

Reviewed By: quark-zju

Differential Revision: D17630870

fbshipit-source-id: 169ab3f1706d77cb1cdc1461b2a6fce2bc77a877
2019-09-27 13:44:58 -07:00
Stefan Filip
40e989ef9a tests: rename generate-working-copy-states
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
2019-09-27 13:44:58 -07:00
Jun Wu
4b5455424a util: fix hgcmd on buck build
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
2019-09-27 11:57:47 -07:00
Saurabh Singh
7aab6858f0 test-hgsubversion-globalrevs: remove the test
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
2019-09-27 09:49:50 -07:00
Adam Simpkins
1baa5c4c07 change the scm/hg:hg target to use a sh_binary() rule
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
2019-09-26 20:17:40 -07:00
Xavier Deguillard
f8742bd2f0 tests: fix test-graft-t.py
Reviewed By: quark-zju

Differential Revision: D17618836

fbshipit-source-id: c670ceadea3588d4fc7e002dda9855c42c803d4d
2019-09-26 19:11:40 -07:00
Xavier Deguillard
db1d4d419b tests: auto translate "test-graft.t"
Summary:
This is done by running:

  ./translate "test-graft.t"

Reviewed By: quark-zju

Differential Revision: D17618837

fbshipit-source-id: f4b420677c868efd928d38e5d677d82c218b61e5
2019-09-26 19:11:39 -07:00
Saurabh Singh
b71a5bb279 globalrevs: remove the dependency on 'hgsubversion' extension
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
2019-09-26 17:48:40 -07:00
Jun Wu
31e7c9bc80 test-import: fix the test
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
2019-09-26 16:07:33 -07:00
Jun Wu
248e50dc8a tests: auto translate "test-import.t"
Summary:
This is done by running:

  ./translate "test-import.t"

Reviewed By: xavierd

Differential Revision: D17611799

fbshipit-source-id: 0db12e26dc62abccbf0b4adc2df31da76894aebb
2019-09-26 16:07:33 -07:00
Jun Wu
a3cafcbd18 test-import: only use HGEDITOR=cat
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
2019-09-26 16:07:32 -07:00
Jun Wu
e984f3d712 test-import: remove test cases about dirstate visibility in hooks
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
2019-09-26 16:07:32 -07:00
Jun Wu
aa14510cbb test-obsmarker-template: migrate to Python
Summary: Migrate to Python so the test runs faster (70s down to 4s).

Reviewed By: singhsrb

Differential Revision: D17608330

fbshipit-source-id: 9a2e21774ba8f2f18a14d45bbd640ada76070481
2019-09-26 16:07:32 -07:00
Jun Wu
fbe8875415 tests: auto translate "test-obsmarker-template.t"
Summary:
This is done by running:

  ./translate "test-obsmarker-template.t"

Reviewed By: singhsrb

Differential Revision: D17609746

fbshipit-source-id: 5e83b33c18aa213fc51116d5e3ad982952b584d4
2019-09-26 16:07:31 -07:00
Saurabh Singh
417fed34fb crdump: remove the dependency on 'hgsubversion'
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
2019-09-26 16:01:57 -07:00
Xavier Deguillard
e65af0a803 tests: test-help no longer disable treemanifest
Summary: See title.

Reviewed By: quark-zju

Differential Revision: D17605404

fbshipit-source-id: ea069c0b2bb306b4d44018a9a18a7359bbaf46b0
2019-09-26 14:45:35 -07:00
Aleksei Kulikov
65c288f459 snapshot: hide and unhide snapshots
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
2019-09-26 14:20:23 -07:00
Aleksei Kulikov
aaca5459b6 snapshot: add snapshot show command to view individual snapshots
Summary:
Need a cmd which is equivalent to `hg show <commit id>` for snapshots.
```
$ hg snapshot show <snapshot id>
<the regular patch message for commits>
  ? untrackedfile
  @@ -0,0 +1,1 @@  # diff-like content
  +fizz
  ! missingfile
  @@ -1,1 +0,0 @@  # diff-like content
  -foo
  ? .hg/merge/fc4ffdcb8ed23cecd44a0e11d23af83b445179b4
  @@ -0,0 +1,1 @@
  +b

  The snapshot is in an unfinished *merge* state.
```

Reviewed By: mitrandir77

Differential Revision: D17529050

fbshipit-source-id: 331c68f64a5ad71d6d77363a9dd1aed6e569efa5
2019-09-26 14:20:22 -07:00
Aleksei Kulikov
a829fee85c snapshot: show snapshots in smartlog
Summary:
Snapshots can be marked with letter `s`:
```
  s    changeset:   8:510948b1f172
  |\   parent:      7:fdf2c0326bba
  | |  parent:      6:55f800d93e34
  | |  user:        test
  | |  date:        Thu Jan 01 00:00:00 1970 +0000
  | |  summary:     snapshot
  | |
  | @  changeset:   7:fdf2c0326bba
  | |  parent:      2:fa948fa73a59
  | |  user:        test
  | |  date:        Thu Jan 01 00:00:00 1970 +0000
  | |  summary:     merge #2
  | |
  @ |  changeset:   6:55f800d93e34
  | |  user:        test
  | |  date:        Thu Jan 01 00:00:00 1970 +0000
  | |  summary:     merge #1
  | |
  o |  changeset:   5:afed36f05817
  | |  user:        test
  | |  date:        Thu Jan 01 00:00:00 1970 +0000
  | |  summary:     draft2
```

Reviewed By: mitrandir77

Differential Revision: D17533027

fbshipit-source-id: da22fef6c23933e2c91d6f5b4ff6d4adb2714e31
2019-09-26 14:20:22 -07:00
Jun Wu
a381eddae1 tests: add a script to translate tests to Python
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
2019-09-26 13:23:29 -07:00
Jun Wu
6833cec26d test-obsmarker-template: remove use of getid
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
2019-09-26 13:13:44 -07:00
Jun Wu
6d83c91c4d test-obsmarker-template: remove tests about cycles
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
2019-09-26 13:13:44 -07:00
Jeffrey Dunn
727359cd30 Add hash binary config option for hg diff
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
2019-09-26 09:22:18 -07:00
Aleksei Kulikov
08cdcd0ea2 snapshot: store a list of snapshots instead of set
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
2019-09-26 04:50:18 -07:00
Aleksei Kulikov
14d3872615 snapshot: make the snapshots invisible after pull
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
2019-09-26 04:50:17 -07:00
Henri Verroken
836347bf1b sparse: warn when enabling non-existing profile
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
2019-09-26 02:23:09 -07:00
Xavier Deguillard
26b38fdee3 tests: fix test-hook.t
Summary: The test recently broke.

Reviewed By: quark-zju

Differential Revision: D17590628

fbshipit-source-id: 2c4a6e911fa6ee268e2c434ade50672f489b398e
2019-09-25 19:17:43 -07:00
Jun Wu
3dab26fb41 test-visibility-cloudsync: enable narrow heads
Summary: Enable narrow-heads for this test.

Reviewed By: sfilipco

Differential Revision: D17199840

fbshipit-source-id: e91e17aa41a9056654711eca0f91a5584a9739f9
2019-09-25 17:22:53 -07:00
Jun Wu
d2fbf92c1d test-visibility-bundle: use narrow-heads
Summary: Make the test use the modern features.

Reviewed By: sfilipco

Differential Revision: D17199835

fbshipit-source-id: 7301b6178e20b6286d765f12ffadb111bb348113
2019-09-25 17:22:53 -07:00
Jun Wu
c7e4d733f3 undo: support visibility + narrow-heads directly
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
2019-09-25 17:22:53 -07:00
Jun Wu
b7c816c7a5 test-undo-narrow-heads: fork test-undo with modern configs
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
2019-09-25 17:22:52 -07:00
Jun Wu
9adf723d40 test-mutation-infinitepush: enable narrow heads
Summary: Enable narrow-heads for this test.

Reviewed By: sfilipco

Differential Revision: D17199836

fbshipit-source-id: 312bf6591e89a370a7a79add7fb730258a3711c9
2019-09-25 17:22:52 -07:00
Jun Wu
37ac464e35 test-mutation-pushrebase: use narrow heads
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
2019-09-25 17:22:52 -07:00
Jun Wu
abe72eab0a test-mutation-loops: use narrow-heads
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
2019-09-25 17:22:52 -07:00
Jun Wu
96eb1c3d1f test-commitcloud-sync-race: use narrow-heads
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
2019-09-25 17:22:51 -07:00
Jun Wu
ca89f70871 visibility: track all (hidden) heads
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
2019-09-25 17:22:50 -07:00
Jun Wu
ecbd4029e1 test-upgrade-repo: remove the test
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
2019-09-25 17:22:50 -07:00
Jun Wu
457010fbe2 repo: reuse manifest node if manifest write returns None
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
2019-09-25 12:16:35 -07:00
Michael Devine
0a3442c04a Prototype: repo-hg converter plugin
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
2019-09-24 14:38:31 -07:00
Thomas Orozco
0f73742898 readauthforuri: allow for multiple matches
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
2019-09-24 09:10:23 -07:00
Jun Wu
84da0f1df3 localrepo: make 'ignoring unknown working parent' a hard error
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
2019-09-23 18:59:43 -07:00
Jun Wu
cf13706ccb revset: fix 'all' for the 'narrow-heads' case
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
2019-09-23 17:11:22 -07:00
Jun Wu
54b1030be7 revset: fix 'children' for the 'narrow-heads' case
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
2019-09-23 17:11:22 -07:00
Jun Wu
ac07cb1123 revset: translate x:: to x::head() for 'narrow-heads' case
Summary:
This resolves an issue where commits get selected incorrectly in the `x::`
case.

Reviewed By: sfilipco

Differential Revision: D17244561

fbshipit-source-id: e9e633509c0e335d24e13cef0ac06e242816e479
2019-09-23 17:11:22 -07:00
Jun Wu
edd71d5534 phases: implement head-based phases
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
2019-09-23 17:11:21 -07:00