Commit Graph

3662 Commits

Author SHA1 Message Date
Luca Niccolini
3e92ce9f77 move AsyncSocket::OptionMap into SocketOptionMap (codemod)
Summary: so that it can be shared more easily with AsyncUDPSocket

Reviewed By: yangchi

Differential Revision: D19851480

fbshipit-source-id: ec8cdb852519724db6f89cf70c4a4169de5028b6
2020-02-21 17:25:23 -08:00
Jun Wu
142937c2f8 cargo: bump serde_cbor to 0.11
Summary: Follow up of D20024491.

Reviewed By: sfilipco

Differential Revision: D20043585

fbshipit-source-id: f66896c8f41c3918fb37611d87fa26c39cdecef1
2020-02-21 14:08:43 -08:00
Adam Simpkins
d32ba43c57 remove an unused variable in the treedirstate code
Summary:
`treedirstatemap._repacked` is sometimes set in write(), but does not appear
to be used anywhere.  Remove it.  (I noticed this since Pyre complains about
it if you enable type checking for `write()`)

Reviewed By: xavierd

Differential Revision: D19958219

fbshipit-source-id: a55e237865160191d814ed950f69c3113bec4f64
2020-02-21 13:54:21 -08:00
Adam Simpkins
5c4382679c annotate util.propertycache
Summary:
Add type annotations for the propertycache type.

Unfortunately at the moment Pyre still can't properly type check code that
uses this class, as it does not understand the special `__get__()` method.
It looks like support for this is hopefully coming in D19206575.

Reviewed By: xavierd

Differential Revision: D19958223

fbshipit-source-id: 0f8f15fc6935ec3feaef41d3be373a85225276fe
2020-02-21 13:54:20 -08:00
Adam Simpkins
375df3b2c0 add type annotations for dirstate.status()
Summary:
Add type annotations for `dirstate.status()` and
`filesystem.pendingchanges()`

Unfortunately Pyre appears to choke when processing the `dirstate.status()`
function, and currently does not actually report type errors inside this
function at the moment.  I've let the Pyre team know about this.
(If Pyre did work correctly it would report one issue since it doesn't realy
understand the `rootcache` decorator applied to `dirstate._ignore`)

Reviewed By: xavierd

Differential Revision: D19958226

fbshipit-source-id: a1cd4b9402a0a449481035cee819533c56b9b336
2020-02-21 13:54:20 -08:00
Adam Simpkins
0bc787c4c0 remove the mercurial.policy module
Summary:
This module previously used to handle deciding how a particular module should
be imported if it had multiple versions (e.g., pure Python or native).
However, as of D18819680 it was changed to always import the native C version.

Lets go ahead and remove it entirely now.  Using `policy.importmod` simply
makes it harder for type checkers to figure out the actual module that will be
used.

The only functionality that `policy.importmod()` still provided was verifying
that the module contained a "version" field that looked like what was
expected.  In practice these version numbers are not bumped often, so this
doesn't really seem to provide much value in checking that we imported the
correct version that we expected to be shipped with this release.

Reviewed By: xavierd

Differential Revision: D19958227

fbshipit-source-id: 05f1d027d0a41cf99c4aa93cb84a51e830305077
2020-02-21 13:54:19 -08:00
Adam Simpkins
fabc6d628f start adding type annotations for the cext code
Summary:
Add *.pyi type stub files for most of the native C extensions.
This allows Pyre to type check functions that use these extensions.

These type annotations likely aren't complete, but contain enough information
to allow Pyre to pass cleanly on the existing type-checked locations in the
code using these modules.

Reviewed By: xavierd

Differential Revision: D19958220

fbshipit-source-id: 85dc39a16e595595a174a8e59e419c418d3531be
2020-02-21 13:54:19 -08:00
Adam Simpkins
446ebff30f move mercurial/cext TARGETS definitions into their subdirectory
Summary:
This moves the build rules for the extensions in mercurial/cext into a TARGETS
file in this directory.

This will allow us to start writing `*.pyi` files that contain type
information for these modules, and store them alongside the corresponding `.c`
files.  By having the build rules in the top-level `eden/scm` directory we
would have needed to keep the `.pyi` files for these modules directly in the
`eden/scm` directory instead, as the namespace for the `pyi` files is assumed
to be the basemodule plus their path relative to the TARGETS file.

Reviewed By: xavierd

Differential Revision: D19958222

