Commit Graph

55539 Commits

Author SHA1 Message Date
Stanislau Hlebik
43e5d4f968 mononoke: add missing phases initialization
Reviewed By: krallin

Differential Revision: D19717875

fbshipit-source-id: b77b07cb081108bcc238990c823c196ddf00314a
2020-02-04 01:39:54 -08:00
svcscm
ea723b3eb5 Updating submodules
Summary:
GitHub commits:

bedf2a2d54

Reviewed By: yns88

fbshipit-source-id: 5fa3d59b1854af6d0e99518c5d8fd1bff731583d
2020-02-03 23:05:10 -08:00
Adam Simpkins
0e1437c823 py3: add some additional type annotations on functions writing file data
Summary:
Add a few additional type annotations on some functions.
This did require some minor code restructuring in `filestore.setfile()` to
work around pyre's unwillingness to unwrap `Optional` member variables.

Reviewed By: quark-zju

Differential Revision: D19715243

fbshipit-source-id: 8078329c1e4a50ad0aa6c765d42a89b5ed58e7bf
2020-02-03 21:36:56 -08:00
Adam Simpkins
0657c35391 py3: add more vfs-related type annotations
Summary:
Add more type annotations to vfs.py and some of the platform-specific
functions that it calls.

This did catch a couple of cases where string/bytes conversion were not being
done properly in Python 3.

Reviewed By: quark-zju

Differential Revision: D19678717

fbshipit-source-id: b3979cc5e0668ddbb93372dee25ef02ea1867d6f
2020-02-03 21:36:56 -08:00
svcscm
d8f1c0b0eb Updating submodules
Summary:
GitHub commits:

5a3956bd9f
db67a81b72
4c8fa7af24
7330ec0ff1

Reviewed By: yns88

fbshipit-source-id: 00d407bccddae9fffd9cf8986426e7d8e3c78cca
2020-02-03 18:53:59 -08:00
Jun Wu
9602130aab py3: chg: fix compatibility
Summary:
Fix various type issues when running chg under Python 3.
Enable chg in setup3.py build.

This should make tests run faster. For example, test-rebase-detach.t
now completes in 8 seconds, down from 29 seconds.

Reviewed By: xavierd

Differential Revision: D19702535

fbshipit-source-id: 8928b1b920b9b52fd03dc86f996da18f2405f146
2020-02-03 18:26:57 -08:00
Jun Wu
3e0b781197 py3: only use binary stdin/stdout/stderr
Summary:
Drop stdoutbytes/stdinbytes. They make things unnecessarily complicated
(especially for chg / Rust dispatch entry point).

The new idea is IO are using bytes. Text are written in utf-8 (Python 3) or
local encoding (Python 2). To make stdout behave reasonably on systems not
using utf-8 locale (ex. Windows), we might add a Rust binding to Rust's stdout,
which does the right thing:
- When writing to stdout console, expect text to be utf-8 encoded and do proper decoding.
- Wehn writing to stdout file, write the raw bytes without translation.

Note Python's `sys.stdout.buffer` does not do translation when writing to stdout console
like Rust's stdout.

For now, my main motivation of this change is to fix chg on Python 3.

Reviewed By: xavierd

Differential Revision: D19702533

fbshipit-source-id: 74704c83e1b200ff66fb3a2d23d97ff21c7239c8
2020-02-03 18:26:57 -08:00
Durham Goode
16d4739981 fsmonitor: catch watchman issue and fallback
Summary:
My earlier refactor moved a watchmanclient.getcurrentclock() call out
of a "try/except Exception" block. This meant any watchman errors broke the hg
status entirely, instead of falling back to the old status path.

Let's add the logic around this watchman path.

Reviewed By: sfilipco

Differential Revision: D19709391

fbshipit-source-id: bfb0221ba405a926babddaf73c8e70924e4d9b25
2020-02-03 18:04:25 -08:00
Jasmeet Bagga
a7246e9781 Factor our hw_port_stats_fb303 lib
Summary:
Implementation based on what we do in bcm layer
for reporting (non histogram) port stat counters. Abstracting
this lib out so we can reuse this code in both SAI and bcm
layers. Plus pulling this out of BcmPort makes it much
easier to unit test this code.

Reviewed By: boryas

Differential Revision: D19676641

fbshipit-source-id: 88aa20f20339729f5387500bcf6084871f4e7caa
2020-02-03 17:37:05 -08:00
svcscm
99387283e9 Updating submodules
Summary:
GitHub commits:

