Commit Graph

547 Commits

Author SHA1 Message Date
Jun Wu
d1bc8e37f9 tests: remove helpers-usechg.t
Summary:
`chg` is now integrated as `#chg-compatible` by the test framework. The helper
script no longer works.

Reviewed By: markbt

Differential Revision: D21895009

fbshipit-source-id: 257ed081fbd1a6acc97afbfa2934134e389ab400
2020-06-10 19:29:37 -07:00
Jun Wu
69b33a286f tests: enable visibility for more tests
Summary: Real strip no longer happens.  Revision numbers are changed.

Reviewed By: markbt

Differential Revision: D21894317

fbshipit-source-id: cc335eb9fdbe99c4b7975fead825400474ea1016
2020-06-10 19:29:37 -07:00
Jun Wu
5bbee8b52d test-hook: enable visibility
Summary:
This requires `--hidden` for `hg tip` to show the pending commits in hooks.
The real fix would be handling pending visibility changes in metalog layer.

Reviewed By: markbt

Differential Revision: D21894321

fbshipit-source-id: 3b2296c9c38b37aee2c57eea0ad03c3acaab7507
2020-06-10 19:29:37 -07:00
Jun Wu
811aea8aae test-obsmarker-template: remove the test
Summary:
The test depends on lots of implementation details of obsmakers (ex. prune
markers, etc). In production we use mutation templates tested by
test-mutation.t. Therefore remove the test.

Reviewed By: markbt

Differential Revision: D21894319

fbshipit-source-id: 549423b1f5f45cf567b3c95e5fe3ccfa30b6695a
2020-06-10 19:29:36 -07:00
Kostia Balytskyi
8cda84ca26 infinitepush: add an ability to disable writes on servers
Summary: This will be very useful when we migrate to Mononoke.

Reviewed By: StanislavGlebik

Differential Revision: D21912115

fbshipit-source-id: 1ed2204f17f90152a67fd4e10b0ae61aacfc41d7
2020-06-10 19:29:30 -07:00
Jun Wu
3ab369827a test-clone: enable visibility
Summary: The test is changed because an extra file is copied during local-repo clone.

Reviewed By: markbt

Differential Revision: D21894318

fbshipit-source-id: 4417fb5473dc2cb98eda4dcc4d0484cc3b31fae2
2020-06-10 19:29:27 -07:00
Jun Wu
d6263b9529 test-absorb: enable visibility
Summary:
Revision numbers changed since strip no longer happens.
Updated revsets to use `.^` instead of revision numbers.

Reviewed By: markbt

Differential Revision: D21894309

fbshipit-source-id: 0bea56c9e8c6fd306dc225e4cb64ed69739a697a
2020-06-10 19:29:26 -07:00
Jun Wu
92e7b5feb2 visibility: turn on visibility by default
Summary:
It was turned on in production (facebook.rc) except for hg servers.
This mainly affects tests.

Reviewed By: markbt

Differential Revision: D21894313

fbshipit-source-id: 5f12620cfc11bb243e96fba12a07cbf0241c738b
2020-06-10 19:29:24 -07:00
Jun Wu
0fbd279db9 test-check-code: skip checking Python code in tests/
Summary: This makes tests more stable when changed.

Reviewed By: markbt

Differential Revision: D21894314

fbshipit-source-id: 73c36f79763643ccbe5dd52522fa8f22fa17a08a
2020-06-10 19:29:20 -07:00
Jun Wu
b5e2c381f0 tests: remove test-obsolete-divergent.t
Summary: We don't use obsmarker but mutation records. Therefore, remove the test.

Reviewed By: markbt

Differential Revision: D21894315

fbshipit-source-id: a1ccd8f78bea8adcba419b0d8ec99d52cd14d4e4
2020-06-10 19:29:20 -07:00
Jun Wu
6384b6aaba tests: remove test-obsolete-changeset-exchange-t.py
Summary:
We don't use obsmarker exchange but mutation record exchange.
Therefore, remove the test.

Reviewed By: markbt

Differential Revision: D21894311

fbshipit-source-id: 73d1f8031b2f601d133a98ffaa92a890bb59a656
2020-06-10 19:29:20 -07:00
Jun Wu
38d6c6a819 revlogindex: include NodeRevMap in RevlogIndex
Summary:
This will allow RevLogIndex to answer node -> rev and hex lookup queries.

