Commit Graph

140 Commits

Author SHA1 Message Date
Zeyi (Rice) Fan
8eca037626 make test-commit-interactive.t py3 compatible
Summary: This test tests Mercurial printing the correct encoding when the system is set to Japanese locale (CP932). The escape.py used in this test isn't Python 3 compatible due to byte-related operations. This diff makes it Python 3 compatible.

Reviewed By: quark-zju

Differential Revision: D19592535

fbshipit-source-id: 114dfcb004805045163be4a636ac703b4d24ea32
2020-01-28 11:24:25 -08:00
Zeyi (Rice) Fan
26859e4907 make test-check-execute.t py3 compatible
Summary: Apparently we tried to open an image file directly with `open()`. This does not work in Python 3 as it tries to read the file as string instead of bytes.

Reviewed By: farnz

Differential Revision: D19589327

fbshipit-source-id: 9c6388b704860f1f5dec199562741ac6e191d928
2020-01-28 11:24:24 -08:00
Zeyi (Rice) Fan
9015eda650 make test-help.t py3 compatible
Reviewed By: quark-zju

Differential Revision: D19589104

fbshipit-source-id: 0db455b2939643c6aa2d7b1ba68ad4bae376bbf4
2020-01-28 11:24:24 -08:00
Zeyi (Rice) Fan
76e325e30d make f py3 compatible
Reviewed By: sfilipco

Differential Revision: D19588237

fbshipit-source-id: 12130d67e59d8d488afb244c89673bd6c0075181
2020-01-28 11:24:24 -08:00
Zeyi (Rice) Fan
c0772d015f make printenv.py py3 compatible
Reviewed By: sfilipco

Differential Revision: D19588063

fbshipit-source-id: 78f2b433bb6a065e63241912b4cc0cf78bcbdd13
2020-01-28 11:24:23 -08:00
Zeyi (Rice) Fan
a334e11c88 make test-clone.t py3 compatible
Reviewed By: sfilipco, singhsrb

Differential Revision: D19587714

fbshipit-source-id: 574e6b7236b0954b621a8e15a36f2f1e50243418
2020-01-28 11:24:23 -08:00
Zeyi (Rice) Fan
f2690f21eb make dummyssh py3 compatible
Summary: This makes the `dummyssh` script Python 3 compatible so we can run it with Python 3 in tests

Reviewed By: sfilipco

Differential Revision: D19587078

fbshipit-source-id: 134b01f4d5e968cd9600c9358c7230a56e11f163
2020-01-28 11:24:23 -08:00
Genevieve Helsel
f0a27646b5 change maxint -> maxsize
Summary: ran print_function, maxint -> maxsize (maxint depreciated)

Reviewed By: lisroach, quark-zju

Differential Revision: D19588359

fbshipit-source-id: fc66b388a1775553a4b8e30a56fd1483800693d6
2020-01-28 10:37:53 -08:00
Jun Wu
a0bd794d55 run-tests: make --debug add debugger settings
Summary: This makes --debug more useful - crashes in tests trigger ipdb sessions.

Reviewed By: mitrandir77

Differential Revision: D19581174

fbshipit-source-id: 770c7b054dfce88082b67a9347ecaeb24d8583bc
2020-01-27 19:37:21 -08:00
Kostia Balytskyi
6bf47a9f5a hgtime: fix corner case of date range parsing
Summary: The docs promise that both `<` and `>` bounds are inclusive, so let's fix that.

Reviewed By: markbt

Differential Revision: D19580840

fbshipit-source-id: 13770a8e9351fe62f58e9a701b526a167752543a
2020-01-27 09:37:00 -08:00
Mark Thomas
d35692711e tests: convert test-rebase-obsolete to mutation
Summary:
Add `test-rebase-mutation.t`, based on `test-rebase-obsolete.t`, but instead
testing specifically for mutation and visibility behaviour.

Reviewed By: xavierd

Differential Revision: D19549473

fbshipit-source-id: c993686eab47985737eef17ab0f52f31d0929159
2020-01-24 14:47:39 -08:00
Mark Thomas
c0e72db0ad tests: enable mutation and visibility in some rebase tests
Summary:
Enable mutation and visibility for the existing tests that use evolution.

Excludes `test-rebase-obsolete.t` which specifically targets obsmarkers - this
will be converted to a new test in D19549473.

Reviewed By: quark-zju

Differential Revision: D19502220

fbshipit-source-id: 70b2828b60220c6887a6210e91bed01c2809cc51
2020-01-24 14:47:39 -08:00
Mark Thomas
398e175762 visibility: ensure visibleheads and store requirements are copied on clone
Summary:
When cloning a repo, ensure the store requirements and visibleheads files are
included in the clone.