68d1a8790b
b1758cc2a0
38887da845
4d396b1953
ccbe2b93d5
973085cbfc

Reviewed By: yns88

fbshipit-source-id: b3e90c88df073fb57ce916276e017e949e57e9d0
2020-02-03 17:31:19 -08:00
Jun Wu
2777fea957 py3: localrepo: manually fixup some type annotations
Summary: This might help pyre check more things.

Reviewed By: farnz

Differential Revision: D19678144

fbshipit-source-id: a04207ccb04ce76796e9a0a7326a8d527d17cff1
2020-02-03 17:07:36 -08:00
Jun Wu
165a8d4f8d py3: add stub for localrepository
Summary:
The "repo" type is a bit hard to type since it might be wrapped by extensions,
and the decorators like "unfilteredmethod" are too hard for type checkers.

Provide a stub for it so typecheck can work. The stub was generated by `pytype`,
I made a small change to `close` to make pyre happy.

Reviewed By: DurhamG

Differential Revision: D19677410

fbshipit-source-id: 71afb3fe78a75ee269c8005d18eee3a807b50df6
2020-02-03 17:07:36 -08:00
Aida Getoeva
38fca29eaf hg-py3: fix restack-multidest/t and fold
Reviewed By: xavierd

Differential Revision: D19700265

fbshipit-source-id: 557cec8388d5c7759d24e1b995f971e72f925a30
2020-02-03 17:05:35 -08:00
Aida Getoeva
acc0425925 hg-py3: make amend-next/prev work
Reviewed By: xavierd

Differential Revision: D19700028

fbshipit-source-id: 9aaab361058a2dfa34f4d0c9218c71c1654aaa8a
2020-02-03 17:05:34 -08:00
Wez Furlong
4c5168658f eden: teach eden redirect to use new apfs helper tool
Summary:
This commit enables mounting and unmounting using the
new helper, and fixes up the behavior of `eden redirect list`
and `eden gc` so that they have reasonable behavior when APFS
is in the mix.

The semantics of the `TARGET` field in the redirect list output
become a bit hazy when using APFS volumes; it's a bit less important
because the data isn't effectively moved to a different part of
the filesystem namespace: we're just mounting a different filesystem
over the top and it can only be accessed through its mountpoint.

Reviewed By: chadaustin

Differential Revision: D19403162

fbshipit-source-id: 136a7b02f605cde0a74016608179924be801eda9
2020-02-03 16:59:18 -08:00
Wez Furlong
30d0a77d53 eden: add helper command for working with apfs
Summary:
We've had a small proportion of our users run into problems
with hdiutil and diskimages-helper, where those components get into
an unhappy state and effectively block operating on the redirections.

This diff introduces a new utility that is intended to replace the
use of disk image files with APFS volumes that we mount in the
appropriate places.

The intention is that we will teach `eden redirect` to use this tool
when available, rather than disk images.

macOS's security model is weird: it is perfectly valid for a non-privileged
user to create and delete APFS volumes in the APFS storage container,
but root privs are required to mount it into the VFS.

The intent is that we deploy this utility setuid root to minimize
the fan out--this way we won't need to teach the priv helper about
this kind of redirection.

There are a couple of subcommands demonstrated in the test plan.

Reviewed By: chadaustin

Differential Revision: D19323850

fbshipit-source-id: 35556f841e49e5c4b77679b756af9093222f4500
2020-02-03 16:59:17 -08:00
Chad Austin
ad6b3f5323 require eden rm be given the checkout root
Summary:
To avoid accidents when people run `eden rm` with a subdirectory of
the mount, require that it be given the checkout root (or a symlink to
it).

Reviewed By: genevievehelsel

Differential Revision: D19549912

fbshipit-source-id: ae0a43e9164f73f5ad9c2f40f1b7226a1e85a567
2020-02-03 16:27:09 -08:00
svcscm
21f3196b8b Updating submodules
Summary:
GitHub commits:

d5d8571ec4
31a45b5039
36c504be17
321cd537b1

Reviewed By: yns88

fbshipit-source-id: 0b76baa11b371d4e67f2663ef2b7ee1ac9d57d56
2020-02-03 15:57:59 -08:00
Adam Simpkins
b6ce7a08a6 py3: make vfs.join() consistent across subclasses; add type hints
Summary:
Add type hints for `vfs.join()`.  Not all subclasses supported joining
multiple arguments, so fix them all to actually implement the full API.

Reviewed By: farnz

Differential Revision: D19678712

