Commit Graph

45774 Commits

Author SHA1 Message Date
Saurabh Singh
0b0f262d0f infinitepush: introduce server side command for moving a scratch bookmark
Reviewed By: markbt

Differential Revision: D14919847

fbshipit-source-id: 5ae1750e78b24ac6126b621ca34942d7fb46d4fe
2019-04-16 09:54:27 -07:00
Saurabh Singh
c6aab56946 infinitepush: introduce server side command for creating scratch bookmark
Reviewed By: markbt

Differential Revision: D14919850

fbshipit-source-id: 2eef682fa528b82d0b9bdac1bad66ec47d552d3c
2019-04-16 09:54:27 -07:00
Mateusz Kwapich
802213bcbb phabricator: query the draft changes too
Summary: The super-smartlog shows "local changes" even when you have some unattached draft changes associated with the diff. This diff changes that.

Reviewed By: quark-zju

Differential Revision: D14936057

fbshipit-source-id: 32204ef9c5fa862923a165624913ecb344ed4a73
2019-04-16 06:33:30 -07:00
Stanislau Hlebik
e1e5d4bb0d pushrebase use hookargs correctly if transaction was taken
Summary:
Context: for Mononoke sync job we are considering applying a few pushrebase
bundles under the same transaction to make sync job faster. More details -
https://fburl.com/y4we86hc

Doing two pushrebases under the same transaction seems to fail for  just one
reason - `hookargs` is None on the second bundle. The reason is this line -
https://fburl.com/y4we86hc, after gettransaction() is called
bundleoperation.hookargs is set to None, but transaction.hookargs is set to
current hookargs value.

In this diff pushrebase is changed to check both bundleoperation.hookargs and
transaction.hookargs

Reviewed By: quark-zju

Differential Revision: D14930970

fbshipit-source-id: e4a4dd1c85b1fdca2699dd431040d65f2642ec8a
2019-04-16 03:10:02 -07:00
Mark Thomas
f337e0d5e4 sampling: fail gracefully when ui.log arguments are not a valid format
Summary:
`ui.log` expects to be called with valid format arguments.  If the arguments
are not a valid format string, or the number of arguments doesn't match the
number of format placeholders, formatting will fail.

In this case, catch the exception and fail gracefully.  Don't even bother
formatting if there is exactly one argument.

The `blackbox` extension already does this, so extend to the `sampling`
extension.

Also fix the place where `perftrace` calls `ui.log` with a string that might
contain formatting placeholders.

Reviewed By: quark-zju

Differential Revision: D14938952

fbshipit-source-id: 1d9802308dba925109c018124d51273c348526b4
2019-04-16 01:21:55 -07:00
Jun Wu
c39081d1b9 slides: fix check-code
Summary: Not sure why buck tests didn't capture this one.

Reviewed By: sfilipco

Differential Revision: D14946576

fbshipit-source-id: acbac0b071722970442344ba0ba6f4af1ff1392c
2019-04-15 20:34:44 -07:00
Arun Kulshreshtha
68e1c44335 types: add DataEntry type
Summary: Add a new type representing a file content entry on the wire. This type is serializable and includes file content itself as well as the filenode's parents, which collectively allow for filenode hash verification.

Differential Revision: D14907957

fbshipit-source-id: ed0f85270c98bd5675da8553ffbfa0549b574b7f
2019-04-15 17:32:44 -07:00
Chad Austin
179e2d2db4 fix crash in sampling
Summary: `log` itself does the interpolation, so don't do it in advance.

Reviewed By: quark-zju

Differential Revision: D14941862

fbshipit-source-id: 6885202cfbff4ce0310d68bb1676369c3ef64c53
2019-04-15 17:27:53 -07:00
Saurabh Singh
25970ea3a5 slides: fix typo in segmented changelog slides
Reviewed By: quark-zju

Differential Revision: D14940136

fbshipit-source-id: 97b9cff83ffbdfe9b5b12b87e5f784f33473aaf6
2019-04-15 15:16:24 -07:00
Jun Wu
0cb5d52158 slides: add the segmented changelog slide
Summary:
The segmented changelog idea is somehow interesting. It went through several
iterations. The current form seems good to be checked in.

