Commit Graph

97 Commits

Author SHA1 Message Date
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
Jun Wu
9f02e24674 run-tests: turn on format.use-zstore-commit-data
Summary:
This applies the new feature to all tests.

The tests do not use revlog fallback but we plan to use revlog fallback
in production for faster migration.

Reviewed By: DurhamG

Differential Revision: D18737259

fbshipit-source-id: 69633c7b2026fb3d19ca16d40368bded972efd86
2020-01-13 10:06:10 -08:00
Jun Wu
ffc85f7222 changelog: add a way to migrate up and down with zstore-commit-data format
Summary:
This makes it possible to use zstore instead of 00changelog.d to store commit
data. Right now it double writes to zstore and 00changelog.d if turned on.
In the future we can switch to only writing to zstore if 00changelog.i
alternative is available.

Some related configs were added for fallback strategy: revlog or server.
The revlog fallback allows us to do fast migration. The server fallback
(not implemented in this diff) allows us to stop depending on revlog.d.

Reviewed By: DurhamG

Differential Revision: D18737260

fbshipit-source-id: 3c9605f0babd8a215ee74bdf1275cc4e9dbd766c
2020-01-10 19:01:43 -08:00
Jun Wu
6266e2cad6 tests: improve test reliability for parsing dates
Summary:
We have seen issues parsing '0' as date somehow passes on OSX, and parsing
'Apr 2018' fails on Windows with GitBash. Let's workaround the tests while
I'm going to find better fixes.

Reviewed By: xavierd

Differential Revision: D19353054

fbshipit-source-id: c0302071964191b97eea6572ffd985f831db6791
2020-01-10 15:46:17 -08:00
Jun Wu
56b1f098dd bindings: move indexes and threading to bindings
Summary:
For some reason, our linker flag `-uinitthreading` no longer works in buck opt
build. This affects the `indexes` and `threading` Python extensions. Move them
to `bindings` to solve the problem.

Reviewed By: fanzeyi

Differential Revision: D19340538

fbshipit-source-id: 0c82b472f2916229d3c5e481954b69415b5b0dc2
2020-01-09 20:02:00 -08:00
Durham Goode
376f5e4be9 split: fix updating back to original commit on exit
Summary:
D19114546 introduced a new rollback mechanism where it updates to the
original commit if the user quits. Unfortunatley it only did the update if the
user had made a commit, so if they exitted immediately before making a commit,
it left them on the wrong commit and all their changes are pending.

Reviewed By: quark-zju

Differential Revision: D19334201

fbshipit-source-id: c959096adfa3563894578436e8252c037b50e32c
2020-01-09 13:55:27 -08:00
Jun Wu
5da0c6903d util: switch to Rust time parsing
Summary:
The Rust bindings now provide a subset of time parsing features.  Replace the
old Python implementation. This has multiple benefits:
- Strong gurarnatee that Rust and Python behave the same.
- Parse relative time (ex. `5 minutes ago`)
- Parse date beyound i32 range (ex. >= year 2038)

Reviewed By: DurhamG

Differential Revision: D18946332

fbshipit-source-id: 721f47bc5b2835d7ca0a05ab34ea4faa1a411a4e
2020-01-09 11:51:31 -08:00
Xavier Deguillard
38139a9785 tests: make file fetching messages optional
Summary:
The Rust ContentStore will not print these, and in order to better understand
what tests are broken with it enabled, let's make them optional.

Reviewed By: quark-zju

Differential Revision: D19318848

fbshipit-source-id: 87a1da510b51adc40a0d08157925a990456d3e9c
2020-01-09 07:46:59 -08:00
Jun Wu
24f403368b patch: fix applying hunks to renamed files
Summary: Previously the patch logic cannot apply hunks to renamed files. Fix it.

Reviewed By: DurhamG

Differential Revision: D19271024

fbshipit-source-id: 8ba82587dd2f4b84a1d5c7e51c4c86a5e11f0ca0
2020-01-08 19:26:23 -08:00
Jun Wu
6ec68995a3 test-record: add test case for selecting chunks in a renamed file
Reviewed By: DurhamG

