Commit Graph

3018 Commits

Author SHA1 Message Date
Jun Wu
c6f14f02f4 dag: use Stream interface for NameSet iteration
Summary: This makes NameSet more friendly for async use-cases, interface-wise.

Reviewed By: sfilipco

Differential Revision: D24806695

fbshipit-source-id: 6e640ba2666872a9128d6460e8b53d6a0e595e56
2020-12-10 12:37:31 -08:00
Jun Wu
32176eca42 dag: add async interface for NameSet
Summary:
Change the main API of NameSet to async. Use the `nonblocking` crate to bridge
the sync and async world for compatibility. Future changes will migrate
Iterator to async Stream.

Reviewed By: sfilipco

Differential Revision: D24806696

fbshipit-source-id: f72571407a5747a4eabe096dada288656c9d426e
2020-12-10 12:37:31 -08:00
Jun Wu
1eb5244eb1 nonblocking: add a way to convert async fn to non-blocking sync fn
Summary:
This will make it easier to incrementally migrate APIs to async, and make sync
programs able to use sync interface if they'd like to. For example, the dag
crate is likely going to be async-ize. Its async APIs are only useful for
places where the dag is lazy. It's still possible to have a non-lazy dag
that a sync interface is suitable.

Reviewed By: ikostia

Differential Revision: D24777747

fbshipit-source-id: 6d56149fbd1f9b29f5fc62387cbf194800755d12
2020-12-10 12:37:31 -08:00
Jun Wu
6dd2e4c2d8 edenapi: remove unused variable
Summary: Resolve a compiler warning.

Reviewed By: sfilipco

Differential Revision: D25350917

fbshipit-source-id: 5de3f613953c9ad3e35e149cb4abaa611c63a9ae
2020-12-10 12:37:31 -08:00
Jun Wu
fa18f70f8f pyhgtime: resolve a compiler warning
Summary:
```
warning: attribute should be applied to a function or static
  --> pyhgtime/src/lib.rs:70:13
   |
70 |             #[no_mangle]
   |             ^^^^^^^^^^^^
71 |             static timezone: c_long;
   |             ------------------------ not a function or static
   |
   = note: `#[warn(unused_attributes)]` on by default