Also change RevlogIndex::new to take file names so it can write back the
nodemap index when the index is lagging. That part of logic currently exists in
pyindexes + clindex.pyx, which are going to be replaced by revlogindex.

Practically, this will generate a `00changelog.nodemap` file in svfs, which is
temporarily unused, but will be used once clindex.pyx gets replaced.

Reviewed By: sfilipco

Differential Revision: D21626209

fbshipit-source-id: 297d9eff26a73c26558708f7a2290d4d8ba1e777
2020-06-02 14:00:34 -07:00
Mike Liu
200c15ef59 morestatus: improve status for bisect
Summary: Add more information for bisect states.

Reviewed By: quark-zju

Differential Revision: D21758828

fbshipit-source-id: 4bc617e50f70277428dc4c7c1be68b652d78b8f8
2020-06-02 08:07:23 -07:00
Stanislau Hlebik
fe5c05e7fa remotefilelog: re-introduce request chunking
Summary:
In D20286499 I added chunking of remotefilelog requests, however apparently the
place where I've added it is no longer used (xavierd mentioned it might be
because of migration to rust stores).

let's put chunking logic into getpack() function

Reviewed By: xavierd

Differential Revision: D21765414

fbshipit-source-id: b481ddf070f7bd86d0071cea7be2f9cc6ef1e5d9
2020-06-02 07:51:17 -07:00
Durham Goode
713fbeec24 datastore: support indexedlog as the hgcache write store
Summary:
Adds a remotefilelog.write-hgcache-to-indexedlog config which directs
all hgcache writes to the indexedlog.

This change also removes remotefilelog.indexedlogdatastore as it's on by default
now.

Reviewed By: xavierd

Differential Revision: D21772132

fbshipit-source-id: a71e188df2958fb4f8c4776da23ba87deccb3b79
2020-06-01 11:18:44 -07:00
Jun Wu
cd72c858fd fixcorrupt: sunset the extension
Summary:
`fixcorrupt` accesses changelog in a way that is going to cause trouble with
the next change. Since `hg doctor` can do what `fixcorrupt` does in production
setup. Let's sunset fixcorrupt.

Reviewed By: singhsrb

Differential Revision: D21780575

fbshipit-source-id: 5efec3f066a2929018ccc68b1f52d10a76e59637
2020-06-01 10:56:55 -07:00
Durham Goode
995a2852c1 configs: return bytes for config parsers validation results
Summary:
Previously the return type was String which, in Python 2, could turn into bytes or
unicode depending on the contents of the string. We always want bytes in Python
2, so let's use the Str type instead.

Reviewed By: quark-zju

Differential Revision: D21794189

fbshipit-source-id: 6493fbacab354a78476f522fc3c41b7336dbbdb1
2020-06-01 09:45:19 -07:00
Durham Goode
a9f8bbf176 treemanifest: always send draft commit trees
Summary:
We encountered an issue where an infinitepush bundle did not contain
trees for some of the commits it contained. This happened when multiple users
were working on the same branch.  Our previous heuristic decided to not send
trees if they weren't in the local store, but with us transitioning to Mononoke
(which enables draft commit data to be fetched ondemand) this invariant doesn't
always hold true.

Let's always upload trees for draft commits. Hopefully Mononoke can take over on
the server completely soon and we can get rid of all this special casing and do
normal discovery.

This is a revert of D7992502, but that was added because it was possible to pull
directly from svn which would result in public commits that didn't exist on the
server yet and therefore needed to send their trees.  Since svn is gone, this is
probably safe to change back.

Reviewed By: quark-zju

Differential Revision: D21697921

fbshipit-source-id: c1abaa061207222490b146ee52f7949be6fe4b2a
2020-05-29 13:21:05 -07:00
Xavier Deguillard
472ec19699 clienttelemetry: add wantslfspointers
Summary:
Rolling out LFSv2 on fbsource is a bit complex. Initially, the intent was to
roll it out via a server-only config and send pointers to say 5% of the
clients. The big snag in this is that LFS pointers are stored in Memcache, and
thus, a client who wasn't supposed to use LFS may end up reading a pointer from
Memcache, and issuing a request to the LFS server. Thanks to the way Memcache
works, this may lead to an avalance effect where everyone is fetching LFS
blobs, even if the server rollout is at a small percentage.