fbshipit-source-id: fdc26ead16663036ffa2562a96eb1649f91cba81
2020-02-21 13:54:18 -08:00
Xavier Deguillard
33020829b1 lfs_protocol: remove dependency on mononoke_types
Summary:
Mercurial wishes to use this crate, but pulling in mononoke_types brings way
too many dependencies. Since the only reason mononoke_types is brought in is
for the Sha256 type, let's just hardcode it to [u8; 32].

Reviewed By: krallin

Differential Revision: D20003596

fbshipit-source-id: 53434143c61cd1a1275027200e1149040d30beae
2020-02-21 12:26:19 -08:00
Liubov Dmitrieva
93bb52a3b2 unify bad certs warnings/errors
Summary: Better engineering: let's finally unify those warnings

Reviewed By: quark-zju

Differential Revision: D20029852

fbshipit-source-id: b6522b7384e763650f96a482cb22a12935a680f7
2020-02-21 12:05:19 -08:00
Durham Goode
fc12041053 unicode: fix non-fsmonitor encountering non-utf8 paths on disk
Summary:
The last diff fixed this for fsmonitor. Let's skip these same paths for
non-fsmonitor.

Reviewed By: quark-zju

Differential Revision: D20014808

fbshipit-source-id: 02e3cd9aa29d9c024ba3e8e42a46e21a7c8dfc30
2020-02-21 11:52:41 -08:00
Harvey Hunt
0ecac65ac4 mononoke: Remove restrict_users hook
Summary:
This hook was implemented to prevent incorrect users from moving a
bookmark. However, it doesn't work and the functionality is now implemented by
`is_allowed_user` in the pushrebase pipeline.

Remove the unused hook.

Reviewed By: johansglock

Differential Revision: D20030479

fbshipit-source-id: bcbc9508eebe77cffbc7936382ba4d345b76f74f
2020-02-21 09:46:38 -08:00
Durham Goode
fa31ef23e0 utf8: skip invalid utf-8 filenames from watchman
Summary:
Watchman may report invalid utf-8 filenames, even after they've been
deleted. Let's skip them, and print a warning.

Reviewed By: sfilipco

Differential Revision: D20012187

fbshipit-source-id: b13550918a8330ef3eb5c546105d1e054dcb7724
2020-02-21 08:05:08 -08:00
Durham Goode
78ada1f780 utf8: use cpython_ext::Str for error strings
Summary:
Error strings were being converted to unicode if they contained certain
characters. This caused python 2 Mercurial to throw various errors when it tried
to turn them into strings to report errors.

Let's return cpython_ext::Str instead of String.

Reviewed By: sfilipco

Differential Revision: D20012188

fbshipit-source-id: af6fa7d98d68e3c188292e4972cfc1bdb758dbdf
2020-02-21 08:05:08 -08:00
Thomas Orozco
8086dc29c7 mononoke: add a limit_commit_message_length hook
Summary:
We're working towards sharding Bonsais. Let's make them easier to cache by also
not allowing arbitrarily large commit messages.

Reviewed By: StanislavGlebik

Differential Revision: D20002994

fbshipit-source-id: b2319ac9d5709e968121d4299396e03a90df4a06
2020-02-21 07:18:15 -08:00
Mateusz Kwapich
42bfba7c99 add git mappings import option
Summary: Let's import the info about corresponding git commits on blobimport whenever possible.

Reviewed By: ikostia

Differential Revision: D19877929

fbshipit-source-id: ba03d5de8ae8a9bd80084a8e858cd05e8f621193
2020-02-21 05:41:46 -08:00
Mateusz Kwapich
6111067524 add git mapping pushrebase hook
Summary:
Let's populate the bonsai<->git mapping on pushrebase of the commits that are
coming from git. By this being a pushrebase hook we can have the accuare mappings
being available as soon as the bonsai commit is available.

Corresponding configerator change: D19951607

Reviewed By: krallin

Differential Revision: D19949472

fbshipit-source-id: b957cbcdd0f14450ceb090539814952db9872576
2020-02-21 05:41:45 -08:00
Mateusz Kwapich
38f7a24364 add a way to update git mappings inside SQL transaction
Summary: During the pushrebase hook phase we'll need to reuse existing transaction.

Reviewed By: krallin

Differential Revision: D19949473

fbshipit-source-id: 7c53308724bec6df6d40933405f703c86be15a7a
2020-02-21 05:41:45 -08:00
Mateusz Kwapich
c2be00c45e add git mappings to blobrepo
Summary:
By having it in blobrepo we can ensure that all parts of mononoke can access it
easily

Reviewed By: StanislavGlebik

Differential Revision: D19949474

