Commit Graph

871 Commits

Author SHA1 Message Date
Liubov Dmitrieva
3163d20016 commitcloud: log errors to scuba
Summary:
This will allow us to improve our dashboards filtering out errors we are
responsible for, like missing certs on the machines.

Reviewed By: mitrandir77

Differential Revision: D19950614

fbshipit-source-id: 73503e984dfe8513a700fdcb2fc36b1618c20a4f
2020-02-18 14:28:33 -08:00
Mark Thomas
0387f1c67e localrepo: add configurable limits for description and extras
Summary:
Commit messages and extras can be unbounded in size.  This can cause problems if users create commits with exceptionally large messages or extras.  Mercurial will commit these to the changelog, increasing its size.  On Mononoke, large commit messages may go over the cacheing threshold, resulting in poor performance for requests involving these commits as Mononoke will need to reload on every access.

Commit messages should not usually be that large.  Mostly likely it will happen by accident, e.g. through use of `hg commit -l some-large-file`. Prevent this from happening by accident by adding configuration for soft limits when creating commits.

If a user really does need to create a commit with a very large message or extras, they can override using the config option.

Reviewed By: xavierd

Differential Revision: D19942522

fbshipit-source-id: 09b9fe1f470467237acc1b20286d2b1d2ab25613
2020-02-18 13:12:58 -08:00
Adam Simpkins
1a263466c6 remove the unused sparsematchfn dirstate parameter
Summary:
This parameter was originally removed in D12811551, but re-added in D12855935
due to the fact that at the time the `eden_dirstate.py` and `dirstate.py`
files were deployed in separate RPMs and could not be updated together
atomically.  We now deploy these files together, so we can drop this extra
unnecessary argument.

Reviewed By: chadaustin

Differential Revision: D19913057

fbshipit-source-id: 0f0b4fde4b3124a8fc5bb568551b4e67de14d410
2020-02-18 11:39:22 -08:00
Jun Wu
795b679d60 doctor: support efficient treestate (dirstate) repair
Summary:
Sometimes the treestate points to an unknown commit (ex. aborted transaction
might strip commits). While `debugrebuilddirstate -r HASH --hidden` is able to
fix it, it is too slow.

This diff adds treestate repair logic to the `doctor` command. It scans through
the treestate files, find a most recent `Root` entry with `p1` pointing to a
known commit.

This can be much faster than `debugrebuilddirstate` in some cases, because the
watchman clock might still be valid, and the NEED_CHECK file list might still
be small. In that case, `status` can still be fast.

Since treestate atomically updates all information needed for `status`
calculation (parents, need-check-files (or, "non-normal files"), watchman-clock
(only with fsmonitor), and stat for clean files). Reverting to a previous state
is still atomic. Correctness-wise, this is equivalent to aborting a "large"
transaction, and restoring treestate data to the state before the transaction.
It should be consistent, and the next `status` call won't mis-report files like
the dangerous `debugsetparents` command.

Reviewed By: DurhamG

Differential Revision: D19864422

fbshipit-source-id: d5d2f8b43a0c15ea2ac0e3c164edec7deeb8451f
2020-02-18 09:41:32 -08:00
Jun Wu
bc7c3c1e24 doctor: remove invalid commits in visibleheads
Summary:
See the test change. Without this change repairing the changelog won't give the
user back a working repo.

Reviewed By: markbt

Differential Revision: D19864421

fbshipit-source-id: b84582c5302469828c8cfcb3db362ea82f2eea63
2020-02-18 09:41:31 -08:00
Jun Wu
febe96048e doctor: integrate fixcorrupt logic to repair changelog
Summary:
Reuse utilities in the fixcorrupt extension to repair changelog.

This is better than fixcorrupt because `hg doctor` does not require a repo
object. Some messages are updated so they become more consistent with the
rest of `hg doctor`.

The main motivation is to get changelog fixed early, so other repair logic can
check if a commit hash is known by changelog or not.

Reviewed By: markbt

Differential Revision: D19864418