There are several solutions to this, the first obvious one would be to simply
not use Memcache for pointers, but that also means a forced connection to the
server, and a higher latency, ie: not a very desireable situation. An
alternative would be to have a proper capability exchange at connection time,
but that's unfortunately not feasible today due to the need to support the old
Mercurial server. Long term this is definitively the approach we want to go to,
and depending on the exchanged capabilities, we can even imagine using
different memcache keys automatically.

For now, we can hack this up by re-using the only free-form channel that the
client has to the server: clienttelemetry. Mononoke can then use the passed in
information to decide on whether to send LFS pointers (or not). This
unfortunately means that the rollout will be entirely client-side driven. To alleviate
the issue of Memcache keys being shared between clients wanting LFS pointers
and the ones not wanting them, a different Memcache key space will be used.

Reviewed By: StanislavGlebik

Differential Revision: D21765065

fbshipit-source-id: aebda3c567a827342b2fa96d374a06a23ea0ca34
2020-05-28 14:16:35 -07:00
generatedunixname89002005307016
f9358e566a suppress errors in eden - batch 1
Summary:
This diff is auto-generated to upgrade the Pyre version and suppress errors in eden. The upgrade will affect Pyre local configurations in the following directories:
```
eden
```

Differential Revision: D21687853

fbshipit-source-id: baf0d9bc33f86da63ea289690faca6cf4d566588
2020-05-21 19:32:35 -07:00
Mateusz Kwapich
d5e4d169f3 tests: fix tweakdefault tests
Summary: I didn't update it on my last diff.

Reviewed By: xavierd

Differential Revision: D21687344

fbshipit-source-id: 01c9662b9fd8c4670c2af34a999c69e6b93ed7f7
2020-05-21 08:44:39 -07:00
Mateusz Kwapich
611edcf4d7 histedit: improve compatibility with mutation&visibility
Summary:
When markbt converted histedit to be compatible with new style mutation
he missed a few spots.

This diffs adds a large test checking the that all the scenarios that were
supported with obsmarkers are supported with mutation now.

Reviewed By: markbt

Differential Revision: D21665484

fbshipit-source-id: a8a289910adb068a382e32f9d106dedc1573d413
2020-05-21 04:25:06 -07:00
Mateusz Kwapich
6a1760ea32 amend: on --to provide the correct argument to histedit
Summary:
The histedit goes down to the latest branching point by default which is not
always the right choice for `amend --to`

Reviewed By: markbt

Differential Revision: D21665485

fbshipit-source-id: d981d2216b5384f61c0082684eafa1e84eaeada8
2020-05-21 04:25:05 -07:00
Mateusz Kwapich
ba176f6937 amend: show the bug in amend --to
Summary:
This test addtion showcases a bug in `amend --to` when
a side branch is present

Reviewed By: markbt

Differential Revision: D21665486

fbshipit-source-id: 8c21e7a8cccfc6c313d3b7aa09be8309a662b9cc
2020-05-21 04:25:05 -07:00
Durham Goode
0ef51f2f5c config: fix test-debugdynamicconfig.t on Windows
Summary: I had hardcoded the path separator, which is wrong on Windows.

Reviewed By: singhsrb

Differential Revision: D21679423

fbshipit-source-id: 309c84b0698355654baee1dae7f201310e695c49
2020-05-20 18:48:58 -07:00
Durham Goode
3c8eb75a26 tests: fix test-debugdynamicconfig.t on Windows
Summary:
Looks like echo prints a \r\n which messes up the output. Let's use
printf to force it to use \n

Reviewed By: xavierd

Differential Revision: D21670125

fbshipit-source-id: f991c9c9fb55720bb68a3f71e8ddd3b4f16b5375
2020-05-20 14:00:54 -07:00
Durham Goode
98d428929b config: fix config validation at clone time
Summary:
At clone time we apply dynamic configs in memory, instead of loading
them from disk. The validation logic operated on the config value's location
field, which isn't set for data that comes from in memory. So we need to update
the validation logic to also consider the value source if location is not set.