Differential Revision: D19271025

fbshipit-source-id: c7d39dc6ecb3bafc304e983366b2b2965e26c472
2020-01-08 19:26:23 -08:00
Jun Wu
94c7fc65d8 run-tests: share chg server for all tests
Summary:
Previously, each test uses a separate chg server, because there are different
states in different tests. So chg servers cannot be reused across tests.

Nowdays chg servers are more stateless, and can be shared for all tests.
Do that to reduce chg server startup overhead.

With this change, `./run-tests.py --time $(rg -l chg-compatible)` went down
from 4:57 to 4:04 on my devserver.

A configuration `--chg-sock-path` is added for advanced use-cases.

Reviewed By: DurhamG

Differential Revision: D18924911

fbshipit-source-id: c2f7d84ee4cbfb5d599cfdc0ab47f922fae4a67e
2020-01-08 19:24:05 -08:00
Durham Goode
42e6ae2b55 tests: update case collision test for tag deprecation
Summary: The case collision test broke when I disabled tags.

Reviewed By: singhsrb

Differential Revision: D19321272

fbshipit-source-id: d59a0ad38b80f35931bbb4fb52e400d714ebbf37
2020-01-08 17:00:42 -08:00
Xavier Deguillard
83d46c7c3b pyrevisionstore: remove to_pyerr
Summary:
Python errors wrapped in a Rust Error would be incorrectly changed into a
RuntimeError instead of the original one. The map_pyerr method does the right
thing, and is also shorter, let's use it.

Reviewed By: quark-zju

Differential Revision: D19313883

fbshipit-source-id: 1ecb41a8eef9d41618905d6d00f199252d373f96
2020-01-08 12:52:43 -08:00
Durham Goode
d8663cb534 treestate: backout making it a hard requirement
Summary:
It turns out some old repos are still using the legacy treedirstate
format, which broke when I made this a hard requirement. Let's roll this back
for now.

Reviewed By: singhsrb

Differential Revision: D19313773

fbshipit-source-id: ded78be033cb04323a2e1d237059947dee509df9
2020-01-08 11:33:28 -08:00
Durham Goode
9778811573 tags: remove tags feature
Summary:
We no longer user tags in any of our repositories, so let's delete all
the code and remove some tech debt.

Previously drawdag was our last remaining use of tags, but in a previous diff I
switched that to use bookmarks.

Reviewed By: quark-zju

Differential Revision: D19042226

fbshipit-source-id: d7871c71c1026599aa70fdd806418347ea214a8a
2020-01-07 12:31:10 -08:00
Durham Goode
898149fa37 treestate: make treestate a hard requirement
Summary:
We want to delete all the non-treestate dirstate implementations. Let's
start throwing an exception if treestate is not enabled. We temporarily have a
bypass in case we break an important usecase in the process.

This also sets the standard new repo to be created in treestate mode, but adding
treestate to newreporequirements.

Reviewed By: quark-zju

Differential Revision: D19204621

fbshipit-source-id: 61c0c69ce6e559615ef570d2343bea78c1b5d5ee
2020-01-06 21:37:05 -08:00
Durham Goode
7286630863 rebase: prevent fast-foward rebases with conflicting changes
Summary:
Tweakdefaults adds the ability for `hg rebase -d` to simply fastforward
the user if the destination is a descendant of the current working copy parent.
If the working copy is dirty, it merged the files, potentially leaving the
working copy with merge conflicts that are hard to recover from.

A normal hg update disallows merges that would result in potential conflicts.
Let's update the rebase code to use the same merge logic, so fast forward
rebases simply abort if there are potential conflicts.

Reviewed By: quark-zju

Differential Revision: D19204198

fbshipit-source-id: 1b0c2c0fdab909eebe74d1a211dbfb2d780058cd
2020-01-06 15:06:50 -08:00
Jun Wu
a97842c8c2 fbscmquery: fix globalrev graphql query
Summary: `"globalrev"` is invalid. Use `GLOBAL_REV` instead.