fbshipit-source-id: ac3831d61177c4ef0ad7db248f2a0cc5edb933b1
2020-02-21 05:41:44 -08:00
Mateusz Kwapich
5a53415bcb add git mapping crate
Summary:
We need a table to store git<->bonsai mappings and a crate that would abrstract operations on it:
 * it's going to be useful immediately to store git hashes for configerator
   commits and doing the hash translations via SCS.
 * it's going to be useful further down the line for real git support.

NOTE: I'm explicitly using the name `SHA1` all over the place to minimize the
confusion if we'll ever want to support other hashing schemes for git commits.
(Git Community is working on SHA256 support nowdays).

The corresponding AOSC diff: D19835975

Reviewed By: krallin

Differential Revision: D19835974

fbshipit-source-id: 113640f4db9681b060892a8cedd93092799ab732
2020-02-21 05:41:44 -08:00
Xavier Deguillard
d1715ef91a remotefilelog: only append remotefilelog.cachekey to cacheprocess2
Summary:
Whenever remotefilelog.cacheprocess2 is set, remotefilelog.cachekey is also
set, but the later is not be present when remotefilelog.cacheprocess is. Since
remotefilelog.cacheprocess already includes the cachekey, let's not add it
twice.

This also fixes the issue where hg_memcache_client would die early due to being
passed too many arguments.

Reviewed By: DurhamG

Differential Revision: D20014792

fbshipit-source-id: 8ed6775f70cf967d1c069f8acdb5a782ee819090
2020-02-20 19:32:43 -08:00
Adam Simpkins
aea44066d4 remove verbose KeyError handling in filectx.data()
Summary:
This error handling can be extremely slow: calling `self.node()` can end up
triggering a linkrev scan of the changelog, which can take over 5 minutes.

If we did want to add this back in the future we would need some sort of API
on `filectx` to try and get the node ID only if it was cheap, and that would
fail fast if this is using remotefilelog and trying to get the node ID will
require scanning the changelog.

Note that KeyError can occur fairly regularly when invoked in long-lived
commands like `hg debugedenimporthelper`.  If we are asked about data in a new
commit that was added since this repository was originally opened a KeyError
will be thrown here (in which case `debugedenimporthelper` will call
`repo.invalidate()` and then retry).

Reviewed By: quark-zju

Differential Revision: D20010279

fbshipit-source-id: 0e9b4c163cb9256de57daa91eed70a3736cb1075
2020-02-20 17:43:48 -08:00
Zeyi (Rice) Fan
d58863bde2 make hgcache direct read as default
Summary: It seems to be stable and not causing issues. Let's make it default everywhere.

Reviewed By: wez

Differential Revision: D19896738

fbshipit-source-id: cf6abe8f536e570017742b3a0674213a932a6a4d
2020-02-20 16:58:10 -08:00
Chad Austin
3748788c03 sync bser fixes from pywatchman
Summary: There are two copies of pywatchman in fbcode (!) and some changes didn't make it into the edenscm copy.

Reviewed By: quark-zju

Differential Revision: D19794480

fbshipit-source-id: bcc85e0d3efc225d94b8bfa1e433f6e9cc024643
2020-02-20 14:54:29 -08:00
Xavier Deguillard
44c4f2f5d9 revisionstore: add copyfrom information to the LFS pointer
Summary:
Mercurial filenode hash is computed by including the copy information in the
blob header. Before computing the blob content hash, or returning it to the
upper layers, we need to either strip or reconstruct this header appropriately.

Reviewed By: DurhamG

Differential Revision: D19975887

fbshipit-source-id: 7555e7219e50f4d18ec677fdecc216ee705d7af4
2020-02-20 14:28:52 -08:00
Xavier Deguillard
7fb75ce4f0 lfs: move contenthash computation to the enum impl
Summary: This will make it easier to support more hash schemes in the future.

Reviewed By: DurhamG

Differential Revision: D19975888

fbshipit-source-id: 8b8ce3b20d72199bac3cd20a48475b5ab56bfc52
2020-02-20 14:28:52 -08:00
Xavier Deguillard
cd56a8b39a revisionstore: move Arc outside of the stores
Summary:
With the Arc embedded into the store themselves, this forces a second
allocation in order to use them as trait objects. Since in most cases, we do
not want the stores themselves to be cloneable, we can move the Arc outside and
thus reduce the number of pointer indirection.

Reviewed By: DurhamG

Differential Revision: D19867568