Reviewed By: quark-zju

Differential Revision: D21664205

fbshipit-source-id: 8460c58c6d654780048de51ada8178c70ff0a9e6
2020-05-20 13:35:28 -07:00
Durham Goode
75c96be5ff configs: don't write dynamic config if it hasn't changed
Summary:
We kick off a background process every 15 minutes or so to compute the
new dynamicconfig. If the config hasn't changed, we should just touch the file
instead of rewriting the whole thing.

Reviewed By: quark-zju

Differential Revision: D21653098

fbshipit-source-id: 9d53d2a636cff082cd048994255cc809ce1b0221
2020-05-20 13:35:28 -07:00
Durham Goode
9f6f200a08 configs: version dynamic configs
Summary:
If we release a new version of Mercurial, we want to ensure that it's
builtin configs are used immediately. To do so, let's write a version number
into the generated config file, and if the version number doesn't match, we
force a synchronous regeneration of the config file.

For now, if regeneration fails, we just log it. In the future we'll probably
throw an exception and block the user since we want to ensure people are running
with modern configuration.

Reviewed By: quark-zju

Differential Revision: D21651317

fbshipit-source-id: 3edbaf6777f4ca2363d8617fad03c21204b468a2
2020-05-20 13:35:28 -07:00
Mark Thomas
c1e91b47fc cmdutil: remove graph-renderer hint
Summary: This hint has served its purpose.  Remove it.

Reviewed By: farnz

Differential Revision: D21658927

fbshipit-source-id: 0395fa2cb898732b2c64154104c703a428f62864
2020-05-20 08:06:21 -07:00
Durham Goode
f0d7044aff configs: apply dynamicconfig during clone
Summary:
During clone the hgrc.dynamic file doesn't exist and doesn't even have
a place for us to generate it to. Let's instead generate and apply the config in
memory.

In the future, if generate fetches data from the network, this will mean clone
would depend on the network, since if generate fails the clone would fail. In
some situations this is desirable, since users shouldn't be cloning without our
approved configs, but if it causes problems we could probably tweak generate to
support an offline mode.

Reviewed By: quark-zju

Differential Revision: D21643086

fbshipit-source-id: d9a758207738d5983213d95725061517e0aa17db
2020-05-19 19:51:27 -07:00
Jun Wu
428cfc7b6b tests: update test-extensions.t
Summary:
The Rust version command does not support `-T` and does not read
`__version__.py`. Remove tests about them. As we're here, also remove tests
about 3rd-party extension version checking as we bundle all extensions.

Reviewed By: xavierd

Differential Revision: D21648591

fbshipit-source-id: 97c9e2ff3d224ff12b34801a1af07532d9e9bff5
2020-05-19 19:09:56 -07:00
Meyer Jacobs
341fbdc1aa debugging: Implement "debugdetectissues" command for detecting signs of repository issues
Summary:
Implements a "debugdetectissues" command, which runs a series of checks on the repository meant to detect potential issues, logging the data to Scuba so that we can determine how common certain issues are, and under what conditions they appear.

Future extensions of this change may involve merging the functionality into hg doctor, and setting the command to run automatically in the background on some interval.

Reviewed By: DurhamG

Differential Revision: D21558170

fbshipit-source-id: a878ae1804d5f11c83a574e0dc3c802b564d2ced
2020-05-19 18:11:29 -07:00
Mark Thomas
513a4f8426 color: don't disable colors if HGPLAINEXCEPT=color
Summary:
With `HGPLAINEXCEPT=color`, colors should still be enabled if the terminal is
capable of supporting them and output is to the terminal.

Currently this doesn't work if `--color=auto` (the default), as
`color._modesetup` uses `ui.formatted` to check if the output is a terminal,
and thus has colors available, but this is `False` for all `HGPLAIN` modes.

Instead, add a new method to `ui` that checks whether  `fout` is a terminal, and
use that for color autodetection.

This function also allows us to add `HGPLAINEXCEPT=pager` as we can use
that in the same way.

Reviewed By: farnz

Differential Revision: D21617170