Reviewed By: quark-zju

Differential Revision: D19502224

fbshipit-source-id: e3ead586fb1fe10def02d55e33810643c0c78bc8
2020-01-24 14:47:38 -08:00
Mark Thomas
39f8b3109f visibility: add visibleheads to journaled files
Summary:
The visibleheads file should be journaled like the other state files, so that
it is rolled back if a transaction aborts.

Reviewed By: quark-zju

Differential Revision: D19502226

fbshipit-source-id: c2b8d926ce97211411ca01f05e83e62cb77625b9
2020-01-24 14:47:37 -08:00
Lukas Piatkowski
8c7de41d8c arc/licenselint: add license linting for lua and sql
Summary: The fbcode/linttool has been updated to support lua and sql here D19467627, so updating arc rules to cover the new extensions

Reviewed By: zertosh

Differential Revision: D19534326

fbshipit-source-id: 4e615653acedcdf2da88e7dc4b443ad22af1324f
2020-01-24 06:13:28 -08:00
Stefan Filip
2dc14cf9a6 manifest: use Rust Tree Manifest by default
Summary:
The Rust Manifest is deployed practically everywhere.
Removing the C++ code from being compiled in Mercurial along with all of the cstore extension.

Reviewed By: quark-zju

Differential Revision: D19543248

fbshipit-source-id: d632e171175e6866563c1aa0808a099b67bd937d
2020-01-23 16:06:51 -08:00
Xavier Deguillard
8041ff9e82 bisect: remove revision number in output
Summary: Revision numbers are deprecated, let's not print them in the bisect output.

Reviewed By: DurhamG

Differential Revision: D19539678

fbshipit-source-id: 29bca3ee38cb390bdef8dd88cb912aa3dc452065
2020-01-23 15:54:00 -08:00
Xavier Deguillard
31b266d32c graft: remove revision number in output
Summary: Revision number are deprecated, remove it from the user output.

Reviewed By: DurhamG

Differential Revision: D19539679

fbshipit-source-id: 7fc618e832e0e5bb3464d2ed04967b062b6f182a
2020-01-23 15:53:59 -08:00
Xavier Deguillard
fe8855e9fb hgmain: initialize fbinit
Summary:
The memcache code assumes it's initialized, let's actually do it.

The test change is required due to fbinit installing its own SIGTERM handler
that shows a backtrace. Installing our own SIGTERM handler makes it closer to
what Mercurial does already.

Reviewed By: quark-zju

Differential Revision: D19518698

fbshipit-source-id: bc8c2311e65c9c00678756abae3979ccda4453ea
2020-01-23 08:57:22 -08:00
Stanislau Hlebik
f8ba0c99a5 infinitepush: introduce infinitepushbookmark path
Summary:
Previously we had infinitepush path which was preferred over a default path when a
specific revision was pulled or updated to (i.e. "hg pull" would use
paths.default, but "hg pull -r HASH" would use paths.infinitepush if this path
is set in the config).

I'd like to have infinitepushbookmark path which will be preferred for all
cases except for a single commit pulls.

Reviewed By: mitrandir77

Differential Revision: D19513490

fbshipit-source-id: 7f8b809f937aa2e082c2e9cd382709c6db619a4f
2020-01-22 14:05:38 -08:00
Jun Wu
fcaef9ed7e sparse: make sparse profile tracking cheaper
Summary:
Reading all the sparse profiles can be very expensive.
This changes the format we log to the cloud. It seems nobody is depending on the old format.

Reviewed By: wlis

Differential Revision: D19517306

fbshipit-source-id: 256e78acd4c24aceb533aa4d66b90ecf885fcbcd
2020-01-22 13:41:34 -08:00
Saurabh Singh
17ad617625 purge: move extension to core
Reviewed By: quark-zju

Differential Revision: D19506964

fbshipit-source-id: 173918346e90fadbaa52155786aa30fbd4951c8c
2020-01-21 20:49:08 -08:00
Mark Thomas
4958c4e342 tests: update tests-fb-*.t to use new tinit features
Reviewed By: quark-zju

Differential Revision: D19457679

fbshipit-source-id: d1010f0d2eee69ecdee5c3feba772bd3684d4cec
2020-01-20 02:45:17 -08:00
Mark Thomas
d2730c3ba0 tests: update tests-[r-x]*.t to use new tinit features
Reviewed By: quark-zju

Differential Revision: D19457676