fbshipit-source-id: f7f77eee416cd5edda756a8423cbe3630e195d4a
2020-02-03 15:27:52 -08:00
Adam Simpkins
bb9599d1ba py3: exclude mercurial/pycompat3.py from Python 2 builds
Summary:
Update setup.py to exclude `edenscm/mercurial/pycompat3.py` when building
for Python 2.

Reviewed By: quark-zju

Differential Revision: D19703778

fbshipit-source-id: 269f1d4e746eb5112a9e577f43c040f2946b07d1
2020-02-03 15:13:09 -08:00
Yedidya Feldblum
8e6f529d4a Use cacheline_aligned in Tracer
Summary: [Eden] Use `cacheline_aligned` in `Tracer`.

Reviewed By: aary

Differential Revision: D19628287

fbshipit-source-id: 4730c995bc9c11a3d1e485971eef54cb9b329aa8
2020-02-03 14:47:07 -08:00
Sam Uong
974db0c7cd hgext: add hg equivalent for 'git stash clear'
Reviewed By: farnz

Differential Revision: D19669269

fbshipit-source-id: 2d33aae66b1733b9085adb829b38a07afd80fdd8
2020-02-03 12:59:46 -08:00
Stanislau Hlebik
172e9c4d80 mononoke: actually asyncify a function in x_repo_sync_job
Summary:
I was supposed to do it D19691216, but accidentally reverted all the changes :(

This diff brings them back

Reviewed By: farnz

Differential Revision: D19698315

fbshipit-source-id: 5f20d27dfd33f3464d126ad72e6d49485366be3d
2020-02-03 12:43:33 -08:00
svcscm
ee6d3b4b10 Updating submodules
Summary:
GitHub commits:

56e51c85f9

Reviewed By: yns88

fbshipit-source-id: 2ab22633b8e0647a6af07b47c137cf7f8e11b972
2020-02-03 11:37:29 -08:00
Chad Austin
49102f1925 switch unsafe folly::collect calls to collectSafe
Summary:
There were some unsafe uses of folly::collect, especially in
the diff code. Switch to collectSafe.

Reviewed By: simpkins

Differential Revision: D19529784

fbshipit-source-id: e0ac920a2d2b44767a453f2c41a9166e72246ab6
2020-02-03 11:30:50 -08:00
Chad Austin
0a28623f9a add a collectSafe function
Summary:
folly::collect's Future is completed immediately when any of its input
future is completed with an exception. This makes forking off subtasks
and then joining with folly::collect dangerous when closures don't
hold pointers or references to parameters, including `this`. Introduce
a collectSafe function, which has the same signature as folly::collect
but unconditionally waits until all futures are completed.

Reviewed By: simpkins

Differential Revision: D19529772

fbshipit-source-id: b3b493fcbb0d9058d2d6e5c8a064dfdae3a43e57
2020-02-03 11:30:50 -08:00
Aida Getoeva
201a17ca37 hg-py3: make amend-to work
Reviewed By: quark-zju

Differential Revision: D19673900

fbshipit-source-id: cfdc985716aec23335eeddef517855be65505576
2020-02-03 10:04:38 -08:00
Jun Wu
a8f232e0ab py3: drawdag: fix some types
Summary: This fixed using drawdag to create merge commits.

Reviewed By: xavierd

Differential Revision: D19697893

fbshipit-source-id: fac4278a54d2cf2eb2b9d8154a13edd29e1a510a
2020-02-03 09:54:12 -08:00
Simon Farnsworth
ad40d8567f py3: fix up matchers to exclusively use unicode
Summary: Matchers were mixing str and bytes - use decodeutf8 on the place using bytes, and enable all the tests that now pass.

Reviewed By: quark-zju

Differential Revision: D19679076

fbshipit-source-id: 2b90cfbf690b2365a1302efd9db72347a295c977
2020-02-03 08:00:11 -08:00
Jun Wu
18a20f5301 context: add some type annotations
Summary: This gives type checker some hints. Pyre can now look into more areas.

Reviewed By: markbt

Differential Revision: D19676085

fbshipit-source-id: db05b4238051953eb7f8af44da220825ec589c3c
2020-02-03 07:35:32 -08:00
Jun Wu
4e272b6fad revlog: add some type annotations
Summary:
This gives type checker some hints. Pyre was able to find some issues,
which are fixed.

Reviewed By: markbt

Differential Revision: D19674436

fbshipit-source-id: 44d6df6037f27e2edeff4d343a9fdec5e51420b3
2020-02-03 07:35:32 -08:00
Jun Wu
348ce20341 py3: add type annotations to i18n
Summary: This allows type checkers to understand the i18n._ calls.

Reviewed By: markbt

Differential Revision: D19673677

fbshipit-source-id: be2cc72f70e56925007485c786f0d72b5cd40a1a
2020-02-03 07:35:31 -08:00
Lukas Piatkowski
769500d2f8 cargo_from_buck: refactor handling of dependencies in preparation for future diffs
Summary: Dependencies are getting quite complicated to handle in the generator with all the corner cases. This refactory should make it easier to work with them.

Reviewed By: ikostia

Differential Revision: D19690523

fbshipit-source-id: 64c0289679e492db03837ebb02d01207a1548665
2020-02-03 06:20:00 -08:00
Pavel Aslanov
b451af2cea remove BlobRepo::rechunk_file_by_content_id
Summary: `BlobRepo::rechunk_file_by_content_id` only used once and just calls `filestore::rechunk`, so it is safe to remove it

Reviewed By: StanislavGlebik

Differential Revision: D19691267

fbshipit-source-id: f40b4dc14295f91f6134c29ddbfeaa8abd66535e
2020-02-03 05:13:33 -08:00
Igor Kruk
38956898da Push compat down one level in fbcode/scm/mononoke/hgcli/src/main.rs
Summary: Push down usage of `compat`

Reviewed By: farnz

Differential Revision: D19690633

fbshipit-source-id: 9c12c3bd0a1dbecac27002b2522d4c13bbbd293b
2020-02-03 05:06:20 -08:00
Liubov Dmitrieva
bf54ff1040 mononoke_api: add methods for resolving prefix of hg changeset to the full hash
Summary:
This is intended to be used in implementation of 'identify' API of
SCS.

Reviewed By: markbt

Differential Revision: D19640581

fbshipit-source-id: b93c4d8b60b59ce67b5090394083707e6ee8a3c7
2020-02-03 04:30:12 -08:00
Stanislau Hlebik
3f6911aefe mononoke: disable filenode generation during hg changeset generation
Summary:
Now that we have FilenodesOnlyPublic derived data we no longer need to generate
filenods when we generate hg changesets.

This is important, because we want to generate hg changesets for both public
and draft commits, but we want to generate filenodes only for public commits.
By separating filenodes generation from hg changeset generation we can finally
achieve that.

This diff is the final step - it removes IncompleteFilenodes struct completely.

A few caveats:
1) This diff also removes regenerate_filenodes binary - backfill_derived_data can
be used instead.
2) In D18748102 we added a hack that force-backfilled filenodes when a merge
commit is pushed. This hack is no longer necessary and it was removed, but we
still want to protect against pushing too many commits with no filenodes
generated for them. So instead of force backfilling the filenodes the code now
just checks how commits are missing filenodes.