This time the source is not Markdown, but a Python script to generate tex code.
The generated PDF is small so I checked it in for convenience. It's not too
trivial to get all the build dependencies setup correctly.

The script has some interesting functions like `dag`. It can be reused in
future slides.

Reviewed By: singhsrb

Differential Revision: D14937221

fbshipit-source-id: 539e5b11b6fc67c0f7b393673513580456671fad
2019-04-15 13:17:13 -07:00
Arun Kulshreshtha
382a42d958 edenapi: switch to CBOR for data serialization
Summary:
Previously, the Eden API endpoints on the API server used JSON for encoding requests/responses for debugging purposes. Given that these APIs are mostly used to transfer large amounts of binary data, we should use a binary encoding scheme in production. CBOR fits the bill since it is essentially binary JSON, allowing for more efficient coding of large byte strings.

Although this is a breaking API change, given that nothing depends on these endpoints yet, it should be OK to simply change the format.

Differential Revision: D14907978

fbshipit-source-id: e0aea30d7304f4b727e2ad7fe23379457b6c3e26
2019-04-15 12:32:25 -07:00
Arun Kulshreshtha
852626bbdb types: move quickcheck macro imports into tests module
Summary: Previously, this import would trigger dead code warnings because it would be conditionally included with either `cfg(test)` or the `for-tests` feature, whereas the tests module (which was the only user of the import) would only be conditionally included with `cfg(test)`. Fix the warning by moving the import into the tests module itself.

Reviewed By: quark-zju

Differential Revision: D14936954

fbshipit-source-id: ef7a84e8d36645624077283a0fb7798a1746f579
2019-04-15 12:14:25 -07:00
Xavier Deguillard
312286d5d0 remotefilelog: do not attempt repack on not existing directory
Summary:
Looking at the Hgerrors scuba table, I noticed that a lot of the sandcastle
machines had repack failures due to "No such file or directory". I'm suspecting
that's due to not having a local store to repack, and therefore listing of
files to repack would fail. Let's verify that the directory is present before
repacking to avoid this issue.

Reviewed By: quark-zju

Differential Revision: D14906503

fbshipit-source-id: 98fbe57310511df4fc9856bf71f836adefb3d855
2019-04-15 11:06:05 -07:00
Xavier Deguillard
0ad557a531 test: add a test showing rust repack failure on non present directories
Summary:
Looking at the Hgerror scuba table, I see a lot of failures due to ENOENT on
Sandcastle. I'm suspecting this has to do with Sandcastle not having a local
manifest.

Reviewed By: quark-zju

Differential Revision: D14906506

fbshipit-source-id: a5d3eec824168e78ce3146dbde2d2bbbed1702f9
2019-04-15 11:06:04 -07:00
Stefan Filip
d45e21573a revisionstore: use RepoPath in HistoryPackIterator
Summary: migration

Reviewed By: quark-zju

Differential Revision: D14908310

fbshipit-source-id: 76623300c04bd8643796a99f66d9d3144787f072
2019-04-15 10:01:52 -07:00
Stefan Filip
be522e8dc5 revisionstore: remove uses Key::from_name_slice
Summary: migration

Reviewed By: quark-zju

Differential Revision: D14908315

fbshipit-source-id: 5d7d11982b70d10b49bb7fcd12cc6bf9c98146d6
2019-04-15 10:01:52 -07:00
Stefan Filip
77cdaca742 types: remove uses of Key::from_name_slice
Summary: migrating

Reviewed By: quark-zju

Differential Revision: D14908314

fbshipit-source-id: 92d9092bd879858349ab3b8cb98a484451c0442b
2019-04-15 10:01:52 -07:00
Stefan Filip
ee7703e821 revisionstore: use RepoPath in HistoryEntry
Summary: migrating

Reviewed By: quark-zju

Differential Revision: D14884957

fbshipit-source-id: 865f970627c08a26d1336fa57235f8ebbdb1d4a9
2019-04-15 10:01:51 -07:00
Stefan Filip
dd4a010aac revisionstore: use RepoPath in HistoryPack
Summary: Migrating

Reviewed By: quark-zju

Differential Revision: D14884958

