Commit Graph

14433 Commits

Author SHA1 Message Date
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
Kostia Balytskyi
d534067548 tests: fix hg_mononoke_run_tests runs
Reviewed By: singhsrb

Differential Revision: D17531223

fbshipit-source-id: 01a00388df3ff97e6dedd19cfeaadd12512eb5dc
2019-09-23 12:31:15 -07:00
Aleksei Kulikov
012583d390 snapshot: backup snapshot commits without --hidden flag
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
2019-09-23 04:58:11 -07:00
Aleksei Kulikov
ff51ebebf6 snapshot: use cbor to store metadata locally
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
2019-09-21 14:17:06 -07:00
Aleksei Kulikov
3c5be085f0 snapshot: remove the debug commands
Summary: They became redundant and impose restrictions on the code.

Reviewed By: quark-zju

Differential Revision: D17463968

fbshipit-source-id: 83cb8d9dca037747e62f9e8c41a4081259c92e91
2019-09-21 14:17:05 -07:00
Jun Wu
ffc0c49467 test-rebase-inmemory-nochanges: modernize the test
Summary: Use obsstore and disable treemanifest flatcompat mode.

Reviewed By: singhsrb

Differential Revision: D17512349

fbshipit-source-id: 8fcca211c024ce65ac2ea649ae5e23cea0200ea6
2019-09-20 18:32:38 -07:00
Jun Wu
ad62662ae5 hgcommands: log process tree
Summary: This will help figuring out "who called this command".

Reviewed By: singhsrb

Differential Revision: D17467214

fbshipit-source-id: f691fce5b5d3da765c4ce14fec7722accb2816b4
2019-09-20 18:32:37 -07:00
Jun Wu
11c712b09c hgcommands: log command finish event
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
2019-09-20 18:32:36 -07:00
Jun Wu
7d149487c0 hgcommands: log process start event
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
2019-09-20 18:32:36 -07:00
Jun Wu
484939a75d hgmain: make bindings a builtin module
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
2019-09-20 18:32:36 -07:00
Jun Wu
c3355e8af9 run-tests: use "hg debugpython" instead of "python" to run tests
Summary: This makes the test runner compatible with the next change.

Reviewed By: singhsrb

Differential Revision: D17429690

fbshipit-source-id: 100d2c9f341cfc64be22137b7013f5b234005771
2019-09-20 18:32:35 -07:00
Jun Wu
4e8707262f tests: change some 'python' to 'hg debugpython'
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
2019-09-20 18:32:35 -07:00
Jun Wu
b4a8819c72 tests: remove web / cgi related test
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
2019-09-20 18:32:35 -07:00
Jun Wu
03daebc5cb test-clonebundles: remove the test
Summary: We don't use clonebundles. Remove the test to reduce support burden.

Reviewed By: singhsrb

Differential Revision: D17483628

fbshipit-source-id: f63070dcd7bb7283d249d33ac760bdebbbc4261a
2019-09-20 18:32:34 -07:00
Jun Wu
33216d5840 commands: add a command to run Python interpreter
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
2019-09-20 18:32:34 -07:00
Jun Wu
9703bfb0fe repoview: allow disabling repoview filtering
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
2019-09-20 13:36:19 -07:00
Jun Wu
35b7e438c4 test-narrow-heads: add a test about narrow-heads issues
Summary: The test contains issues in test-narrow-heads that need fixes.

Reviewed By: sfilipco

Differential Revision: D17244550

fbshipit-source-id: aca6ffa51ab95436a32b3bdf40dbf05a376dbdbe
2019-09-20 13:36:19 -07:00
Jun Wu
dcf2ddb57a changelog: add experimental.narrow-heads to change head() behavior
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
2019-09-20 13:36:19 -07:00
Durham Goode
73517f0380 lfs: add test for lfs-downgrade-after-rename issue
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
2019-09-20 11:40:27 -07:00
Stefan Filip
5d7a31d5dd tests: add treemanifest diff test
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
2019-09-19 19:45:08 -07:00
Jun Wu
8d4d0a66a2 context: wait for wlock for dirstate fixup if watchman reports fresh instance
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
2019-09-19 19:07:50 -07:00
Jun Wu
ba26a79d75 testutil/dott: fix delayed exception handling
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
2019-09-19 19:05:45 -07:00
Durham Goode
a0a2518bf6 hgsubversion: skip empty commits when pushing
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
2019-09-19 15:44:19 -07:00
Jun Wu
099650d781 testutil/dott: remove unused logic in feature.py
Summary: Those belong to testtmp.py

Reviewed By: sfilipco

Differential Revision: D17483074

fbshipit-source-id: cbd27efca04ca5a9b8651f6612a5f78bedaea678
2019-09-19 11:41:41 -07:00
Jun Wu
b227af9b12 testutil/dott: do not rewrite $HGRCPATH
Summary: In case run-tests.py prepares $HGRCPATH, it should not be rewritten.

Reviewed By: sfilipco

Differential Revision: D17483075