Reviewed By: singhsrb

Differential Revision: D19271059

fbshipit-source-id: c26347b92b1b92a5f958f2f71dbdfdf3635a0876
2020-01-03 12:40:04 -08:00
Simon Farnsworth
deacaed311 Don't delete bookmarks in drawdag if there are none
Summary: In Mononoke tests, we have failures because `hg book -fd` aborts if it's not given any bookmark names. Fix up this function to not run `hg book -fd` if there are no bookmarks

Reviewed By: quark-zju

Differential Revision: D19251930

fbshipit-source-id: 2f1696d9207ad64a94c28941e72806d9b0e686fe
2019-12-30 15:41:14 -08:00
Jun Wu
c214a2de9e test-profile: fix the test
Summary: Use `debugpython` to replave `python`

Reviewed By: akushner

Differential Revision: D19221125

fbshipit-source-id: 68f5d83f9abe38174492fdaaf7496875696c4302
2019-12-23 16:37:10 -08:00
Jun Wu
3170aa7cbc test-parse-index2: remove the test
Summary:
The test is broken by D19190496 because the test uses some weird test cases
about legacy Pythons.

The "parseindex2" test is revlog-related. The revlog is kind of stable, tested
indirectly in countless tests, and is also going away. We don't run the code
on legacy versions of Pythons.The "parseindex2" test does not provide much
value. Therefore just remove it.

Reviewed By: akushner

Differential Revision: D19221126

fbshipit-source-id: 5b904d97caa47f92098435ee85c1bb8b725c9f84
2019-12-23 16:37:10 -08:00
Jun Wu
4dd04bf02f hgpython: replace hgpython interpreter with native Rust implementation
Summary:
The hgpython interpreter was used to run Python scripts in tests that might
rely on Mercurial modules.

The previous hgpython implementation is Python PAR based, which does not have
access to native Rust modules like bindings. Change it to use the native
"hg debugpython" implementation that is more compatible.

Reviewed By: markbt

Differential Revision: D19190496

fbshipit-source-id: 9791dbf9ba0ed92de702291faa9145f01b05ec40
2019-12-22 11:27:27 -08:00
Jun Wu
0c41aa6235 extensions: change error message to look non-fatal
Summary:
The current error message looks like fatal while it is not. Make it clear that
extension failures are not fatal.

Reviewed By: markbt

Differential Revision: D19166545

fbshipit-source-id: 7ce0231c90b0c5f50add15a12cb69b60b76dfcb1
2019-12-22 11:27:26 -08:00
Jun Wu
e5de1683e4 gitnode: try using commit extra first
Summary:
There are 3 extensions that can provide the `{gitnode}` template: "gitrevset",
"fbscmquery", "hggit". The last can read from commit extras. Fix the first two
to also read commit extras. At some point we need to unify the implementations.

Reviewed By: farnz

Differential Revision: D19198979

fbshipit-source-id: 24a0df0df4ceb7a9af9236a7f70babfd54e9802b
2019-12-20 16:14:25 -08:00
Jun Wu
2038472340 test-fb-hgext-sshaskpass: require linux to run
Summary:
The test is flaky in recent OSX builds.

The test is about a chg feature. Right now we only use chg on Linux. So limit
the test to Linux only.

Reviewed By: singhsrb

Differential Revision: D19191582

fbshipit-source-id: ce506f3f50c4368253caea0d73a647539c649735
2019-12-20 16:14:24 -08:00
Jun Wu
df5dce4138 test-convert-hg-source: require execbit to fix it on Windows
Summary:
After D19043330, the test is failing on Windows (no execbit).

When converting a repo, we almost always want to preserve the execbit. So let's
just skip the test if execbit is not available.

Reviewed By: singhsrb

Differential Revision: D19191556

fbshipit-source-id: 8e65d0b4b03833216ac8f28e2ae25f87de72304f
2019-12-20 16:14:23 -08:00
Durham Goode
b4f44d39a5 convert: delete support for gnuarchs, darcs, and bzr
Summary:
We don't support any of these VCS's, and we're not running any of the
tests. The code is just bit rotting. Let's delete them.