fbshipit-source-id: 34bf2ea726b19f9929652d9836a224baac8b328b
2019-04-15 10:01:51 -07:00
Stefan Filip
a40d9db09d types: update history entry to use RepoPath
Summary: Refactoring

Reviewed By: quark-zju

Differential Revision: D14877540

fbshipit-source-id: c275c335ffe89ebf2fa1229925b1db2015374659
2019-04-15 10:01:51 -07:00
Saurabh Singh
0f155ea3f7 infinitepush: move scratch bookmark matcher to common module
Summary:
This functionality is generic enough to be inside the common module so
that it can be shared easily. Upcoming commits will make use of this
functionality by importing from the common module.

Reviewed By: markbt

Differential Revision: D14919848

fbshipit-source-id: b3b7eef9eb0929334cba7ce869e7c9377c265da2
2019-04-15 09:29:31 -07:00
Saurabh Singh
839a5ffa93 infinitepush: move infinitepush server check to common module
Summary:
This functionality is generic enough to be inside the common module so
that it can be shared easily. Upcoming commits will make use of this
functionality by importing from the common module.

Reviewed By: markbt

Differential Revision: D14919849

fbshipit-source-id: 74c6ad5158bd196bb062e2ec7b04ca121b5d2c3a
2019-04-15 09:29:30 -07:00
Max Kareta
27abd9e79d dispatch: fixed arguments escaping before invoking hooks
Summary:
This diff adds args escaping using single quote symbol before sending them to hooks.
Before all arguments where joined by space symbol " " which was producing incorrect result when argument itself contains space symbol.

Reviewed By: markbt

Differential Revision: D14799188

fbshipit-source-id: df5a4324d138515a4b881df96f2991de03df7a5b
2019-04-15 06:56:50 -07:00
Mark Thomas
f4245770a3 shelve: add shelvename template keyword
Summary:
Add `shelvename` template keyword, which expands to the name of the shelve for
commits that contain shelves.

Reviewed By: farnz

Differential Revision: D14932985

fbshipit-source-id: cddebd2dbc6454f7c61ed296f37822179da8a2de
2019-04-15 05:44:49 -07:00
Stefan Filip
7e2b3c256f types: rename Key::new to Key::from_name_slice
Summary:
We should update the builder for Key to take a repo path. We could build
the key directly using the default struct constructor but representing
the two constructors as functions is more clear.

Reviewed By: quark-zju

Differential Revision: D14877543

fbshipit-source-id: 328906521cdbad535e28df22fea82f21e8b5410a
2019-04-14 19:56:50 -07:00
Stefan Filip
e4fc87ac37 types: deprecate Key::name
Summary:
Marking the uses of byte arrays for repository paths as deprecated
to make it easier to remove uses in the code.

Reviewed By: quark-zju

Differential Revision: D14877541

fbshipit-source-id: 4c06e0f7012a33cc92752530618396c3c529f986
2019-04-14 19:56:50 -07:00
Stefan Filip
4d59694b10 types: change the underlying type for Key::path to RepoPath
Summary:
It is fairly difficult to avoid an intermediary state where we don't have some
panics. Since we don't really deal with invalid paths this intermediary state
is not a real concern.

Reviewed By: quark-zju

Differential Revision: D14877553

fbshipit-source-id: 6f60f20af8d8f1e3ff23c5d8ab5353bc8d919ebf
2019-04-14 19:56:49 -07:00
Stefan Filip
b291cdb244 types: optimize PathComponentBuf::arbitrary
Summary:
The overhead of generating all the different strings is noticeable when
we start to generate a lot of values.

Reviewed By: quark-zju

Differential Revision: D14877547

fbshipit-source-id: 8a91241ff3e86b6ac9b68197c449ed2be445f941
2019-04-14 19:56:49 -07:00
Stefan Filip
967cd9c01b revisionstore: use testutil in indexdlogdatastore
Summary: testutil everywhere

Reviewed By: quark-zju

Differential Revision: D14884959

fbshipit-source-id: 7f999179866e4d71f0e89bd00df168e5932818f2
2019-04-14 19:56:49 -07:00
Stefan Filip
885c477d3b revisionstore: update mutabledatapack to use testutil
Summary: testutil everywhere

Reviewed By: quark-zju

Differential Revision: D14877550