fbshipit-source-id: 5bbab22ff0d98b725b63b906864037fae5fa5171
2020-01-20 02:45:16 -08:00
Mark Thomas
633382de11 tests: update tests-[i-p]*.t to use new tinit features
Reviewed By: quark-zju

Differential Revision: D19457680

fbshipit-source-id: 2be941f22525ed2d9f5a1aa3c92af38fb612eb46
2020-01-20 02:45:16 -08:00
Mark Thomas
b361a8d1bd tests: update tests-[a-h]*.t to use new tinit features
Reviewed By: quark-zju

Differential Revision: D19457677

fbshipit-source-id: 9f121837dfc6bf98ff4525c6535496b292409844
2020-01-20 02:45:15 -08:00
Mark Thomas
b654a9aae5 tests: use disable treemanifest in place of setconfig
Summary: Use `disable treemanifest` in place of `setconfig extensions.treemanifest=!`

Reviewed By: quark-zju

Differential Revision: D19457678

fbshipit-source-id: 47c8b3c4f4ed5cfc97275ca67afab4a86ffe7f0d
2020-01-20 02:45:15 -08:00
Mark Thomas
212cec117b tinit.sh: add configure for setting up standard configurations
Summary:
Add a new `tinit.sh` function: `configure`, which takes over from the
feature-enabling aspect of `enable`.

This provides a few features that are configurable:

  * `dummyssh` sets `ui.ssh` to `dummyssh`.
  * `mutation` and `mutation-norecord` enable mutation and visibility tracking
  * `evolution` enables evolution and disables mutation and visibility.
  * `noevolution` disables evolution, as well as mutation and visibility.

Since `enable` now only refers to extensions, it is joined by a corresponding `disable` to
disable an extension.

Some tests are updated to take advantage of these new functions.

Reviewed By: quark-zju

Differential Revision: D19427595

fbshipit-source-id: 03cc639918b4e667927330d3f3abf16121ebf161
2020-01-20 02:45:14 -08:00
Jun Wu
a78597c92d gitlookup: use nodemap index to speed up lookups
Summary:
Scanning through the plain git mapfile is slow. Use the nodemap to speed it up.
To avoid unnecessary risks, this only replace the "lookup" feature of the mapfile,
other features used by the hggit extension or wire-protocols are unaffected.

Reviewed By: singhsrb

Differential Revision: D19458406

fbshipit-source-id: 665184637d3e62590cc5d12ea3aa2563af4351d1
2020-01-17 19:21:40 -08:00
Jun Wu
8f694e04a1 pull: update remote/master unconditionally
Summary:
This is inteneded to solve multiple problems:

- Mitigate issues where our CI system does not enable remotenames in some
  random code paths, which leads to missing or stale `remote/master`.
  This further mitigates bad cases with narrow-heads' phase calculation
  where a stale `remote/master` can cause many commits to become draft
  incorrectly.
- Mitigate issues in `remotenames` where race condition can happen for
  pushrebase (remotenames does a "listnames" after the push operation).
  See D18601035 for a hacky workaround.

Reviewed By: DurhamG

Differential Revision: D19380940

fbshipit-source-id: 4481ff114d35be37c331c72ac561c2a0894206cb
2020-01-17 10:13:40 -08:00
Jun Wu
4a98b00205 changelog: still migrate non-public commits to zstore
Summary:
This makes it safer to do revlog-fallback -> server-fallback switch in the
future, because the server might not know all the draft commits.

Reviewed By: DurhamG

Differential Revision: D19416287

fbshipit-source-id: 8d69c1c5465b50710110370d84d5fb7c8ba6a6c4
2020-01-17 04:01:05 -08:00
Thomas Orozco
341e695ac5 hggit: don't crash in updatemeta if a commit does not have extras at all
Summary:
Right now, we check if extras contain `convert_revision` (and tolerate it not
being there), but if we don't have extras at all, we crash. Let's instead treat
"no extras" and "convert_revision not in extras" as the same thing.

Reviewed By: DurhamG, farnz

Differential Revision: D19428698

fbshipit-source-id: 74268dd3bde0f9cdb1b8164d2c2d322837803eaa
2020-01-16 10:13:12 -08:00
Mark Thomas
2815d67f41 mutation: update amend tests to use mutation and visibility
Summary:
Update all amend tests to use mutation and visibility.  For these tests, `mutation.record`
is disabled so that hashes do not change.

Most tests pass as-is.  A few tests have changes which are the results of slight behavioural
changes or bug-fixes compared with obsmarkers.

Reviewed By: quark-zju