Reviewed By: quark-zju

Differential Revision: D19043710

fbshipit-source-id: 6e0d625c755cbc875755dc09b394bc730186db1d
2019-12-20 16:14:22 -08:00
Durham Goode
ff41e331e0 convert: remove tags from convert
Summary:
A future diff will remove the tags feature. Convert uses tags heavily
and it breaks a number of tests, so let's remove tags from the convert extension
before we remove tags entirely.

Reviewed By: quark-zju

Differential Revision: D19043330

fbshipit-source-id: 628d27fea1601931da45d1280eff981c5d12f93c
2019-12-20 16:14:19 -08:00
Durham Goode
218c83d574 tags: remove tip tag
Summary:
In a future diff we'll be removing tags. The most prevalent tag is
'tip', which shows up in a ton of test output. Let's drop that tag first, so we
can safely update the tests before we drop tags entirely.

Reviewed By: xavierd

Differential Revision: D18995058

fbshipit-source-id: 8c63710cd4ed567ea24e32724b8660f9006a61f1
2019-12-20 16:14:19 -08:00
Durham Goode
e1c73204f6 drawdag: use bookmarks instead of tags
Summary:
A future diff will remove tags entirely, so let's move drawdag to be
bookmark based.

Reviewed By: quark-zju

Differential Revision: D18995059

fbshipit-source-id: 70ef67259b37ef9821009d0145aa1e03c09b1309
2019-12-20 16:14:18 -08:00
Jun Wu
780faa2c10 tests: replace print in debugshell with ui.write
Summary:
Similar to D18926784.

Mercurial makes sure content written by `ui.write` is flushed, while there is
no such guarantee for `print`. When running using chg, it's more likely that
`print` content gets disappeared. Therefore let's use `ui.write` instead.

Reviewed By: ikostia

Differential Revision: D18926983

fbshipit-source-id: 960c189cc48bc3c89bb4f7993d2033dd45c52a67
2019-12-13 10:30:39 -08:00
Mateusz Kwapich
7e0e170db9 rename fbconduit extension to fbscmquery
Summary:
This is mostly result of:
```
  find . -type f -exec sed -i "s/fbconduit/fbscmquery/g" {} \;

```
`fbconduit` extension doesn't use conduit anymore so the name is just misleading.

Reviewed By: ikostia

Differential Revision: D18748843

fbshipit-source-id: 0d59e61ba7a96d86d9d1333d81255108cc3141bc
2019-12-13 03:23:25 -08:00
Xavier Deguillard
828f5b487d tests-flagprocessor.t: fix it
Summary: This looks like a fallout of D18666054

Reviewed By: quark-zju

Differential Revision: D18992910

fbshipit-source-id: c2392553a0489097f82b4073bbbca37b43f53bba
2019-12-12 20:36:43 -08:00
Xavier Deguillard
e7a3859828 convert: disable "getting files" progress bar
Summary:
This is showing in profile for about 10% of the time, let's just disable it as
getting files should be fairly quick.

Reviewed By: quark-zju

Differential Revision: D17841315

fbshipit-source-id: 08a61e19351fb5217431a3ca8993b8074f6d6c74
2019-12-12 14:15:05 -08:00
Xavier Deguillard
81365e9e9f localrepo: use repo.commitpending in repo.commitnotransaction
Summary:
There is no need to duplicate the code.

The test change are due to commitpending being called 3 times, vs 1 before. The
total amount of times {fileslog,manifestlog}.commitpending is called is unchanged.

Reviewed By: quark-zju

Differential Revision: D17841316

fbshipit-source-id: be33a126f913af8824a6d5ade17351707d39ed2f
2019-12-12 14:15:05 -08:00
Jun Wu
cf8efdb0d2 ui: use smarttraceback
Summary: The smart traceback is generally more useful.

Reviewed By: markbt

Differential Revision: D18666054