fbshipit-source-id: d5d32aa65833dde68b37229802a39a75a32b37d0
2019-09-19 11:41:41 -07:00
Jun Wu
b737973619 merge: make it possible to manually specify a rename destination
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
2019-09-18 20:44:05 -07:00
Ron Mordechai
4d1577a9c2 merge-tools: look for merge-tools inside repo when relative path is supplied
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
2019-09-18 07:12:18 -07:00
Jun Wu
75ebf84a46 changelog: add a method to get public/draft nodes from remotenames
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
2019-09-17 18:15:19 -07:00
Jun Wu
a0ede6c4c6 progressfile: include pid in progress information
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
2019-09-16 19:02:38 -07:00
Jun Wu
bbd4b91102 remotenames: move 'remotenames' state to storevfs
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
2019-09-13 20:19:09 -07:00
Jun Wu
b2b78f66b9 test-fncache: remove the test
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
2019-09-13 17:36:17 -07:00
Jun Wu
14d1ae5689 amend: do not rebase obsoleted commits for next --rebase
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
2019-09-12 20:00:28 -07:00
Jun Wu
d678fe1702 encoding: replace 'ascii' with 'utf-8' automatically
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
2019-09-12 15:06:36 -07:00
Jun Wu
0b501bab67 test-fb-hgext-treemanifest-treeonly-copyamend: stablize the test
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
2019-09-12 10:53:23 -07:00
Jun Wu
43f081c18a test-scm-prompt: fix tests
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
2019-09-12 10:00:55 -07:00
Aleksei Kulikov
a0e092de37 snapshot: add a command to list the local snapshots
Reviewed By: markbt

Differential Revision: D17227370

fbshipit-source-id: 363f45431824b574cc298eb5c0f40c334f1d916b
2019-09-11 06:38:41 -07:00
Jun Wu
a55fe385eb dispatch: change 'no repository found' message
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
2019-09-10 18:29:50 -07:00
Xavier Deguillard
9e88acbdf7 remotefilelog: remove local loosefile generation
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
2019-09-10 13:10:42 -07:00
Jun Wu
57e6e896ad testutil/dott: simplify error messages
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
2019-09-10 13:01:33 -07:00
Jun Wu
1493c68d40 run-tests: make -i/--update-output/--fix autofix Python t.py tests
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
2019-09-10 13:01:33 -07:00
Jun Wu
379d5e5490 testutil/dott: implement autofix for commands without outputs
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
2019-09-10 13:01:32 -07:00
Jun Wu
771fa19f18 testutil/dott: raise exceptions with better tracebacks
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
2019-09-10 13:01:32 -07:00
Xavier Deguillard
63e18be4d6 treemanifest: use Rust repack for server treemanifest repack
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
2019-09-10 11:36:00 -07:00
Aleksei Kulikov
b7ee506bfa snapshot: keep a list of snapshots in .hg/store/snapshotlist
Reviewed By: markbt

Differential Revision: D17226709

fbshipit-source-id: fefa31227f77295793ccaa3448f4488274f70848
2019-09-09 10:38:22 -07:00
Wez Furlong
0f9b49b65e hg: add debug command to trigger update hooks
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
2019-09-07 10:21:48 -07:00
Aleksei Kulikov
377e1200a7 snapshot: add -m option to set up a custom snapshot message
Reviewed By: markbt

Differential Revision: D17206496

fbshipit-source-id: a6e190ca87aa5309e359a5cecd6c6bc40634ca8d
2019-09-06 08:18:36 -07:00
Aleksei Kulikov
ccc05d0d65 snapshot: remove lfs dependency completely
Summary: Also remove debug commands that are strictly related to remote lfs.

Reviewed By: markbt

Differential Revision: D17184902

fbshipit-source-id: da38a2150212500bab62191ddcfab0990276605e
2019-09-06 08:18:35 -07:00
Aleksei Kulikov
22dce8230d snapshot: bundle metadata and the related files
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
2019-09-06 08:18:35 -07:00
Aleksei Kulikov
732a5baa9a snapshot: use local snapshot storage instead of lfs
Summary: In the next diff I will replace remote lfs with bundle2

Reviewed By: markbt

Differential Revision: D17132405

fbshipit-source-id: a0dfff3ebad067abb0231cf31de08ae62affe7ce
2019-09-06 08:18:35 -07:00
Mark Thomas
465e91bbe5 debugmutation: don't use the unfiltered repo by default
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
2019-09-06 00:44:13 -07:00
Mark Thomas
8dc0110c6d debugmutation: improve format and render successors
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
2019-09-06 00:44:12 -07:00
Mark Thomas
d21fc6233a treemanifest: don't purge shared packs while repack is running
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
2019-09-06 00:40:52 -07:00
Jun Wu
0b570f65a7 stablerev: pass information using environment variables
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
2019-09-05 15:53:37 -07:00
Jun Wu
d66ac32198 metaedit: support -M / --reuse-message
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
2019-09-04 17:06:36 -07:00
Jun Wu
fd071d2076 cmdutil: change logmessage to take a repo
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
2019-09-04 17:06:35 -07:00
Jun Wu
1e027a58e7 fsmonitor: warn about slow full-repo scans
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
2019-09-04 14:14:51 -07:00
Jun Wu
5def63525a sigtrace: use smarttraceback and print to stderr
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
2019-09-04 13:37:39 -07:00
Aleksei Kulikov
bead18e577 lfs: move abstract local blobstore to core mercurial
Summary: It will be used by snapshot extension too.

Reviewed By: markbt

Differential Revision: D17132134

fbshipit-source-id: 6c9fc285e0f1eb445bfa0abe0b6f4de4a1bd1db0
2019-09-04 11:09:36 -07:00
Aleksei Kulikov
c193470431 snapshot: prohibit regular checkout on snapshot
Differential Revision: D17093630

fbshipit-source-id: 4425c90fbdecfa3edc9f34f677e0be6b771aa0af
2019-09-04 11:09:35 -07:00
Stefan Filip
edfeb9f529 treemanifest: remove delta storing of manifest entries when autocreate
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
2019-09-03 15:08:34 -07:00
Mark Thomas
013aa19333 mutation: don't allow divergence when rebasing
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
2019-09-02 03:13:51 -07:00