fbshipit-source-id: 7ee4eaa8963f3d6eb7ed8044a678a4804b9a98f0
2020-05-19 06:13:54 -07:00
Mark Thomas
9e3a321235 windows: fix test-pager.t
Summary:
Setting the fake pager in the pager test doesn't work on Windows.

For some reason, the `pager.pager=C:/path/to/python.exe C:/path/to/test/fakepager.py` triggers
some kind of PATH translation code that results in `setconfig.py` receiving
`pager.pager=C;C:\\path\\to\\python.exe C;C:\\path\\to\\test\\fakepager.py` as its
argument.  This is clearly invalid, so the test fails with messages like
`'C' is not recognized as an internal or external command`.

Workaround this for now by setting the pager by appending directly to HGRCPATH.

Reviewed By: ikostia

Differential Revision: D21638507

fbshipit-source-id: e8a6b0c281030b23302116a79ef3ba754d37f601
2020-05-19 06:13:53 -07:00
Jun Wu
2aa85dc4d7 version: a Rust crate providing version information
Summary: Otherwise the version information is only available in Python.

Reviewed By: DurhamG

Differential Revision: D19803762

fbshipit-source-id: 044c5da86efc8c657d0c422a2b1947086444895e
2020-05-18 09:00:40 -07:00
Durham Goode
49ac0401b7 discovery: go back to random sampling but include master
Summary:
An earlier change (D21394302) made discovery sampling use the most
recent commits. This ended up not being correct since if the requested sample
did not find any hits then the unknown set would not be reduced and the next
requested set would not change, resulting in an infinite loop.

The goal of the original diff was to ensure master was in the initial sample set
so we didn't have to inspect a bunch of really old commits. Let's go back to
random sampling, but manually insert master into the initial set.

In the long-term we should throw away all this code and use something similar to
discovery.fastdiscovery instead which just relies on the public heads.

Reviewed By: quark-zju

Differential Revision: D21577331

fbshipit-source-id: d738de255e292fc569eb27f250dcd3eaafaaae43
2020-05-15 19:03:29 -07:00
Thomas Orozco
6676a7a476 logginghelper: use repo basename as repo name
Summary:
When we don't provide a repo name, scm_telem_log will run `hg config` to try
and get the path, and fall back to using the basename of the repo directory.