Reviewed By: aslpavel

Differential Revision: D19683369

fbshipit-source-id: adf613defa50400e55a95dbe14053d954b88016b
2020-02-03 04:11:22 -08:00
Stanislau Hlebik
801ed0a02b mononoke: fix test
Summary:
The idea of the test was that this should be a stack of empty commits, and deriving
the top one also derives the bottom commit. The test happened to pass because
we still generate filenodes during hg changeset generation, however it started
to break in the next diff. So this diff fixes the test.

While at it also fix the comment

Reviewed By: farnz

Differential Revision: D19690293

fbshipit-source-id: d46f5686c8468b5a180104c9e5313e51eafc3092
2020-02-03 04:11:22 -08:00
Stanislau Hlebik
63d39f5aa2 mononoke: add count_underived() function to derived data
Summary:
This function can be used to count how many ancestors of a commit do not have
data derived. It will be used in the next diff

Note that count_underived() function traverses the commit graph, so it can be
quite expensive. That's why `limit` parameter is required to bound the walk.

Reviewed By: farnz

Differential Revision: D19683368

fbshipit-source-id: 2ca07db19fc10b5ea86107b084a28072ec4703fa
2020-02-03 04:11:21 -08:00
Alex Hornby
ac166c0352 mononoke: phases: remove unused is_public method from trait
Summary: Phases::is_public was only used from test code, so moved it to be test only.

Reviewed By: StanislavGlebik

Differential Revision: D19644697