fbshipit-source-id: 6f95c6c6191d7db2a474a07a5278a857cf41d8e2
2020-02-18 09:41:31 -08:00
Jun Wu
6f2b529e94 doctor: run 'edenfsctl doctor' on edenfs repos
Summary:
Run 'edenfsctl doctor' on an edenfs repo. If there is no current repo, it might
be caused by edenfs daemon stopped running. So let's also run edenfsctl doctor
in that case.

Reviewed By: markbt

Differential Revision: D19864419

fbshipit-source-id: d2a49a126a040845b88b4883d214162326d08d8d
2020-02-18 09:41:30 -08:00
Durham Goode
99a829340b py3: move sampling to use mercurial.json
Summary:
We're seeing a user have issues because their username contains unicode
characters and sampling's use of json doesn't handle it well. I've not been able
to repro it unfortunately, but let's go ahead and switch sampling to use
mercurial.json.

Differential Revision: D19895419

fbshipit-source-id: a1f087d1e2c7568488c2b8d54f267bd5c8266202
2020-02-18 09:36:28 -08:00
Xavier Deguillard
d8064b5e2a types: add a Sha256 type
Summary: This will be used in the LFS store.

Reviewed By: DurhamG

Differential Revision: D19895803

fbshipit-source-id: 4cf447987c10fed0b5c98904f20c841428965d89
2020-02-18 08:32:33 -08:00
Xavier Deguillard
17cc9ab5ab revisionstore: add a wrapper around IndexedLog/RotateLog
Summary:
In some cases, higher level stores may want to store data in either a plain
IndexedLog, or in a RotateLog, for local and shared data. Due to slight
difference between the 2, they can't easily be adapted into a common trait.

Instead let's just wrap both into an enum and implement the main functions that
the higher level stores need.

The first use of this will be the LfsStore, future use will include the
IndexedLogDataStore and the IndexedLogHistoryStores.

Reviewed By: DurhamG

Differential Revision: D19859292

fbshipit-source-id: 920572e0cf5f69bda4901a727a6b0dc0f08fc8d0
2020-02-18 08:32:32 -08:00
Durham Goode
d15cb231fb py3: get fastannotate closer to passing
Summary: There's still some issues, but it's a lot closer.

Reviewed By: quark-zju

Differential Revision: D19802023

fbshipit-source-id: da539094cbc0ba3542e4b5fd3d49f5f80455ec23
2020-02-17 14:52:40 -08:00
Durham Goode
09de146878 py3: fix archive
Reviewed By: quark-zju

Differential Revision: D19802024

fbshipit-source-id: 714f1a3af7f62c8215310fe95ac4de28f9b10f1d
2020-02-17 14:52:40 -08:00
Durham Goode
c9b1fee40f py3: fix eol
Reviewed By: markbt

Differential Revision: D19802025

fbshipit-source-id: f6e6c03ea2d64500b92bcf8b97c9ddedb83fd3c0
2020-02-17 14:52:40 -08:00
Durham Goode
c4f7d32501 py3: enable more tests
Summary: Not sure what fixed these, but let's enable them.

Reviewed By: quark-zju

Differential Revision: D19800696

fbshipit-source-id: 2536a121ae37d4b23ef09dcfee8d92ccbbef3af6
2020-02-17 14:52:39 -08:00
Durham Goode
cd8e154e36 py3: fix test-bookmarks.t
Reviewed By: quark-zju

Differential Revision: D19800698

fbshipit-source-id: a9267e3bafa6f8abb472c0002815fdd2bf2024ca
2020-02-17 14:52:39 -08:00
Durham Goode
779b0beb0b py3: fix test-fb-hgext-phabstatus.t
Reviewed By: quark-zju

Differential Revision: D19800700

fbshipit-source-id: b9b052b5ad1bfa1c714b880cf79c9a21cfebadc2
2020-02-17 14:52:39 -08:00
Durham Goode
6b84a5da81 py3: fix stablerev tests
Reviewed By: quark-zju

Differential Revision: D19800695