Differential Revision: D19413580

fbshipit-source-id: 18696a08db69130b08f829366659783df4c9bcc1
2020-01-16 01:03:23 -08:00
Mark Thomas
05f1ef73b2 obsolete: add option for disabling evolution
Summary:
Allow disabling of evolution and obsolescence markers by setting
`experiemental.evolution=obsolete`.

Reviewed By: quark-zju

Differential Revision: D19411232

fbshipit-source-id: 89601a93cff1f87d04b7230fcb6c1e91cf074e92
2020-01-16 01:03:23 -08:00
Mark Thomas
eef0c650e7 mutation: make the mutationstore the source of truth for mutation entries
Summary:
Previously the mutation commit extras were the source of truth for mutation
information, and the mutation store served as a kind of cache.  This turned out
to be less useful than expected, as oftentimes commits are missing, and the
store is better indexed, so in practice using the store as the source of truth
is better.

This change makes the mutationstore the (sole) source of truth for mutation
data.  The extras are kept, but they are now only useful as human-readable
debug information, and to ensure the commit hash is unique.

Collecting the mutation information during commit creation is now done through
a new `mutinfo` object.  This is a dict with the same keys as the mutation
extras, for simplicity, but it is now passed through the `committablectx` and
used to generate the mutation store entry directly.

The `mutation.enabled` config option is now used to control all aspects of
enabling mutation.

The `mutation.record` config option is now only used to indicate whether the
mutation extras should also added to the commit.  Generally this should be set
to `true`, however the option is retained so that mutation extras can be
stripped by running `hg amend --config mutation.record=false`, which no longer
has the side-effect of not recording mutation information to the store.

The "remote commit" mutation record origin is now obsolete, and won't be
generated anymore.

Pushrebase now relies on the obsmarker information coming back from the server
in order to correctly generate mutation information.  We will need to change
this so that the server returns mutation records before we can fully deprecate
obsmarkers.

Reviewed By: DurhamG

Differential Revision: D19410650

fbshipit-source-id: 8d7094e4bfd8d8e97916898d899a8debd339485f
2020-01-16 01:03:22 -08:00
Xavier Deguillard
d784f6890c test-ssh.t: make it less flaky
Summary: This eliminates the broken pipes that have been more prevalent recently.

Reviewed By: DurhamG

Differential Revision: D19412153

fbshipit-source-id: 0062eb57ec07dfcbfee3ed9b77cf82cdcda09fb3
2020-01-15 14:05:06 -08:00
Joseph Friesen
1b504b8c93 add TCP support to fsmonitor
Summary:
This is part of proof-of-concept to test Watchman over TCP, a means
to accelerate hg workflows for the ASIC teams within Facebook.

For more context, refer to master task T55191832

Reviewed By: xavierd

Differential Revision: D18482107

fbshipit-source-id: 08ba3641854d81fe2a1cd8739bb4e9abcbc700ed
2020-01-15 13:43:36 -08:00
Jun Wu
dd1b9cc98d pull: use transaction
Summary:
Without this change, the next diff will fail tests with metalog programming
errors (write outside transaction).

Some test changes are caused by the being deprecated `rollback` command.

Reviewed By: DurhamG

Differential Revision: D19380939

fbshipit-source-id: 7c893d3025bb697102835670b8a38f8fb9a624c8
2020-01-14 21:02:27 -08:00
Jun Wu
ba2d83b3f8 pull: remove "new changesets" message
Summary:
Reverts https://www.mercurial-scm.org/repo/hg/rev/eb586ed5d8ce.

The colon syntax (x:y) is deprecated and is unsupported by segmented changelog.

Reviewed By: DurhamG

Differential Revision: D19394101

fbshipit-source-id: 8c66756f1035ab7660180716a2afa052879f384e
2020-01-14 21:02:27 -08:00
Durham Goode
d663a9dbdf fsmonitor: move warnings into filesystem layer
Summary:
Now that the post dirstate handlers are largely unused, let's move the
fsmonitor state warning into the fsmonitor filesystem. This also allows us to
remove the temporary _newid variable that was used to allow post-transaction
detection of if the transaction happened.

Reviewed By: quark-zju

Differential Revision: D18259479

fbshipit-source-id: da88638d34a80480bbeba8b1531d523785d72c30
2020-01-14 17:49:02 -08:00
Durham Goode
bca361cd3c dirstate: remove most of post dirstate handlers
Summary:
Previously the localrepo object contained a list of handlers to invoke
after status finished executing. This was used for 1) updating the fsmonitor
state with the new clock, ignore hash, and list of notable files, and 2)
updating the list of ignored files in treestate.