fbshipit-source-id: 3aa7a345adaac3444ce73ae6c20326bbcef9e873
2019-04-14 19:56:48 -07:00
Stefan Filip
91245a8749 revisionstore: use testutil in datapack
Summary: testutil everywhere

Reviewed By: quark-zju

Differential Revision: D14877542

fbshipit-source-id: f4bd4bf97206d2a2f5deb4d28d22f9dd7bec5a72
2019-04-14 19:56:48 -07:00
Stefan Filip
792a366a91 types: add RepoPathBuf::from_utf8(Vec<u8>)
Summary: This builder is the mirror of `String::from_utf8` in the RepoPathBuf type.

Reviewed By: quark-zju

Differential Revision: D14877551

fbshipit-source-id: de79c36b0f5d638aad12428f7e5ee1bbe19c4bc6
2019-04-14 19:56:48 -07:00
Stefan Filip
1794ce765d types: make Key::name a private member
Summary: This is preparation to change the backing storage from Vec<u8> to RepoPath

Reviewed By: quark-zju

Differential Revision: D14877544

fbshipit-source-id: a7f3c805fcc9bc96a4135b2e36e73e2662cec54e
2019-04-14 19:56:48 -07:00
Stefan Filip
bec1a1d3e0 types: add mocks for RepoPathBuf
Summary: This will be used in transitioning key from bytes to repo path.

Reviewed By: quark-zju

Differential Revision: D14877548

fbshipit-source-id: f79863469d58b53557e51ebb033cc6a6b5f43499
2019-04-14 19:56:47 -07:00
Stefan Filip
cca46940f6 types: mark RepoPathBuf serializable
Summary:
Nothing fancy for RepoPathBuf to prevent us from marking them Serializable.
These will be used by the api server to wire data.

Reviewed By: quark-zju

Differential Revision: D14877552

fbshipit-source-id: 1a8728e28209213fced06d739698099ab8c462f2
2019-04-14 19:56:47 -07:00
Stefan Filip
78d11002eb types: remove Key::node()
Summary:
This function is difficult to justify in the context of the Rust borrow checker.
The primary concern for this pattern is preventing mutation when the object is
passed around.

We can always add the function back if it has to more than just return the
underlying value.

Reviewed By: quark-zju

Differential Revision: D14877545

fbshipit-source-id: acdd796e1bee5445c1bce5ce0ceb41a7334e4966
2019-04-14 19:56:47 -07:00
Stefan Filip
9014310969 types: update RepoPath::from_utf8 to take AsRef
Summary: AsRef as a parameter is more flexible than direct slice.

Reviewed By: quark-zju

Differential Revision: D14908313

fbshipit-source-id: 07b317f151403be433eded136122bf652c887a07
2019-04-14 19:56:47 -07:00
Stefan Filip
a420476a20 revisionstore: migrate repacks.rs to use testutil
Summary: testutil everywhere

Reviewed By: quark-zju

Differential Revision: D14877549

fbshipit-source-id: 9df8e76068e68eff2895a6454dff13b21f2894ac
2019-04-14 19:56:46 -07:00
Stefan Filip
abbb2a5f7a revisionstore: use testutil in ancestors
Summary: testutil everywhere

Reviewed By: quark-zju

Differential Revision: D14877546

fbshipit-source-id: cb1534cf925a633370dd60a3191855d14bbaa84e
2019-04-14 19:56:46 -07:00
Stanislau Hlebik
8adfcdd88c hgsql: use fetchall method in committodb
Summary:
It makes this method 25-30% faster (shaves off 250-300 ms).

Also it counts number of fetched rows correctly - fetchall method was
overriden, but looks like __iter__ method wasn't

Reviewed By: ikostia

Differential Revision: D14915472

fbshipit-source-id: 313695c1a83d05dac2fc801792226b6b64539cb5
2019-04-13 03:20:27 -07:00
Stefan Filip
14fde96b83 tests: fix test-hgsql-encoding
Summary: This test was failing because mercurial wants the file paths to be valid utf-8.

Reviewed By: singhsrb

Differential Revision: D14924604

fbshipit-source-id: be2db5c437df77ad3ad70f6956451e4a03835378
2019-04-12 19:57:44 -07:00
Arun Kulshreshtha
106c528c30 amend: remove dead code
Summary: This extension has been refactored many times, resulting in some code and config options that are (as far as I can tell) completely unused. Let's remove them.