fbshipit-source-id: a08efe3c43b1fa01be15ec43a6e32f68dd8eec71
2020-02-17 14:52:38 -08:00
Durham Goode
a6353c55f5 py3: fix sparse
Reviewed By: quark-zju

Differential Revision: D19800699

fbshipit-source-id: 7cf86d0ab9a0efc96966ac3747f56b229251fb0d
2020-02-17 14:52:38 -08:00
Durham Goode
00d72e96bf py3: fix gitlookup
Reviewed By: xavierd

Differential Revision: D19800701

fbshipit-source-id: ecc918a0ef7358a29789f0ab6ca50337bec9edf1
2020-02-17 14:52:38 -08:00
Durham Goode
f05a9d79bb py3: fix test-flagprocessors.t
Reviewed By: xavierd

Differential Revision: D19800697

fbshipit-source-id: a785a4a04ce627257993d83197fec270a8688b7d
2020-02-17 14:52:37 -08:00
Durham Goode
fdbaaeeff9 py3: fix treedirstate unicode handling
Summary:
There was a spot where we returned bytes for a filepath. Fix this to
make dirstate tests pass more.

Reviewed By: quark-zju

Differential Revision: D19786274

fbshipit-source-id: 7465cae8bb2e3be7758abc6279ed3f5f59581732
2020-02-17 14:52:37 -08:00
Durham Goode
4f8c30b04e py3: enable 92 py3 tests
Summary: These now pass

Reviewed By: singhsrb

Differential Revision: D19785175

fbshipit-source-id: bf92757e3fe0753e1b61ffddfd30a37fb40a642f
2020-02-17 14:52:37 -08:00
Durham Goode
c2f42204cc py3: fix some mutation tests
Reviewed By: quark-zju

Differential Revision: D19772615

fbshipit-source-id: 93bcefb6d911941a9e46107f124730279398ceff
2020-02-17 14:52:36 -08:00
Durham Goode
5f46843003 py3: get several infinitepush tests passing
Reviewed By: quark-zju

Differential Revision: D19772622

fbshipit-source-id: c0b64e3a22c085656dbff5526765020b64cc73f5
2020-02-17 14:52:36 -08:00
Durham Goode
5827145ef2 py3: fix some infinitepush py3 issues
Reviewed By: quark-zju

Differential Revision: D19772618

fbshipit-source-id: c5e520a3cec6496e24cc5b3825ef7287ab82f304
2020-02-17 14:52:36 -08:00
Durham Goode
56f4d5ae18 py3: enable a few tests that got fixed along the way
Summary: Not sure where these got fixed.

Reviewed By: quark-zju

Differential Revision: D19772617

fbshipit-source-id: 7bebd15ad080e1fc224d8c1e78f645877551ac92
2020-02-17 14:52:35 -08:00
Durham Goode
2c18b7521a py3: make test-fb-hgext-remotefilelog-clone-tree.t pass
Reviewed By: quark-zju

Differential Revision: D19772620

fbshipit-source-id: 26d1ae840e1e19c7dabbdf7a71e2d4b0d265e141
2020-02-17 14:52:35 -08:00
Durham Goode
255b677f91 py3: fix test-fb-hgext-remotefilelog-lfs.t
Reviewed By: quark-zju

Differential Revision: D19772621

fbshipit-source-id: 25fda0f356129b27413b25cfb70e9d08bbc56263
2020-02-17 14:52:35 -08:00
Durham Goode
a8b4789109 py3: fix misc encoding errors that showed up in tests
Summary:
These are a random batch of stack traces that show up in remotefilelog
tests.

Reviewed By: quark-zju

Differential Revision: D19772619

fbshipit-source-id: a8b9ce188cb7a5a2c9ccaeb62f6744f1c4083e38
2020-02-17 14:52:34 -08:00
Durham Goode
2b0c3ec119 py3: fix test-fb-hgext-remotefilelog-histpack.py
Reviewed By: quark-zju

Differential Revision: D19772616