fbshipit-source-id: 9cd126831fe2b9ee715472ac3299b7a09df95fce
2020-02-20 14:28:52 -08:00
Xavier Deguillard
7c1a623d8a revisionstore: add the LfsStore to the ContentStore
Summary:
The ContentStore now can read LFS blobs from both the shared cache, and the
local store.

Reviewed By: DurhamG

Differential Revision: D19866249

fbshipit-source-id: a6fb3523495e9d3832613b56438f631cfa552b91
2020-02-20 14:28:51 -08:00
Xavier Deguillard
58d9d92e88 revisionstore: simplify ContentStore/MetadataStore initialization a bit
Summary:
With the LFS store being added, and the indexedlog being soon used for trees,
this simplification should help in formalizing the hierarchy of files/folders.

It will look like the following:
  <root dir>/lfs: for the lfs store
  <root dir>/indexedlog*: for the indexedlog
  <root dir>/foobar: for a hypothetical foobar store

For manifests, <root dir> will therefore be: <store dir>/manifests. The
unfortunate part is that the current tree data lives under
<store dir>/packs/manifests. As packfiles will be replaced, this small
discrepency is acceptable.

Reviewed By: DurhamG

Differential Revision: D19866248

fbshipit-source-id: 7ef59ef7df19149b19a529b4f4a45a479cc9d23b
2020-02-20 14:28:51 -08:00
Xavier Deguillard
f512b5658d revisionstore: add an LfsStore
Summary:
This is the first step in having a stronger integration between LFS blobs and
the ContentStore abstraction. The 2 main difference between the Python based
LFS implementation and this one are:
 - pointers are not stored alongside plain data,
 - blobs are split between local and shared blobs

As of now, no reclamation is being performed for shared blobs, blobs aren't
fetched or uploaded. This will come in future diffs.

Reviewed By: DurhamG

Differential Revision: D19859291

fbshipit-source-id: 45000fc574e6fbd6d3487f4966cad4f49dab731c
2020-02-20 14:28:51 -08:00
Mark Thomas
a9490441b2 add blame --parent
Summary:
Add the `--parent` flag to `scsc blame`.  This runs blame against the first
parent of the specified commit, rather than the commit itself.  This allows
users to copy and paste commit hashes from previous blame output in order to
skip the commit, rather than having to look up the parent commit hash
themselves.

Reviewed By: StanislavGlebik

Differential Revision: D20006308

fbshipit-source-id: d1c25aad8f236fe27e467e29f6a96c957b6c8c8f
2020-02-20 13:03:54 -08:00
Thomas Orozco
4a29fe400d mononoke/blobstore_healer: migrate replication lag polling to async / await
Summary:
The former implementation here was a little difficult to work with, and
resulted in a whole lot of cloning of closures, etc.

This updates the implementation to be a little simpler on the whole (async /
await is nicer for while loops, since you can use, well, loops)

It does slightly change a few parts of the behavior:

- The old implementation would wait for the replication lag duration. That's
  not really correct. As we've observed several time this weeks, replication
  lag usually drops quickly once it starts dropping. I.e. if the replication
  lag is 10 seconds, it doesn't take 10 seconds to catch up. This gets more
  important with big lag durations.
- I updated replication lag to be u64 instead of usize. usize doesn't really
  make sense for something that has absolutely nothing to do with our pointer
  size.