```

Reviewed By: ikostia

Differential Revision: D25345233

fbshipit-source-id: 4b6f753544af1e3e8479dceed908299f6dc57ad5
2020-12-10 12:37:31 -08:00
Stanislau Hlebik
c67102082e unbundle: add perftrace functions for b2partsgenerators
Reviewed By: quark-zju

Differential Revision: D25458920

fbshipit-source-id: 1f13bc950861e2dc5646176cddb58d67c8dc2266
2020-12-10 11:47:31 -08:00
Durham Goode
1712864779 metadatastore: add config to write local history to indexedlog
Summary:
We already have a config to write shared history to an indexedlog. Let's
add a similar config for local history.

Reviewed By: quark-zju

Differential Revision: D23910457

fbshipit-source-id: eca21db0350895f573a60e4e1a6b05514e70f1c7
2020-12-10 07:28:13 -08:00
Durham Goode
a5f8e0a301 revisionstore: allow persistent IndexedLogHistory
Summary:
In a future diff we'll use the indexedlog stores for local history. We
want those to exist forever, so let's move IndexedLogHgIdHistoryStore to use a
Store under the hood, and add an enum for distinguishing between the two types
at creation time.

Reviewed By: quark-zju

Differential Revision: D25429675

fbshipit-source-id: 5f2dc494e1175d4c1dc74992d3311d2e55d784ca
2020-12-10 07:28:13 -08:00
Arun Kulshreshtha
ef67b259ee edenapi: allow single cert file
Summary: Previously, the EdenAPI client (and Mercurial's `http-client`) required both a client certificate and private key to be specified individually in order to use TLS mutual authentication. However, libcurl supports having both the certificate and key concatenated together into a single PEM file. This diff makes it possible to simply specify the combined file as the `cert`, leaving the `key` unset.

Reviewed By: quark-zju

Differential Revision: D25323786

fbshipit-source-id: 1800be3ef82ec4dfa89d725f5860190172994c89
2020-12-09 15:07:19 -08:00
Arun Kulshreshtha
b45dbd49ff auth: treat empty cert paths as unset
Summary: Treat empty paths as `None`, which allows certificate and key paths to be unset via a `--config` flag (e.g. `hg debughttp --config auth.edenapi.key=`). This would normally require adding an `%unset` line to the appropriate hgrc, which adds friction to ad-hoc command line usage.

Reviewed By: quark-zju

Differential Revision: D25416531

fbshipit-source-id: 15aae78d9b3a82227278f33def45fa960aa65a98
2020-12-09 15:07:19 -08:00
Arun Kulshreshtha
23569dfc4d Regenerate all autocargo-managed Cargo.tomls
Reviewed By: singhsrb, dtolnay

Differential Revision: D25417653

fbshipit-source-id: 81057698ae457a28b7aac6f7a1b32bcec9517eff
2020-12-09 12:44:29 -08:00
Jun Wu
2e7f12ab4c template: fix ifcontains(rev, revset('.'), ...) compatibility with f64 compatibility
Summary:
The f64 compatibility added by D25079001 (e91552fefe) changes the `{rev}` template output.
However, the revset object is not aware of the rev mapping so the following
pattern will stop working:

  ifcontains(rev, revset('.'), '@', 'o')
  # rev: mapped, but not contains in `revset('.')`

Fix it by teaching `ifcontains(a, b, ...)` to disable f64 compatibility when
evaluating `a`, since `a` is not going to be printed out.

This fixes an issue in VSCode ISL that "You are here" is missing on non-master
commits.

Reviewed By: singhsrb

Differential Revision: D25404673

fbshipit-source-id: 3e53a2ce1f135f8825c195c5a3061dad0359c4b2
2020-12-09 10:36:28 -08:00
Xavier Deguillard
77f3f239a2 store: replace use of ctreemanifest with small manifest parser
Summary:
The code still took a dependency on Mercurial's old manifest code to parse
manifests. It turns out the manifests have a very simple format that we could
parse directly.

This avoids various copies, conversions, std::list, removes ~1k lines of code,
at the expense of adding ~100 lines of code (some of them being C++
boilerplate).

Reviewed By: fanzeyi

Differential Revision: D25385018

fbshipit-source-id: 90d4cda2b7797584bc48c086d5592a7ecaa05dfc
2020-12-09 08:40:38 -08:00
Durham Goode
476c8b7b30 contentstore: add config to write local data to indexedlog
Summary:
We already have a config to write shared data to an indexedlog. Let's
add a similar config for local data.

Reviewed By: xavierd

Differential Revision: D23909569

fbshipit-source-id: 87317554beb6bef8237e6a900403701662c3c0d0
2020-12-09 07:07:40 -08:00
Durham Goode
4f611364eb revisionstore: add repair support to IndexedLogHgIdDatatore
Summary:
We temporarily dropped repair support when transitioning to using Store instead
of a raw RotateLog. Let's add that back now.

Reviewed By: xavierd

Differential Revision: D25371622

fbshipit-source-id: e28fc425a6ffb50c93540672b0df75a172ebbe9c
2020-12-09 07:07:40 -08:00
Durham Goode
925e457ae7 revisionstore: allow persistent IndexedLogData
Summary:
In a future diff we'll use the indexedlog stores for local data. We
want those to exist forever, so let's move IndexedLogHgIdDataStore to use a
Store under the hood, and add an enum for distinguishing between the two types
at creation time.

Reviewed By: xavierd

Differential Revision: D23915622

fbshipit-source-id: 296cf6dfcd53e5cf1ae7624fdccedf0a60a77f22
2020-12-09 07:07:40 -08:00
Durham Goode
b9464c4718 revisionstore: add repair functions to Store
Summary:
In a future diff we'll be moving the IndexedLogHgIdDataStore to use the Store
type (that hides the differences between IndexedLog and RotateLog). To do so, it
needs to support repairs. Let's do some minor refactoring to enable this.

Reviewed By: xavierd

Differential Revision: D25371623

fbshipit-source-id: 846cb5f8c21f1e6b550a45259cc8da24cc65b13b
2020-12-09 07:07:39 -08:00
Stefan Filip
5f6d1a2c61 edenapi: add full_idmap_clone endpoint
Summary:
The end goal is to have clients using a sparse IdMap. There is still some work
to get there though. In the mean time we can test repositories that don't use
any revlogs. The current expections for those repositories are that they have
a full idmap locally.

Reviewed By: quark-zju

Differential Revision: D25075341

fbshipit-source-id: 52ab881fc9c64d0d13944e9619c087e0d4fb547c
2020-12-08 18:30:24 -08:00
Jun Wu
49c6f86325 streams: disable commit text prefetching
Summary:
It uses the Python iterator -> Rust stream code path, which can might
cause deadlock with async_runtme::block_on_exclusive. Avoid running
main Python logic in multiple threads.

The prefetching is only useful for lazy commit text backend, which hasn't been
rolled out yet. So disabling it won't cause pref regressions.

Note: This should not affect Phabricator Status prefetching.

Reviewed By: sfilipco

Differential Revision: D25350916

fbshipit-source-id: 49e9c4fea5ff48e1f579aa602693d38c7dd96fc7
2020-12-08 17:21:40 -08:00
Wez Furlong
7470b6023b eden: add config and awareness for our edenfs.kext
Summary:
This commit adds a new eden configuration option that
controls whether we try to load our edenfs.kext in preference to
an alternative fuse implementation on macOS.

The majority of this diff is plumbing to convey the configuration
value through to the privhelper, which is relatively restrictive
due to its root-ness.

I've also updated watchman and mercurial to be aware of the new
filesystem type that shows up in the mount table.

Reviewed By: genevievehelsel

Differential Revision: D25065462

fbshipit-source-id: 4f35b9440654298e2706a0d0613d97eb63451999
2020-12-07 11:18:09 -08:00
Johan Schuijt-Li
58f5b6a263 mononokepeer: fix incorrect error check
Summary: If response is not HTTP/1.1 or isn't Weboscket upgrade we should report error.

Reviewed By: HarveyHunt

Differential Revision: D25368729

fbshipit-source-id: 62dcd93240902924312f4de2965f58357c46c98b
2020-12-07 05:49:10 -08:00
Johan Schuijt-Li
37078cadc7 use integers in comparison for readauthforuri
Summary:
Further down the following check is executed:
  priority > bestpriority

When priority are strings, this leads to wrong expectations:
  $ python3
  >>> a = "90"
  >>> b = "100"
  >>> a > b
  True

Reviewed By: krallin

Differential Revision: D25334682

fbshipit-source-id: 48287d57ae6a938e9f2619babf49d073534f46d7
2020-12-07 05:49:09 -08:00
Durham Goode
23daa7f90f targets: remove python 2 targets
Summary:
Now that we don't ship Python 2 rpms, let's remove the build and test
targets.

Reviewed By: singhsrb, xavierd

Differential Revision: D25313325

fbshipit-source-id: 876385ccb6cb7675fef8d93978b372a3085764b0
2020-12-04 21:19:13 -08:00
Durham Goode
c1659751c9 shelve: add buck kill warning to shelve and unshelve
Summary:
T53602763 is about hg shelve and other similar
move-off-then-back-on-a-commit situations to get reported incorrectly to
watchman on eden checkouts. This can cause issues with buck and other tools.

The bug is in Eden, but let's try to save people time debugging by telling them
of the risk.

Reviewed By: fanzeyi

Differential Revision: D25337932

fbshipit-source-id: e293c43b5c87bea26564e1efd45b7a983862a442
2020-12-04 14:33:03 -08:00
Arun Kulshreshtha
3c63f41868 auth: migrate crate to autocargo
Reviewed By: singhsrb

Differential Revision: D25323754

fbshipit-source-id: 655a2f525f0f5267b6166310d8cb9598ae2f7b1b
2020-12-04 09:24:18 -08:00
Stefan Filip
f1b78f6afb thrift: update generated thrift assets
Summary: Regen

Reviewed By: singhsrb

Differential Revision: D25320884

fbshipit-source-id: bd3ce800257450b6cd32fb42a3c49e5ead01d4e3
2020-12-03 19:48:04 -08:00
Johan Schuijt-Li
d3224db357 use authentication abstraction for mononoke
Summary: This allows us to be more flexible in choosing authentication and expands variables used in configuration.

Reviewed By: singhsrb

Differential Revision: D25304008

fbshipit-source-id: 636893a9eaec31ca5acfa02f72931d5e56b695d0
2020-12-03 13:57:48 -08:00
Adam Simpkins
dea831d5ec fix Python deprecation warnings about PY_SSIZE_T_CLEAN
Summary:
Update pywatchman/bser.c to define `PY_SSIZE_T_CLEAN` before including
`Python.h` and then receive parsed string lenghts as `Py_ssize_t` rather than
`int`.  This eliminates some runtime Python warnings about the old `int`
behavior being deprecated.

Reviewed By: chadaustin

Differential Revision: D25294778

fbshipit-source-id: 7db678ed918db3bf4745ba716585ed6475d1c910
2020-12-03 10:58:47 -08:00
Jun Wu
ed473e23fd phrevset: do not return None for namespace lookup
Summary:
The `repo.names` namespace lookup should not return `[None]`. Detect and avoid
that to avoid crashes.

Reviewed By: singhsrb

Differential Revision: D25261462

fbshipit-source-id: c7a0bba557717ab292a05d753569c68112e7f0b0
2020-12-02 15:09:18 -08:00
Gregory Man
7400f86076 Added ramen alias to amend command
Reviewed By: gareve

Differential Revision: D25088884

fbshipit-source-id: a09cd7124834eafa0864c1cdaba087d4470ffbf8
2020-12-02 06:40:24 -08:00
Thomas Orozco
7df73c4afe hg log --sparse: throw a nicer error on non-sparse repos
Summary: Like it says in the title.

Reviewed By: ikostia

Differential Revision: D25196159

fbshipit-source-id: 9201a07201eaeb13efbe324b35377274c0611e6e
2020-12-02 03:45:15 -08:00
Meyer Jacobs
f16ef7dafd bindings: introduce C / C++ bindings to EdenAPI for use by EdenFS
Summary:
Introduce `edenapithin` crate, which offers C bindings to EdenAPI Client.

There are two top-level `owned` types, `EdenApiClient` and `TreeEntryFetch`, which represent `Box`ed results from calls to EdenAPI's blocking client. The C / C++ code is responsible for calling the associated `free` functions for these types, as well as `OwnedString`, which is used to represent error variants of a `Result` as a string.

Most functionality is provided through functions which operate on and return references into these top-level owned types, providing access into Rust `Result`s and `Vec`s (manually-monomorphized), and EdenApi's `TreeEntry` and `TreeChildEntry`.

Additional non-pointer types are defined in the `types` module, which do not require manual memory management.

C++ bindings are not included currently, but will be introduced soon.

Reviewed By: fanzeyi

Differential Revision: D24866065

fbshipit-source-id: bb15127b84cdbc6487b2d0e1798f37ef62e5b32d
2020-12-01 19:07:25 -08:00
Meyer Jacobs
293053b774 edenapi: expose "attributes" parameter in tree request API
Summary:
Introduce a new API type, `TreeAttributes`, corresponding to the existing type `WireTreeAttributesRequest`, which exposes which optional attributes are available for fetching. An `Option<TreeAttributes>` parameter is added to the `trees` API, and if set to `None`, the client will make a request with TreeAttributes::default().

The Python bindings accept a dictionary for the attributes parameter, and any fields present will overwrite the default settings from TreeAttributes::default(). Unrecognized attributes will be silently ignored.

Reviewed By: kulshrax

Differential Revision: D25041255

fbshipit-source-id: 5c581c20aac06eeb0428fff42bfd93f6aecbb629
2020-12-01 19:07:25 -08:00
Stefan Filip
03c55e82d0 edenapi: add full_idmap_clone functionality
Summary: Adding `full_idmap_clone` to edenapi and usign that in `debugsegmentclone`.

Reviewed By: quark-zju

Differential Revision: D25139730

fbshipit-source-id: 682055f7c30a94a941acd16e2b8e61b9ea1d0aef
2020-12-01 09:59:27 -08:00
Stefan Filip
b991370c3f commands: add debugsegmentclone
Summary: Prototype for cloning a repository using segmented changelog.

Reviewed By: quark-zju

Differential Revision: D24954821

fbshipit-source-id: 5ff42a5d60b6ba3e85dd4eab151e902bd4b96243
2020-12-01 09:59:27 -08:00
Stefan Filip
8327c54db1 dag: add DagImportCloneData::import_clone_data
Summary:
This method reconstructs a dag from clone data.

At the moment we only have a clone data construction method in Mononoke. It's
the Dags job to construct and import the clone_data. We'll consolidate that at
a later time.

Reviewed By: quark-zju

Differential Revision: D24954823

fbshipit-source-id: fe92179ec80f71234fc8f1cf7709f5104aabb4fb
2020-12-01 09:59:27 -08:00
Stefan Filip
042dcbb3a8 edenapi: update clone data request to POST
Summary:
The server expects post requests. At this time we don't want to cache this data
so POST.

Reviewed By: singhsrb

Differential Revision: D24954824

fbshipit-source-id: 433672189ad97100eee7679894a894ab1d8cff7b
2020-12-01 09:59:27 -08:00
Stefan Filip
559e152b2f clidispatch: update NoRepo commands to receive the config parameter
Summary:
The config is something that makes sense for all commands to have access to.
Commands that don't use a repo don't have access to the config that is prepared
by the dispatches. This change is a stop-gap to allow new commands that don't
require a repository to receive the config as an argument.

The construction of the config is something that we should iterate on. I see
the current implementaiton as a workaround.

Reviewed By: quark-zju

Differential Revision: D24954822

fbshipit-source-id: 42254bb201ba8838e7cc107394e8fab53a1a95c7
2020-12-01 09:59:26 -08:00
Katie Mancini
eb12120a0e fix hex(None) bug
Reviewed By: singhsrb

Differential Revision: D25136486

fbshipit-source-id: 61041c4f8582f99aca868374ef6a94d9e9ca167c
2020-11-30 16:03:01 -08:00
Durham Goode
bdaa63386d fsmonitor: filter out non-utf8 files
Summary:
On Python 3 we only support utf8 files. Python 3 has a way of
representing non-utf8 strings in utf8 format by utilizing surrogateescape, but
these strings cause issues in other parts of the codebase that don't expect
suorrageescaped strings (like the Rust code). Since we simply do not support
these paths, let's filter them out as soon as we get them from Watchman.

Reviewed By: quark-zju

Differential Revision: D25134079

fbshipit-source-id: 8be6893a6114b816097422f4469ac317fa3795d1
2020-11-30 10:22:13 -08:00
Johan Schuijt-Li
ec5fc72848 proxygen compatibility
Summary: As HG<->Mononoke will go through proxygen, testing showed that Proxygen forces us to use 'Upgrade: websocket' and confirm with the Websocket handshake. Adjust accordingly to do so.

Reviewed By: ahornby

Differential Revision: D25197395

fbshipit-source-id: ca00ac31be92817c6f1a99d7d492469b17b46286
2020-11-30 08:10:42 -08:00
James Donald
c7fe8b849e Fix merge on Windows when path contains spaces
Summary: editmergeps.bat was separating a filename with spaces into args[0] and args[1] when calling editmergeps.ps1. Use proper quoting to send files with spaces as a single argument.

Reviewed By: ikostia

Differential Revision: D25194324

fbshipit-source-id: 065f677c9015681b310e1cfc46f52ff563a35f99
2020-11-27 03:57:03 -08:00
Thomas Orozco
8840f92d07 edenapi server: properly deserialize history requests
Summary:
While trying to repro a user report (https://fburl.com/jqvm320o), I ran into a
new hg error: P151186623, i.e.:

```
KeyError: 'Key not found HgId(Key { path: RepoPathBuf("fbcode/thrift/facebook/test/py/TARGETS"), hgid: HgId("55713728544d5955703d604299d77bb1ed50c62d") })'
```

After some investigation (and adding a lot of prints), I noticed that this
was trying to query the EdenAPI server for this filenode. That request should
succeed, given Mononoke knows about this filenode:

```
[torozco@devbig051]~/fbcode % mononoke_exec mononoke_admin fbsource --use-mysql-client filenodes by-id fbcode/thrift/facebook/test/py/TARGETS 55713728544d5955703d604299d77bb1ed50c62d
mononoke_exec: Using config stage prod (set MONONOKE_EXEC_STAGE= to override)
I1126 08:10:02.089614 3697890 [main] eden/mononoke/cmdlib/src/args/mod.rs:1097] using repo "fbsource" repoid RepositoryId(2100)
I1126 08:10:02.995172 3697890 [main] eden/mononoke/cmds/admin/filenodes.rs:137] Filenode: HgFileNodeId(HgNodeHash(Sha1(55713728544d5955703d604299d77bb1ed50c62d)))
I1126 08:10:02.995282 3697890 [main] eden/mononoke/cmds/admin/filenodes.rs:138] -- path: FilePath(MPath("fbcode/thrift/facebook/test/py/TARGETS"))
I1126 08:10:02.995341 3697890 [main] eden/mononoke/cmds/admin/filenodes.rs:139] -- p1: Some(HgFileNodeId(HgNodeHash(Sha1(ccb76adc7db0fc4a395be066fe5464873cdf57e7))))
I1126 08:10:02.995405 3697890 [main] eden/mononoke/cmds/admin/filenodes.rs:140] -- p2: None
I1126 08:10:02.995449 3697890 [main] eden/mononoke/cmds/admin/filenodes.rs:141] -- copyfrom: None
I1126 08:10:02.995486 3697890 [main] eden/mononoke/cmds/admin/filenodes.rs:142] -- linknode: HgChangesetId(HgNodeHash(Sha1(dfe46f7d6cd8bc9b03af8870aca521b1801126f0)))
```

Turns out, the success rate for this method is actually 0% — out of thousands of requests,
not a single one succeeded :(

https://fburl.com/scuba/edenapi_server/cma3c3j0

The root cause here is that the server side is not properly deserializing
requests (actually finding that was a problem of its own, I filed T80406893 for this).

If you manage to get it to print the errors, it says:

```
{"message":"Deserialization failed: missing field `path`","request_id":"f97e2c7c-a432-4696-9a4e-538ed0db0418"}
```

The reason for this is that the server side tries to deserialize the request
as if it was a `WireHistoryRequest`, but actually it's a `HistoryRequest`, so
all the fields have different names (we use numbers in `WireHistoryRequest`).

This diff fixes that. I also introduced a helper method to make this a little
less footgun-y and double-checked the other callsites. There is one callsite
right now that looks like it might be broken (the commit one), but I couldn't
find the client side interface for this (I'm guessing it's not implemented
yet), so for now I left it as-is.

Reviewed By: StanislavGlebik

Differential Revision: D25187639

fbshipit-source-id: fa993579666dda762c0d71ccb56a646c20aee606
2020-11-27 02:48:58 -08:00
Thomas Orozco
e209225921 commitcloud: read backed up heads via backedup() revset
Summary:
The write & read path use different back up state files, which means they can
go out of sync. If that happens, it's a bit annoying because:

- The output of `hg cloud check` is out of sync with that of `hg sl`
- `hg cloud backup -r` says the commit is backedup, and `hg cloud check -r`
  says it isn't.

This diff fixes this by just using the `backedup()` revset, which under the
hood reads all state files.

Reviewed By: liubov-dmitrieva

Differential Revision: D25186071

fbshipit-source-id: 0ae2d43227d65a3564b2f796218b55982d5cc467
2020-11-26 06:35:57 -08:00
Thomas Orozco
95cc0e5a30 revisionstore: log more info when we time out
Summary:
Right now we just get a "deadline exceeded" error, which isn't very amenable to
helping us understand why we timed out. Let's add more logging. Notably,
I'd like to understnad what we've actually received at this point, if anything,
and how long we waited, as I'm starting to suspect this issue doesn't have much
to do with HTTP.

See https://fb.workplace.com/groups/scm/permalink/3361972140519049/ for
more context.

Reviewed By: quark-zju

Differential Revision: D25128159

fbshipit-source-id: b45d3415526fdf21aa80b7eeed98ee9206fbfd12
2020-11-23 01:45:54 -08:00
Durham Goode
132f37fa14 py3: fix hggit tests
Summary:
It turns out the hggit tests weren't passing in Python 3, despite us
having removed them from our py3-broken list. Woops. This fixes them and enables
the tests.

Reviewed By: sfilipco

Differential Revision: D25095189

fbshipit-source-id: acffca34b0d5defa7575ede60621ca2ce0a2afe4
2020-11-19 18:47:02 -08:00
Durham Goode
a0af56bbd4 extras: allow surrogateescaped byte extras
Summary:
Back in March we forced all extras to be strings. It turns out hggit
needs to write binary extras since it stores some binary patches in extras.
To support that, let's encode commit extras using surrogateescaped. That will
allow hggit to put binary data in extras in a later diff.

Reviewed By: sfilipco

Differential Revision: D25095190

fbshipit-source-id: 330bf06b15fc435f70119490557b8c22341b6ed9
2020-11-19 18:47:02 -08:00
Jun Wu
e91552fefe template: add rev f64 compatibility
Summary:
With segmented changelog, rev can exceed f64 safe range
(Number.MAX_SAFE_INTEGER in Javascript, 9007199254740991, 0x1fffffffffffff).
If rev is used in JSON, then the JSON cannot be parsed with precise rev
information.

This diff adds a compatibility mode so template will map the out-of-range revs
to safe range, and the mapped revs can be detected, and mapped back to be
resolved correctly.

Reviewed By: sfilipco

Differential Revision: D25079001

fbshipit-source-id: 52a5a2c8345a76355b8bf81435034d90c7c31610
2020-11-19 12:15:36 -08:00
Arun Kulshreshtha
45dd635486 treemanifest: prevent complete tree fetch after HTTP on-demand fetch
Summary:
The `getdesignatednodes` function returns a boolean indicating whether the requested nodes were actually fetched.

In the case of SSH, this is needed because the server may not support the `designatednodes` capability (only supported by Mononoke). If the fetch fails, Mercurial will fall back to an expensive complete tree fetch.

The HTTP version of this function accidentally omitted `return True`, which meant it implicitly returned `None`, which triggered the fallback path.

Reviewed By: sfilipco

Differential Revision: D25074067

fbshipit-source-id: 089d5382dd566db89ee732cdcb82762c8d43e21a
2020-11-18 17:44:12 -08:00
Johan Schuijt-Li
0cc4d4f100 introduce ability to talk to mononoke directly
Summary:
Skip the need to go through SSH/Mercurial servers. Directly connect to Mononoke
via TLS with X509 certificates.

Reviewed By: markbt

Differential Revision: D24756947

fbshipit-source-id: a782c894956d6a6be055eaa78287c040ceb57da7
2020-11-18 07:34:38 -08:00