fbshipit-source-id: 443527d37aa87c1802323aa6edf863beb497a327
2020-02-17 14:52:34 -08:00
Durham Goode
a5ba21d4d4 py3: codemode assertEquals to assertEqual
Summary:
assertEquals is deprecated and shows warnings in the tests in python 3

ignore-conflict-markers

Reviewed By: quark-zju, sfilipco

Differential Revision: D19907385

fbshipit-source-id: 7d261489856a4eeb6719eae581ed986d0415d99e
2020-02-17 14:52:34 -08:00
Durham Goode
41cc67d011 py3: fix remotefilelog repack tests
Reviewed By: quark-zju

Differential Revision: D19751790

fbshipit-source-id: a898a8c37929a73ee2654d2907e9ea5bb2e3fd8a
2020-02-17 14:52:33 -08:00
Durham Goode
3a5728b32f py3: fix archive
Summary:
archive uses a formatter to produce it's metadat file. We need to use a
string io stream instead of bytes.

Reviewed By: quark-zju

Differential Revision: D19748163

fbshipit-source-id: fbd8c32066cfc4a234d9b51691717c7fce4c7c9a
2020-02-17 14:52:33 -08:00
Durham Goode
48aec8ca41 py3: misc fixes to remotefilelog and treemanifest
Reviewed By: quark-zju

Differential Revision: D19747715

fbshipit-source-id: da6716ff46342d777d45bec8e560ab41d544645f
2020-02-17 14:52:33 -08:00
Durham Goode
150aa7be3d py3: fix bundle2 bookmark default values
Summary: They need to be bytes to match the nodes.

Reviewed By: xavierd

Differential Revision: D19746027

fbshipit-source-id: 41e9cc390f4aa97d8c8b378144e64100811665c2
2020-02-17 14:52:32 -08:00
Durham Goode
6d40f2c380 py3: fix occasional ssh hang
Summary:
sshpeer._calltwowaystream used iter(fp, ""), where "" was the sentinel
indicating the fp was empty. Since fp was an iterator of bytes, the sentinel was
never hit and this code kept sending 0\n to each other until the pipes filled
and it hung.

Reviewed By: xavierd

Differential Revision: D19746028

fbshipit-source-id: 0daada0ae2356b5c99cc2c39c121cd88af8f750a
2020-02-17 14:52:32 -08:00
Durham Goode
a3ec80f7f5 py3: various fixes to move bundle2 tests foward
Reviewed By: quark-zju

Differential Revision: D19717253

fbshipit-source-id: 3f07a3c6ff09c1f7081d2dd15659505b4a07a91a
2020-02-17 14:52:32 -08:00
Durham Goode
67ade10253 py3: fix minor bookmark and sparse encoding issues
Reviewed By: quark-zju

Differential Revision: D19717254

fbshipit-source-id: 1ee7fab0bec1bb5b42c2707e7bc07aa8300f4be7
2020-02-17 14:52:31 -08:00
Durham Goode
4d4274ce53 py3: make conduithttp.py python 3 compatible
Reviewed By: quark-zju

Differential Revision: D19717252

fbshipit-source-id: 075aaed642898a3649d40f9cdc9752539b0970aa
2020-02-17 14:52:31 -08:00
Durham Goode
66fd50346c py3: add pycompat buffer alias
Summary: buffer in Python 2 became memoryview in Python 3.

Reviewed By: quark-zju

Differential Revision: D19717251

fbshipit-source-id: f678abfed7e2ec94053329b13015bff3c31eb319
2020-02-17 14:52:30 -08:00
Durham Goode
e4b5247311 py3: fix test-cat.t
Summary:
Fixes test-cat.t by changing some formatter encoding choices. The
formatter is bit awkward here.  hg cat needs to support outputting raw binary,
but also json and templated output.

For now I've set it up so json and templated output can't output non-utf8 data.

Reviewed By: quark-zju

Differential Revision: D19786542