However, this is a bit undesirable, because if we ran this code we already
checked the path, so the repo URL isn't going to magically materialize once `hg
config` asks for it, which means we make a completely redundant call to hg from
scm_telem_log.

By just doing this in logginghelper, we avoid this extra roundtrip.

Reviewed By: StanislavGlebik

Differential Revision: D21572027

fbshipit-source-id: 58e5ab2e3e525edef1ecde039cd968eab8d89172
2020-05-15 03:02:00 -07:00
Thomas Orozco
e96c923fba hghave: fix jq matching
Summary:
My jq has 2 spaces after "Usage:", so this fails. Let's make the matching a bit
more lenient.

Reviewed By: StanislavGlebik

Differential Revision: D21572028

fbshipit-source-id: 1948af8bbee6486df78299c3cc08209ce3ef3e12
2020-05-15 03:02:00 -07:00
Arun Kulshreshtha
57e92bb28d movement: allow prev/next with pending changes
Summary:
Make `prev` and `next` match the behavior of `update` and allow movement with pending changes. A new `--check` flag has been added to enforce a clean working copy (similar to `update`).

Note that these commands literally just call `update` under the hood, so this was just a matter of removing the existing dirtiness check. (The check was originally put there because `update` originally required a clean working copy by default.)

Reviewed By: quark-zju

Differential Revision: D21581805

fbshipit-source-id: 33d0ac4d36a795713054af7e8776d077fd353048
2020-05-14 21:23:27 -07:00
Jun Wu
06f03628aa infinitepush: remove legacy auto pull logic
Summary: The revset autopull now covers the infintiepush autopull logic.

Reviewed By: DurhamG

Differential Revision: D21526664

fbshipit-source-id: 90cfdebc99bb69b3e45eadcbf4b0d764e0cd68c6
2020-05-14 12:47:35 -07:00
Jun Wu
b2c1d90f22 commitcloud: use dag operations to simplify 'hide' logic
Summary:
Now we have a virtual DAG that can be queried. Use that to figure out what
heads to hide and add instead of manually traversal through the graph.

Also did some tweaks to fix Python 3 compatibility and make the parent graph
style a bit more correct.

Reviewed By: markbt

Differential Revision: D21554672

fbshipit-source-id: 749d7938a8612e21c5975d9b80a275a059de022d
2020-05-14 12:03:46 -07:00
Jun Wu
791ec223ba commitcloud: use Rust dag abstractions for smartlog rendering
Summary:
This simplifies a lot of the code, and makes it possible to do DAG queries like
ancestors, descendants on the commit cloud graph.

Reviewed By: markbt

Differential Revision: D21554674

fbshipit-source-id: ee08cddfc162a7546d63d4bf385f2948fc799fd3
2020-05-14 12:03:45 -07:00
Jun Wu
285e883c0a commitcloud: only use the Rust graph renderer
Summary:
The only reason that we keep the legacy renderer is that `hg-sl-up` parses
`hg sl` output and breaks with the new Rust renderer. `cloud sl` does not
have such issues so we can switch to the new renderer unconditionally.

Together with the previous change, this allows the upcoming change to render
the graph without using revision numbers.

Reviewed By: markbt

Differential Revision: D21554670

fbshipit-source-id: eee5fbd641096b38e206298f9e716df358a7ab7e
2020-05-14 12:03:44 -07:00
Jun Wu
32298c1056 remotenames: remove legacy auto pull logic
Summary: The revset autopull now covers the remote bookmark autopull logic.

Reviewed By: DurhamG

Differential Revision: D21526665

fbshipit-source-id: f57e844021ef74f2f99a2124c821a2b190d45760
2020-05-13 19:27:42 -07:00
Jun Wu
39bd5d8634 context: remove "is a remote bookmark or commit, try to 'hg pull' it first" message
Summary:
We now have auto pull logic that covers most unknown rev use-cases. The hint
message is no longer necessary. It's also unclear how to use `hg pull`
correctly. For example, should it be `-r`, `-B remote/foo` or `-B foo`?

Reviewed By: DurhamG

Differential Revision: D21526667

fbshipit-source-id: 40583bfb094e52939130250dd71b96db4d725ad5
2020-05-13 19:27:41 -07:00
Arun Kulshreshtha
d7455ed900 tests: delete test-amend-noinhibit.t
Summary: The original purpose of this test was to verify that `hg restack` would work correctly with the `inihibt` extension disabled. `inhibit` has not been relevant at FB for years, so this test has no value.

Reviewed By: quark-zju

Differential Revision: D21555411

fbshipit-source-id: 475ed37439ed71aee08ad1b23ebe1770c3324890
2020-05-13 18:08:58 -07:00
Kostia Balytskyi
b1d4f6d2a5 debugsendunbundle: add cmd to send unbunble from stdin
Summary:
This is helpful, when we have raw unbundle bytes and a server path and just
want to send these bytes server's way.

Very similar to `sendunbundlereplay`, but does not do anything additional,
and reads from stdin.

Reviewed By: markbt

Differential Revision: D21527243

fbshipit-source-id: 97726cb40a32c7e44f47e0f56d8c8eabc4faf209
2020-05-13 15:34:39 -07:00
Xavier Deguillard
99f74f0155 lfs: move uploaded blobs to the shared store
Summary:
As a developpers is working on large blobs and iterating on them, the local LFS
store will be growing significantly over time, and that growth is unfortunately
unbounded and will never be cleaned up. Thankfully, one the guarantee that the
server is making is that an uploaded LFS blob will never be removed[0]. By using
this property, we can simply move blobs from the local store to the shared
store after uploading the blob is complete.

[0]: As long as it is not censored.

Reviewed By: DurhamG

Differential Revision: D21134191

fbshipit-source-id: ca43ddeb2322a953aca023b49589baa0237bbbc5
2020-05-13 12:50:20 -07:00
Jun Wu
ff7a6b43d3 pyre2: use Rust regex backend
Summary: Switch from re2 to the Rust regex engine.

Reviewed By: DurhamG

Differential Revision: D20973178

fbshipit-source-id: 2707bfb2120ceb3758a81c01a5a6f4f8c61758bc
2020-05-12 16:32:51 -07:00