fbshipit-source-id: 1d770a9e40fa2593ebe6f34b80ead90495e69d24
2020-02-03 00:47:01 -08:00
Alex Hornby
6ae3628f95 mononoke: walker: fix race when loading phases
Summary:
The is_public check calls phases.get_public_derive, which in turn calls repo.get_bonsai_heads_maybe_stale. The later is a race as the heads may be out of date vs the changesets being walked if the walker is very near a recent commit.

This change loads the heads information once, so that it can be used in calls to get_public_derive throughout the walk

Also removes the SqlPhases dependency, walker now works using dyn Phases

Reviewed By: krallin

Differential Revision: D19601580

fbshipit-source-id: 31779c4d858cb4fa3ca98dc715d624a6b2ad8cd6
2020-02-03 00:47:00 -08:00
Alex Hornby
3d4aa58a8a mononoke: phases: move ephemeral_derive up from SqlPhases to Phases
Summary:
Updates the Phases trait and its cached implementation so that the ephmeral_derive option is visible.

This api change is in preparation for decoupling the by the walker from SqlPhases.

Reviewed By: krallin

Differential Revision: D19621212

fbshipit-source-id: c09006e8d05a7d49e9c4ba2c3cc240caa216f023
2020-02-03 00:47:00 -08:00
svcscm
ffc024f080 Updating submodules
Summary:
GitHub commits:

094f2dc14a

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 0cca2f031ada97e5a55d081b45724dd0b1765797
2020-02-03 00:23:14 -08:00
Stanislau Hlebik
515f1a7d9c mononoke: remove filenodes generation from CreateChangeset
Summary:
We have two ways to generate hg changesets in Mononoke: generate new hg
changesets from a bonsai changeset (see
BlobRepo::get_hg_from_bonsai_changeset() function) or accept a commit
generated by Mercurial either via blobimport or through the wireproto unbundle
command(CreateChangeset).

The main goal of the stack is to remove filenode generation from both of those
places, and this diff cleans up the CreateChangeset. By doing it we are able to get rid
of an ugly hack of specifying whether a commit is draft or not.

Reviewed By: krallin

Differential Revision: D19516956

fbshipit-source-id: 77921612a919a52f6ce1ddfbf55944ca300db46e
2020-02-03 00:02:24 -08:00
svcscm
69226e87c3 Updating submodules
Summary:
GitHub commits:

fee60a9970
f955452b9d
95f14ac0f6
90be2fb514

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 410d0265474975d2423740a48a75f77800908bea
2020-02-02 15:32:05 -08:00
svcscm
d55c8e5701 Updating submodules
Summary:
GitHub commits:

17b702e135
79fae0d0eb
c0bafd6714
9297051c6f

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 14723190546c44093dac3fb7c5e323e294032eb4
2020-02-01 15:02:18 -08:00
Durham Goode
14ec2d4b34 py3: enable more tests
Summary: These now pass

Reviewed By: farnz

Differential Revision: D19678869

fbshipit-source-id: 68601ff6a6d33b13947210eecfecd999aa2ddb1a
2020-02-01 10:39:39 -08:00
Adam Simpkins
df74c3e8fa py3: start adding type hints in mercurial/vfs.py
Summary:
Begin adding type hints to many of the vfs methods.

These type hints indicate that the vfs objects are always opened in binary
mode.  While it is possible to open a vfs in text mode if you explicitly
specify the argument `text=True`, this is very rare.  If we run into cases
in the future that do need type hints to indicate TextIO mode I think it would
be better to split those out into completely separate functions, rather than
having functions that sometimes return bytes and sometimes return str based on
the arguments used.

Reviewed By: markbt

Differential Revision: D19673538

fbshipit-source-id: 8683223f28964d4b43fe131d4f16f8877dcbe777
2020-02-01 10:32:51 -08:00
Adam Simpkins
3c8739e179 py3: add type hints for util.atomictempfile
Summary:
Make `atomictempfile` derive from `typing.BinaryIO` so that the type checker
understands it can be used like a file.

This required defining all `BinaryIO` methods on this class.  This does result
in a fair amount of additional boilerplate code, but seems like the easiest
approach for now.

Reviewed By: markbt

Differential Revision: D19673539

fbshipit-source-id: b5775ca79b3af456b45e4ef5480711d7095e7949
2020-02-01 10:32:51 -08:00
svcscm
4434ce9947 Updating submodules
Summary:
GitHub commits:

d8b4f2ff66
daa254211a
9c4684ff10
fdb82b21cb

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 4e74f7e888cc2004ba937d3bb253645fbd2388c5
2020-01-31 23:23:00 -08:00