fbshipit-source-id: 84060928103b396b23e3173b715aed996074fa3e
2020-02-17 14:52:30 -08:00
Durham Goode
734ce7959f py3: fix various lfs encoding issues
Reviewed By: quark-zju

Differential Revision: D19717255

fbshipit-source-id: d435a65e566b3a74399632e52c7cd99d0bba7f0a
2020-02-17 14:52:30 -08:00
Durham Goode
9d09b429f0 py3: migrate treedirstate to use utf8 for state and files
Summary:
treedirstate was using bytes for state and for file paths. This does
the appropriate conversions. Note, I don't use strings for all state in rust,
because it's a pain in the butt in some places. We're going to delete
treedirstate eventually anyone, so just I'm getting the test to pass for now.

Reviewed By: quark-zju

Differential Revision: D19715102

fbshipit-source-id: 4f9eac372bee7884d36aa19e3a3ed253392fa7dd
2020-02-17 14:52:29 -08:00
Durham Goode
f530333e06 edenfs: update eden thrift types
Summary:
When I run make local it's creating changes in our checked in thrift
types. I guess I need to check these in?

Reviewed By: quark-zju

Differential Revision: D19848706

fbshipit-source-id: 8a2e9a2617734eda41eade1f2645689362b1d75d
2020-02-17 14:52:29 -08:00
Mark Thomas
892ac0079e rage: add debugmutation for recent draft commits
Summary:
Add `debugmutation` output for recent draft commits to `hg rage`.  This will
allow us to easily see the recent history of the draft commits in a user's
repo.

Reviewed By: DurhamG

Differential Revision: D19903999

fbshipit-source-id: f6ebd729812c63d3760f9dab031414df6b24ab28
2020-02-17 06:41:04 -08:00
Mark Thomas
3690e8ab44 debugmutation: add time range limiting
Summary:
Make it possible to limit the time range of mutation info being displayed by hg
debugmutation.

Reviewed By: DurhamG

Differential Revision: D19904000

fbshipit-source-id: 365f54fdd861661961bba1a0ea96fce772623a23
2020-02-17 06:41:03 -08:00
Mark Thomas
5122958c70 commitcloud: fix program name template in commit cloud warning
Summary: The correct template for the program name is `prog@`.

Reviewed By: HarveyHunt

Differential Revision: D19904938

fbshipit-source-id: 19a3ac18f85e2b090f53d0423fce3c6982cf32fd
2020-02-17 02:37:26 -08:00
Xavier Deguillard
7bb3e384d8 remotefilelog: append the repo name to memcache key
Summary:
Up to now, this has been done in chef, and thus for repos that we do not list,
they may share the memcache keys, with potential unintended consequences. Let's
always add the repo name to the key, so we can simplify the code in chef.

One small negative effect of this change is that while it is being rolled out,
the cache hit rate will be impacted. This should resolve itself quickly.

Reviewed By: DurhamG

Differential Revision: D19885775

fbshipit-source-id: 0b59ce9e378b0ab70f696a39d19d27cd89921098
2020-02-14 14:10:48 -08:00
Mark Thomas
7f71cd1cda commands: pass date-based rev as a hex hash
Summary:
When using the `--date` parameter to `hg update` or `hg revert`,
`cmdutil.finddate` returns the binary node for the target commit.  Passing this
to `scmutil.revsingle` sometimes works, however it's unreliable, as if the
binary node happens to look vaguely like a revset, we will attempt to parse it,
and perhaps fail.

Resolve the ambiguity by converting the binary node to hex.

Reviewed By: quark-zju

Differential Revision: D19902595

fbshipit-source-id: 5eb7b9b029e292a02ccc00f5a465ab7807cd56d5
2020-02-14 09:39:55 -08:00
Xavier Deguillard
28564b228d backingstore: do not fail if memcache can't be initialized
Summary:
Failing means that we fallback to the Python importer. Let's simply warn about
it.

Reviewed By: fanzeyi

Differential Revision: D19897274

fbshipit-source-id: f9c63f5aa76015c28b31f00bba98244f5c86e923
2020-02-14 09:00:27 -08:00