fbshipit-source-id: a96bb3e2919ed6692c4a7b965ad74cd2c8a66241
2019-12-12 13:47:49 -08:00
Xavier Deguillard
f0bf034842 test-check-code: use glob for st_*time error
Summary: This keep failing due to single line changes. Let's make it more robust.

Reviewed By: kulshrax

Differential Revision: D18963816

fbshipit-source-id: c56748560b619c4c682e8cc9e5710c607aa363fb
2019-12-12 11:41:22 -08:00
Xavier Deguillard
291db4b116 tests: fix test-fb-hgext-treemanifest.t
Summary: This looks like an omission from D18912817

Reviewed By: mitrandir77, ikostia

Differential Revision: D18935510

fbshipit-source-id: f72d95155c54d7eb36ff7c868f5e6b0ff6d6e39c
2019-12-11 10:20:59 -08:00
Mark Thomas
23fe5a7780 reset: add visibility tracking support
Summary:
The `reset` extension does its own obsmarker creation, rather than going
through `scmutil.cleanupnodes`.  This means it doesn't support new-style
visibility tracking.

Fix this by making it use `scmutil.cleanupnodes`.  This isn't completely
straightforward:

* The revset it uses to work out what to prune might accidentally include
  public commits (e.g. when you reset to a different public branch).  Make sure
  these are filtered.
* The tests originally had strip and obsmarker based tests.  The strip tests,
  when converted to obsmarkers and using `scmutil.cleanupnodes` stop working
  because they strip and revive the same commit over and over, which is an edge
  case that obsmarkers can't handle well.  Fix this by restoring the strip tests
  as strip tests.  A separate test handles the new-style visibility.
* Reset's behaviour is still a bit wonky.  If an ancestor of the source commit
  has other (non-bookmarked) descendants, then reset will try to prune those
  commits.  New-style visibility will ignore this, and this is tested in the
  new test.

Reviewed By: farnz

Differential Revision: D18912817

fbshipit-source-id: cc115333407cf67d339c24fcd0807ddedce2660d
2019-12-11 03:49:38 -08:00
Jun Wu
27a1ffa9d1 tests: fix test-doctor.t on Windows
Summary:
On Windows the error message is different. In this test we only need to verify
a command fails. Therefore remove the output and only keep the exit code.

Reviewed By: xavierd

Differential Revision: D18915580

fbshipit-source-id: bd1031170335918d507e6225b02541ec52bc62fa
2019-12-10 14:45:43 -08:00
Xavier Deguillard
d21a108280 tests: fix test-atomictempfile.py
Summary:
os.stat uses float values, use util.stat instead.

(Note: this ignores all push blocking failures!)

Reviewed By: singhsrb

Differential Revision: D18913982

fbshipit-source-id: 2df5ad0efbba3b18ef90669b4d1910ab39730e18
2019-12-10 11:57:12 -08:00
Jun Wu
2781801365 doctor: attempt to fix mutationstore, metalog and allheads
Summary:
Since we got `repair` APIs in the Python land, use them to attempt to repair
things.

This would hopefully be able to fix some user-reported issues, usually
caused by hard reboots.

Reviewed By: xavierd

Differential Revision: D18737907

fbshipit-source-id: ef3deccbf4a1c959cff7e3eb78771acd9ae9bd01
2019-12-09 20:02:09 -08:00
Jun Wu
a3129104fe tests: fix buck run :run_tests
Summary:
`buck run :run_tests -- ...` was added to be a buck version of `run-tests.py`.
However it does not work because the watchman path provided was invalided.

Reviewed By: xavierd

Differential Revision: D18892361

fbshipit-source-id: 8745a33e0d19b14f042ef1cd255d10c5737dffb1
2019-12-09 15:26:30 -08:00
Jun Wu
75a8173a10 tests: enable chg for 572 tests
Summary:
Add `#chg-compatible` to 572 tests that seem to pass with chg enabled.
This should make them run faster.

Reviewed By: xavierd

Differential Revision: D18870507

fbshipit-source-id: fe895e733efffc9286cd3d17c7a156c803124395
2019-12-09 15:26:29 -08:00