I also split out the logic for calculating how long we wait in a part that
cares about whether we are busy and one that cares about replication lag
(whereas the older one kinda mixed the two together). We wait for our own
throttling (i.e. sleep for a sec if we didn't do anything) before we wait for
replication lag, so the new behavior should have the desired behavior of:

- If we don't have much work to do, we sleep 1 second between each iteration
  (but if we do have work, we don't).
- No matter what, if we have replication lag, we wait until that passes before
  doing any work.

The old one did that too, but it mixed the two calculations together, and was
(at least in my opinion) kinda hard to reason about as a result.

Reviewed By: StanislavGlebik

Differential Revision: D19997587

fbshipit-source-id: 1de6a9f9c1ecb56e26c304d32b907103b47b4728
2020-02-20 12:26:51 -08:00
Thomas Orozco
be5d7343ce mononoke/blobstore_healer: check for replication lag _before_ starting work
Summary:
We had crahsloops on this (which I'm fixing earlier in this stack), which
resulted in overloading our queue as we tried to repeatedly clear out 100K
entries at a time, rebooted, and tried again.

We can fix the root cause that caused us to die, but we should also make sure
crashloops don't result in ignoring lag altogether.

Also, while in there, convert some of this code to async / await to make it
easier to work on.

Reviewed By: HarveyHunt

Differential Revision: D19997589

fbshipit-source-id: 20747e5a37758aee68b8af2e95786430de55f7b1
2020-02-20 12:26:51 -08:00
Thomas Orozco
6da3dc939a mononoke/blobstore_sync_queue: delete in smaller batches
Summary:
Our blobstore_sync_queue selects entries with a limit on the number of unique
keys it's going to load. Then, it tries to delete them. However, the number of
entries might be (much) bigger than the number of keys. When we try to delete
them, we time out waiting for MySQL because deleting 100K entries at once isn't
OK.

This results in crashlooping in the healer, where we start, delete 100K
entries, then time out.

This is actually double bad, because when we come back up we just go wihhout
checking replication lag first, so if we're crashlooping, we disregard the
damage we're doing in MySQL (I'm fixing this later in this stack).

So, let's be a bit more disciplined, and delete keys 10K at a time, at most.

Reviewed By: HarveyHunt

Differential Revision: D19997588

fbshipit-source-id: 2262f9ba3f7d3493d0845796ad8f841855510180
2020-02-20 12:26:50 -08:00
Durham Goode
51720717d8 sparse: add config for warning for full checkouts
Summary:
Some of our upcoming repo merges will make it infeasible for someone to
use a full checkout. Let's add a config that will warn users of this. It has a
few levels, starting with a suppressable hint, then a non-suppressable warning,
then a suppressable exception, then a non-suppressable exception.

Reviewed By: ikostia

Differential Revision: D19974408

fbshipit-source-id: bad35a477ad8626dbc0977465368f5d71007e2d5
2020-02-20 10:58:53 -08:00
James Zuo
73e1521a4e Remove deprecated method createStreamPublisher in EdenServiceHandler
Summary: Remove deprecated method createStreamPublisher with apache::thrift::ServerStream<T>::createPublisher()

Reviewed By: iahs

Differential Revision: D19961754

fbshipit-source-id: 915645f1aff648d65f54246e008fbc4454b71684
2020-02-20 09:33:07 -08:00
Thomas Orozco
ef1ffa31e8 mononoke/sql_ext: log which shard we are waiting for in myrouter
Summary:
MyRouter needs to be told which shards to watch. Since I'm adding a new shard,
it'll be easier for everyone to know that they need to update their MyRouter
configuration if we start logging the shard name we're trying to hit.

Reviewed By: ikostia

Differential Revision: D20001704

fbshipit-source-id: 8a9ff3521bc7e3c9b7ed39c6ae33d0ddc1d467b7
2020-02-20 07:55:04 -08:00
Mark Thomas
5168c29e12 encoding: use correct output encoding on windows
Summary:
On Windows, there are *two* 8-bit encodings for each process.

* The ANSI code page is used for all `...A` system calls, and this is what
  Mercurial uses internally.  It can be overridden using the `--encoding`
  command line option.

* The OEM code page is used when outputing to the console.  Mercurial has no
  concept of this, and instead renders to the console using the ANSI code page,
  which results in mojibake like "Θ" instead of "é".

Add the concept of an `outputencoding`.  If this differs from `encoding`, we
convert from the local encoding to the output encoding before writing to the
console.

On non-Windows platforms, this defaults to the same encoding as the local encoding,
so this is a no-op unless `--outputencoding` is manually specified.

On Windows, this defaults to the codepage given by `GetOEMCP`, causing output
to be converted to the OEM codepage before being printed.

For ordinary strings, the local encoded version is wrapped by `localstr` if the
encoding does not round-trip cleanly.  This means the output encoding works
even if the character is not represented in the local encoding.

Unfortunately, the templater is not localstr-clean, which means strings can get
flattened down to the local encoding and the original code points are lost.  In
this case we can only output characters which are in the intersection of the
encoding and the output encoding.

Most US English Windows systems use cp1252 for the ANSI code page and cp437 for
the OEM code page.  These both contain many accented characters, so users with
accented characters in their names will now see them correctly rendered.

All of this only applies to Python 2.7.  In Python 3, everything is Unicode,
the `--encoding` and `--outputencoding` options do nothing, and it just works.

Reviewed By: quark-zju, ikostia

Differential Revision: D19951381

fbshipit-source-id: d5cb8b5bfe2bc131b2e6c3b892137a48b2139ca9
2020-02-20 04:28:48 -08:00
Mark Thomas
c4acebfca1 rage: force use of utf-8 and lines-square graph renderer
Summary:
`hg rage` generates the rage in the user's encoding.  Since pastes are expected
to be in UTF-8, non-UTF-8 encodings result in garbled pastes.

Similarly, the lines-dec graph renderer uses escape sequences that won't work
on web pages, and the lines graph renderer uses curved lines which don't
render very well either.  Force the use of the lines-square graph renderer,
which renders well.

Reviewed By: quark-zju

Differential Revision: D19951382

fbshipit-source-id: d1a5fd2ef195658f9bf10210088031474355f168
2020-02-20 04:28:48 -08:00
Mark Thomas
1d70594590 renderdag: provide graph message in unicode
Summary:
The Rust graph renderer expects the message to be a unicode string, so ensure
we convert it from the local encoding before passing it to Rust.

Reviewed By: quark-zju

Differential Revision: D19951383

fbshipit-source-id: 644862c63873079364cb9902bd1bb49de8aa1ab9
2020-02-20 04:28:47 -08:00
Thomas Orozco
614fa33af2 mononoke: add a limit_path_length hook
Summary:
This adds a file hook to limit the file length we are willing to allow in
commits. This is necessary for now since Mercurial does have a limit on its
end, and we shouldn't allow commits that we cannot sync to Mercurial.

Reviewed By: HarveyHunt

Differential Revision: D19969689

fbshipit-source-id: 1da8a62d54e98b047d381a9d073ac148c9af84b0
2020-02-20 02:49:38 -08:00
Thomas Orozco
de9b3cdc83 run-tests: encode diff in utf-8
Summary:
See later in this stack for motivation. This seems to work fine, and it allows
characters that don't fit latin1 when rendering diffs.

Reviewed By: markbt

Differential Revision: D19969743

fbshipit-source-id: 79c4afce5a19822d9b075d23ff4c88aa76ce2f42
2020-02-20 02:49:38 -08:00
Thomas Orozco
58126d90d6 mononoke: log input size
Summary:
This adds some basic logging for input size for Gettreepack and Getpack. This
might make it easier to understand "poison pill" requests that take out the
host before it has a chance to finish the request.

Reviewed By: StanislavGlebik

Differential Revision: D19974661

fbshipit-source-id: deae13428ae2d1857872185de2b6c0a8bcaf3334
2020-02-20 02:24:10 -08:00
Stanislau Hlebik
74a8eb4968 fastlog: convert derive_parents to async/await
Summary:
I'm going to modify it in the next diff, so let's make it async.

Note that we used `spawn_future()` before which I replaced with tokio::spawn()
here. It's not really clear if we need it at all - I'll experiment with later.
Removing it will make the code cleaner.

Reviewed By: krallin

Differential Revision: D19973315

fbshipit-source-id: cbbb9a88f4424e6e717caf1face6807ab6c32438
2020-02-19 21:28:21 -08:00
Jun Wu
1fead58252 cmdutil: remove allcmds from UnknownCommand
Summary:
This makes the backtrace much shorter.

Before:

	Traceback (most recent call last):
	  File "edenscm/mercurial/cmdutil.py", line 876, in findsubcmd
	    aliases, entry = findcmd(cmd, table)
	    # cmd = 'foo'
	  File "edenscm/mercurial/cmdutil.py", line 871, in findcmd
	    raise error.UnknownCommand(cmd, allcmds)
	    # allcmds = ['debuggentrees', 'debugsuccessorssets', 'branch', 'br', 'bra', 'bran', 'branc', 'show', ...]
	    # cmd = 'foo'
	UnknownCommand: ('foo', ['debuggentrees', 'debugsuccessorssets', 'branch', 'br', 'bra', 'bran', 'branc', 'show', 'rename', 'move', 'mv', 'ren', 'rena', 'renam', 'mo', 'mov', 'commit', 'ci', 'com', 'comm', 'commi', 'debugremotebookmark', 'gc', 'debugindexedlogdatastore', 'debugexistingcasecollisions', 'debugshell', 'dbsh', 'debugsh', 'debugpython', 'debugpy', 'debugfileset', 'debugdata', 'debugundohistory', 'debugprogress', 'config', 'showconfig', 'debugconfig', 'conf', 'confi', 'paths', 'path', 'bisect', 'bi', 'bis', 'bise', 'bisec', 'debugcheckcasecollisions', 'add', 'debugrename', 'annotate', 'blame', 'blam', 'an', 'ann', 'anno', 'annot', 'annota', 'annotat', 'journal', 'j', 'jo', 'jou', 'jour', 'journ', 'journa', 'parents', 'par', 'pare', 'paren', 'parent', 'rollback', 'debugmergestate', 'identify', 'id', 'ide', 'iden', 'ident', 'identi', 'identif', 'debugformat', 'bookmarks', 'bookmark', 'bo', 'boo', 'book', 'bookm', 'bookma', 'bookmar', 'debugrevspec', 'debugwalk', 'amend', 'am', 'ame', 'amen', 'debughttp', 'hide', 'strip', 'hid', 'str', 'stri', 'tip', 'ti', 'debugcommitmessage', 'hint', 'hin', 'locate', 'loc', 'loca', 'locat', 'debugfilerevision', 'debugfilerev', 'incoming', 'in', 'debugdag', 'next', 'n', 'ne', 'nex', 'unshare', 'rebase', 'unhide', 'unh', 'unhi', 'unhid', 'grep', 'gre', 'archive', 'ar', 'arc', 'arch', 'archi', 'archiv', 'debugmarklanded', 'debugpushkey', 'debugdatapack', 'debugtreestate', 'debugtreedirstate', 'debugtree', 'debuglocks', 'debuglock', 'revert', 'rev', 'reve', 'rever', 'export', 'e', 'ex', 'exp', 'expo', 'expor', 'repack', 'shelve', 'she', 'shel', 'shelv', 'log', 'history', 'debugwaitbackup', 'debugnamecomplete', 'diff', 'd', 'di', 'dif', 'debugdrawdag', 'debugcheckoutidentifier', 'debugdate', 'debuggethistory', 'debugssl', 'init', 'ini', 'debuggetbundle', 'summary', 'sum', 'su', 'summ', 'summa', 'summar', 'unbundle', 'unb', 'unbu', 'unbun', 'unbund', 'unbundl', 'debugwaitonrepack', 'backfilltree', 'debugcrdump', 'outgoing', 'out', 'debugupgraderepo', 'debugmovescratchbookmark', 'debugrebuilddirstate', 'debugrebuildstate', 'debugancestor', 'remove', 'rm', 'rem', 'remo', 'remov', 'debugfillinfinitepushmetadata', 'sparse', 'tags', 'debugcolor', 'debugrunshell', 'debugpathcomplete', 'purge', 'clean', 'undo', 'debugindexedlog-dump', 'debugcheckstate', 'metaedit', 'met', 'meta', 'metae', 'metaed', 'metaedi', 'debugcommands', 'convert', 'debugmutationfromobsmarkers', 'graft', 'gra', 'graf', 'root', 'uncommit', 'unc', 'unco', 'uncom', 'uncomm', 'uncommi', 'verifyremotefilelog', 'copy', 'cp', 'cop', 'debugpreviewbindag', 'files', 'fi', 'fil', 'file', 'debugprocesstree', 'debugproc', 'debugdeltachain', 'fold', 'squash', 'debughistorypack', 'debug-args', 'debugcapabilities', 'debugindexedloghistorystore', 'debuggetfiles', 'debuggetfile', 'debugapplystreamclonebundle', 'redo', 'cloud', 'debugremotefilelog', 'debugsetparents', 'debugmetalog', 'debugindexedlog-repair', 'debugbindag', 'version', 'vers', 'versi', 'versio', 'status', 'st', 'sta', 'stat', 'statu', 'debugmutation', 'debugignore', 'debugobsolete', 'debugupdatecaches', 'debugwaitonprefetch', 'merge', 'mer', 'merg', 'addremove', 'addr', 'addre', 'addrem', 'addremo', 'addremov', 'share', 'debugmanifestdirs', 'serve', 'fastannotate', 'fastblame', 'fa', 'debugdiscovery', 'debugwireargs', 'push', 'debugpickmergetool', 'debugstrip', 'debugbuildannotatecache', 'isbackedup', 'reset', 'debugcomplete', 'debugfsinfo', 'debugfs', 'prune', 'rage', 'unamend', 'una', 'unam', 'uname', 'unamen', 'previous', 'prev', 'previ', 'previo', 'previou', 'continue', 'cont', 'debugsvnlog', 'debugvisibility', 'cat', 'record', 'debugrevlog', 'unshelve', 'unshe', 'unshel', 'unshelv', 'debugrebuildfncache', 'debugdirs', 'import', 'patch', 'im', 'imp', 'impo', 'impor', 'patc', 'backfillmanifestrevlog', 'debuglabelcomplete', 'split', 'spl', 'spli', 'smartlog', 'sl', 'slog', 'sm', 'sma', 'smar', 'smart', 'smartl', 'smartlo', 'debuggettrees', 'debugedenrunpostupdatehook', 'debugstatus', 'manifest', 'mani', 'tag', 'bundle', 'bu', 'bun', 'bund', 'bundl', 'debugtemplate', 'phase', 'ph', 'pha', 'phas', 'dump-trace', 'debugstore', 'rebase', 'reb', 'reba', 'rebas', 'recover', 'debugrefreshwatchmanclock', 'doctor', 'verify', 'forget', 'for', 'forg', 'forge', 'debugextensions', 'pushbackup', 'absorb', 'ab', 'abs', 'abso', 'absor', 'sf', 'debuginstall', 'histgrep', 'debugreadauthforuri', 'prefetch', 'fs', 'blackbox', 'clone', 'histedit', 'histe', 'histed', 'histedi', 'debugpvec', 'resolve', 'reso', 'resol', 'resolv', 'debugcreatestreamclonebundle', 'debugserialgetfiles', 'debugbuilddag', 'debugindex', 'debugcreatescratchbookmark', 'heads', 'hea', 'head', 'debugedenimporthelper', 'githelp', 'git', 'pull', 'pul', 'chistedit', 'debugindexdot', 'debugdirstate', 'debugstate', 'debugknown', 'backout', 'backo', 'backou', 'update', 'up', 'checkout', 'co', 'upd', 'upda', 'updat', 'che', 'chec', 'check', 'checko', 'checkou', 'help', 'hel', 'debugbundle'])
	unknown command 'foo'
	(use 'hg help' to get help)

After:

	Traceback (most recent call last):
	  File "edenscm/mercurial/cmdutil.py", line 876, in findsubcmd
	    aliases, entry = findcmd(cmd, table)
	    # cmd = 'foo'
	  File "edenscm/mercurial/cmdutil.py", line 871, in findcmd
	    raise error.UnknownCommand(cmd)
	    # cmd = 'foo'
	UnknownCommand: foo
	unknown command 'foo'
	(use 'hg help' to get help)

Reviewed By: xavierd

Differential Revision: D19959205

fbshipit-source-id: e3fa6de8edfec7510ecd29defe538dddf8b563a2
2020-02-19 20:12:57 -08:00
Durham Goode
e25f679318 hggit: fix path handling
Summary:
As of 63c471ad8a4ba0bebd1acf70569bcdcefc3fffbf in upstream Dulwich, it
now turns commands into unicode.  Unfortunately, _ssh.py in hggit sees that the
type is no longer str or bytes and thinks it's an array and puts spaces between
every letter, causing it to break.

Let's allow unicode. This broke because dulwich was recently upgraded.

Reviewed By: sfilipco

Differential Revision: D19983215

fbshipit-source-id: 059756905bf4b2c73009001b078c8723ae378246
2020-02-19 17:46:33 -08:00
Kostia Balytskyi
02cafa9997 mononoke: fix blake2 error formatting
Summary: Not very valuable, if it just prints the constant name.

Reviewed By: StanislavGlebik

Differential Revision: D19978690

fbshipit-source-id: ae2b648f50098b479cb3719fd9b9d4b82bac3d3c
2020-02-19 15:22:06 -08:00
Jia Chen
671ca89de0 Upgrade Pyre version for eden to 2927613de6d20ee2d66e98124f3834812475e122
Summary: This should get rid of the extraneous uninitialized attribute errors related to `setUp` and abstract classes.

Reviewed By: simpkins

Differential Revision: D19964487

fbshipit-source-id: 52d5a6496e372d99d4398473f9ed7672228a76f5
2020-02-19 15:05:25 -08:00
Jun Wu
26e4090522 distutils_rust: retry mt.exe properly
Summary:
This is a revised version of D19887220.

D19887220 has 2 problems:
- It can silently ignore the mt.exe error after failures of all retries.
- There is another place that `mt.exe` runs that is not covered by retry.

This diff fixes them by wrapping the `set_long_paths_manifest` function
directly so it covers two `mt.exe` places, and makes sure all retry failure
is still a failure.

Reviewed By: sfilipco

Differential Revision: D19977802

fbshipit-source-id: 774d0c42b247a7e111841cd69f71760a5544d685
2020-02-19 13:22:39 -08:00
Adam Simpkins
6f824649ff use absolute includes to the third-party xdiff code
Summary:
Update includes to the third-party xdiff.h file to use absolute includes
from the repository root.  This allows many parts of our internal build
tooling to work better, including automatic dependency processing.

Reviewed By: xavierd

Differential Revision: D19958228

fbshipit-source-id: 341dd8c94f1138cf4a387b92e1817b2a286d6aa1
2020-02-19 13:05:06 -08:00