Reviewed By: singhsrb

Differential Revision: D14920751

fbshipit-source-id: 8d716a1d6144ba51cdb2750f6cfc6d6262b3b8a3
2019-04-12 14:24:46 -07:00
Mark Thomas
9160d34e9e histedit: fix call to hex in loginfo
Reviewed By: mitrandir77

Differential Revision: D14911288

fbshipit-source-id: f0cfda26022da98c3722946511e52d889f965810
2019-04-12 01:57:56 -07:00
Jun Wu
4ca0b2c778 indexedlog: move macros to a separate module
Summary:
The internal rustfmt linter suggests wrong autofixes for the `impl_offset!`
macro. That's noisy for every diff touching `index.rs`. Silence it by moving
macros to a separate file.

To be consistent, `define_error!` is also moved.

Differential Revision: D14885746

fbshipit-source-id: d1a518e631f80d6d7945f1ea3c2e4d18e1c799ca
2019-04-11 12:51:26 -07:00
Xavier Deguillard
5ddf39f788 remotefilelog: add an indexedlog contentstore
Summary:
While the Rust code can read/write content out of an indexedlog, the Python
code cannot. For now, all the writes will be done in Rust, and the Python code
will only be able to read from it.

Reviewed By: quark-zju

Differential Revision: D14894330

fbshipit-source-id: 5c1698d31412bc93e93dabb93be106a2ef17d184
2019-04-11 12:07:58 -07:00
Xavier Deguillard
10ae96292e asyncpacks: add indexedlogdatastore
Summary:
As The IndexedLogDataStore will be used in hg_memcache_client, it needs to be
used in async code, and thus needs an async wrapper.

Note: I should probably rename the crate to "asyncrevisionstore" :)

Reviewed By: quark-zju

Differential Revision: D14881362

fbshipit-source-id: 203ce50954d99899715b32f85e6118e757578ece
2019-04-11 12:07:58 -07:00
Xavier Deguillard
301c0f173a remotefilelog: only take repacklock once per repack
Summary:
While not a correctness issue, taking and releasing the repack lock multiple
times per repack makes `hg debugwaitonrepack` unreliable, which in turns makes
test flakey.

Reviewed By: quark-zju

Differential Revision: D14877896

fbshipit-source-id: 682b649f388d19fd51bcf8dd205ac96944039e86
2019-04-11 10:43:38 -07:00
Durham Goode
c32fd83458 tracing: log manifold perftrace samples
Summary:
We currently send perf traces to the blackbox, but we also want to log
them to our metrics. This configures hg to log the perf trace as a sample. Later
diffs will configure our wrapper to route these samples to manifold.

Reviewed By: mitrandir77

Differential Revision: D14881308

fbshipit-source-id: 07690f9af9fe14279a9ebf5089548c5880cba45d
2019-04-11 10:06:37 -07:00
Mark Thomas
a8907ff92c visibility: add telemetry logging
Summary: Add telemetry logging for visible head count.

Reviewed By: ikostia

Differential Revision: D14892255

fbshipit-source-id: 8a141e48ee834c9916b4f6233024a110728734b3
2019-04-11 08:57:52 -07:00
Mark Thomas
105e0dccf6 obsolete: don't create autorels for the final successor
Summary:
Autorels attempts to detect the scenario where `P -> Q` and `X -> Y` are
being added, and there already exists a `P -> ... -> X` relationship.

In this case it will create a `Q -> Y` "copy" marker to express the fact
that `Q` should be copied.

However, this also triggers in the case where `Q == Y`, creating a revive
marker for `Q`.

Normally this is benign, as Q is probably visible anyway, however when there
are two commits associated with a diff that has been landed, pullcreatemarkers
can create two markers: `P -> L` and `X -> L`.  Since P and X are for the same
diff, there probably exists a `P -> ... -> X` relationship, and so autorels
attempts to make an `L -> L` marker.  This fails because L is public.

Differential Revision: D14891063

fbshipit-source-id: 3f076a003508dd7b7d17e3eb7cdaeb8ac09e6b15
2019-04-11 07:49:21 -07:00