As part of moving all fsmonitor subtlities behind the filesystem abstraction,
this diff moves the fsmonitorstate file updating to be in the filesystem layer.
This also moves it inside the same transaction as the lookup file cleanup, which
removes the need for the hacky self._newid logic to detect if the dirstate was
changed by an external process.

(self._newid was previously added so that our second dirstate transaction, which
updates the fsmonitorstate, could determine if the dirstate had either been
changed by this process earlier in the lookup cleanup transaction, or if it had
been changed by an external process).

Reviewed By: quark-zju

Differential Revision: D18076655

fbshipit-source-id: c5175f61432f8e121b6baacd9587fcd288f67098
2020-01-14 17:49:02 -08:00
Durham Goode
af3292ea85 filesystem: refactor lookup marking to be more extensible
Summary:
A future diff is going to move the fsmonitor post-status fixups into
the same transaction as the lookup-marking logic. To prepare for this, let's
refactor the lookup marking logic to separate out the transaciton management
from the actual marking logic.

Reviewed By: quark-zju

Differential Revision: D18076656

fbshipit-source-id: 7711d5b086be7baaff0d9736cf51c6b0a46f237e
2020-01-14 17:49:01 -08:00
Durham Goode
a064e12d93 dirstate: move lookup resolution into the filesystem
Summary:
In an earlier diff we moved the lookup-state resolution from the repo
object to the dirstate object. Now that a filesystem layer exists, let's move
lookup resolution into the filesystem layer so that filesystem.pendingchanges
can now return perfect information.

Reviewed By: quark-zju

Differential Revision: D17749373

fbshipit-source-id: d03177e5e5374bd38c6c9adaa0fe8959052de19e
2020-01-14 17:49:01 -08:00
Xavier Deguillard
b1f3e37e43 tests: the Rust ContentStore always creates .hg/store/packs
Summary:
The Python one only does it when needed, let's fix the 2 tests that were
relying on this.

Reviewed By: quark-zju

Differential Revision: D19393501

fbshipit-source-id: 94e004999045264adce2ffa17b4697583ee0fcbd
2020-01-14 13:46:26 -08:00
Xavier Deguillard
f1c8af3297 remotefilelog: test for phase instead of localcontentstore
Summary:
The phases of a commit is a more precise metric for whether a change is public
or not, let's use this instead of testing for data to be present in the local
contentstore.

Reviewed By: quark-zju

Differential Revision: D19393502

fbshipit-source-id: b1c735c8400e8d5a1a7f7013d9a4a1ad423c5023
2020-01-14 13:46:26 -08:00
Stefan Filip
eca4fbc75d tests: increase timeout for mononoke starting
Summary:
We started to see a lot of tests failing with mononoke timing out at startup.
Increasing the timeout to mitigate the issue.

Reviewed By: krallin

Differential Revision: D19397440

fbshipit-source-id: a8037102b3c8389b98a7c49824fa013fd3e6a080
2020-01-14 12:52:05 -08:00
Jun Wu
aa64745a35 debugmetalog: add a command to show repo history
Summary:
The command shows how visibility, bookmarks, remotenames change in the repo
over time, using metalog data.

Also add this command to hg rage report.

Reviewed By: markbt

Differential Revision: D19358668

fbshipit-source-id: 9bddc039143b45c29c0c937ee60906ab93a2defe
2020-01-13 14:29:07 -08:00
Jun Wu
cfcf538578 color: define changeset.{public,draft} colors
Summary: The colors are from the our smartlog template. They're used in the next change.

Reviewed By: markbt

Differential Revision: D19358670

fbshipit-source-id: 7476f95767c5fcf1cccdce2119a2ab7ce45d270e
2020-01-13 14:29:06 -08:00
Jun Wu
3895af590a edenfs-client: use clidispatch IO and Error types
Summary:
This simplifies the error handling and makes it more compatible with things that
might capture the output, including the Python testing framework.

Reviewed By: DurhamG

Differential Revision: D19325642

fbshipit-source-id: 53de8b9a8294219e2b8e62831dce236841bd4cbb
2020-01-13 14:23:34 -08:00
Jun Wu
12eaf82291 hgcommands: add edenfs status fast path
Summary: Make `hg status` use the EdenFS Thrift path, similar to the telemetry wrapper.

Reviewed By: DurhamG

Differential Revision: D19325641

fbshipit-source-id: 14777a252d7cb433316511a2a1f1a6649e9cb020
2020-01-13 14:23:34 -08:00