Commit Graph

45877 Commits

Author SHA1 Message Date
Durham Goode
69ebfd6bf7 template: remove manifest rev number from templates
Summary:
With treemanifest we no longer have manifest rev numbers, so let's drop
them from the templates. This let's us convert a few more tests to treeonly.

In theory automation may parse this, but I kinda doubt anyone parses the
manifest node from this.

Reviewed By: xavierd

Differential Revision: D15296141

fbshipit-source-id: a4d2194bd9604867cd9958509bcd2e6513a72494
2019-05-22 08:37:10 -07:00
Mark Thomas
95afd0a5cd hgsubversion: use better string literals for significant whitespace
Summary:
The test-hgsubversion-externals.py test contained string literals with significant trailing whitespace that was stripped by an editor in D15392154.

Restore the significant whitespace, and switch from multi-line string literals to a single string literal per line, to make the newlines and whitespace more obvious.

Reviewed By: krallin

Differential Revision: D15448869

fbshipit-source-id: 68444d2a31b71ab9f99927c95174a0d49e26bb06
2019-05-22 02:34:58 -07:00
Mark Thomas
7e32ae71dd commitcloud: provide legacy pushbackup and isbackedup commands
Summary:
`hg pushbackup` and `hg isbackedup` can be called from scripts with `HGPLAIN`
set, and so can't be provided by aliases.  Instead, provide deprecated wrapper
commands.

Reviewed By: mitrandir77

Differential Revision: D15436286

fbshipit-source-id: 3fbbf9a5fb4d0e8de2026a17c41ee11a139d645f
2019-05-21 15:32:10 -07:00
Mark Thomas
1eaa46bd64 commitcloud: log sync state to blackbox log
Summary: Improve debugability of cloud sync by logging updated sync state to the blackbox logs.

Reviewed By: mitrandir77

Differential Revision: D15434890

fbshipit-source-id: c5065455985a48777a855997a99e32ce0b31cc72
2019-05-21 15:32:09 -07:00
Mark Thomas
30e5b3eb26 commitcloud: remove omitted bookmarks that are available locally
Summary:
When syncing, if a locally-available bookmark is synced to a new commit that
has been omitted, remove the local bookmark to ensure that the next cloud sync
doesn't move the bookmark back to where it used to be.

Reviewed By: mitrandir77

Differential Revision: D15414172

fbshipit-source-id: 71aaa2d89f734e4c575c24da2c0ef6b59ca4deaa
2019-05-21 15:32:09 -07:00
Mark Thomas
93b9b82be1 commitcloud: add test demonstrating bad behaviour for moved omitted bookmarks
Summary:
Add a test that shows moving a synced bookmark onto a commit which will be
omitted elsewhere causes the bookmark to be moved back.

Reviewed By: mitrandir77

Differential Revision: D15414173

fbshipit-source-id: 92dc42d1c5560fa2f5bc618d5335e21ac14d9e7d
2019-05-21 15:32:09 -07:00
Xavier Deguillard
c5ce38dbb2 revisionstore: remove MutableHistoryStore::close
Summary:
Now that flush is implemented everywhere, we can replace the use of close with
flush.

Reviewed By: kulshrax

Differential Revision: D15416717

fbshipit-source-id: 5aea730b435e3c2073619ba676e60134f59f87c9
2019-05-21 15:25:28 -07:00
Xavier Deguillard
93f1044985 revisionstore: remove the default flush for MutableHistoryStore
Summary:
All the stores are implementing it, we can now remove the default
unimplemented.

Reviewed By: kulshrax

Differential Revision: D15416710

fbshipit-source-id: 84f6bb7c0cf7db4161ca61a55d15691a00a5b18f
2019-05-21 15:25:27 -07:00
Xavier Deguillard
cf158f0fde revisionstore: remove MutableDeltaStore::close
Summary:
Now that MutableDeltaStore::flush is implemented everywhere, let's remove the
close method and replace it with flush where necessary.

Reviewed By: kulshrax

Differential Revision: D15416716

fbshipit-source-id: e66dad66a3aff25e80efb10dc2e22c9878336699
2019-05-21 15:25:27 -07:00
Xavier Deguillard
2b0ffccb2d revisionstore: remove the default flush from MutableDeltaStore
Summary: The method is now implemented in all stores, we can get rid of it.

Reviewed By: kulshrax

Differential Revision: D15416715

fbshipit-source-id: 6d6e6f5bfaf66796f66efbdc943e125b56808e39
2019-05-21 15:25:27 -07:00
Xavier Deguillard
6f7856c02b pyrevisionstore: implement flush for pythonhistorystore
Summary: This is the last history store that didn't implement flush.

Reviewed By: kulshrax

Differential Revision: D15416712

fbshipit-source-id: f091fe697e5015afd5d6e6dc7ae6a1de27bb9b5b
2019-05-21 15:25:27 -07:00
Xavier Deguillard
8e9bc8c347 pyrevisionstore: implement flush for PythonMutableDataPack
Summary:
A new flush method is added to mutablebasepack that just close and re-init
self.

Reviewed By: kulshrax

Differential Revision: D15416708

fbshipit-source-id: 79cdcb20b51b9688a5e95402057c7da27883003c
2019-05-21 15:25:26 -07:00
Xavier Deguillard
5d29594498 asyncrevisionstore: use flush instead of close
Summary:
The close method is being removed, we can use the flush as it's strictly
equivalent for the asyncrevisionstore.

Reviewed By: kulshrax

Differential Revision: D15416706

fbshipit-source-id: 388956f33f6ebb4587c38fbf4ee13b0b4f7d9562
2019-05-21 15:25:26 -07:00
Xavier Deguillard
b42a85b427 revisionstore: implement flush for MultiplexStore
Summary:
As we're migrating toward using flush instead of close, the MultiplexStore no
longer requires a "&mut T", we can directly get the ownership of the object and
flush can be properly implemented.

Reviewed By: kulshrax

Differential Revision: D15416704

fbshipit-source-id: 3cf6c9bf829297e07853484913e6260331ab2b3b
2019-05-21 15:25:26 -07:00
Xavier Deguillard
0efa8b1d33 revisionstore: implement flush for MutableHistoryPack
Summary:
Similarly to MutableDataPack, this split MutableHistoryPack and implement the
flush method on the outer struct. The flush merely close the inner and then
re-open a new one.

Reviewed By: kulshrax

Differential Revision: D15416707

fbshipit-source-id: a81f9103de53a6d9fdabc88b6a1e00d04e39f72e
2019-05-21 15:25:26 -07:00
Xavier Deguillard
b44e784ce6 revisionstore: add flush method for MutableHistoryStore
Summary:
Similarly to the flush method for MutableDeltaStore, this will allow a
MutableHistoryStore to be object safe.

Reviewed By: kulshrax

Differential Revision: D15416713

fbshipit-source-id: 888fb6154fa4bde125c5a9b1a7be6b11279a4f6f
2019-05-21 15:25:25 -07:00
Xavier Deguillard
e71fd2f71f revisionstore: implement flush for MutableDataPack
Summary:
The flush implementation just closes the current packfile, and re-opens a new
one. This satisfies the property that writes are possible after a flush.

Reviewed By: kulshrax

Differential Revision: D15416705

fbshipit-source-id: 2024e8ae714c18ead5e020fb681736013ccca4b2
2019-05-21 15:25:25 -07:00
Xavier Deguillard
8f5a06d959 revisionstore: split MutableDataPack
Summary:
Since flush requires the store to be kept open after it returns, we need to be
able to re-create a MutableDataPack. For this, let's use the inner pattern to
keep the current pending datapack.

Reviewed By: kulshrax

Differential Revision: D15416714

fbshipit-source-id: 4470e50e982681c8e8fadd920d58027132fb3420
2019-05-21 15:25:24 -07:00
Durham Goode
3403a1dc36 hooks: remove "incoming" hook
Summary:
This hook fires for every commit that is introduced in a pull. When
doing pulls with hundreds of thousands of commits, this introduces a noticable
delay. We don't use this hook anywhere, and it's not particularly scalable, so
let's delete it.

Reviewed By: singhsrb

Differential Revision: D15424697

fbshipit-source-id: 98d76bca703e625adf5be8f6234436befd260fc4
2019-05-21 15:01:16 -07:00
Kostia Balytskyi
fb54cc5694 hgsubversion: move to absolute import
Summary:
Let's move hgsubversion to absolute_import, just to be consistent with the rest
of Mercurial codebase.

Reviewed By: markbt

Differential Revision: D15392154

fbshipit-source-id: e4c32939aff0616790828da508f3feea158669e1
2019-05-21 09:15:21 -07:00
Arun Kulshreshtha
14bf3a15b0 edenapi: check HTTP status code
Summary: Previously, `edenapi` would unconditionally attempt to parse the response body as CBOR, resulting in cryptic error messages if the server had returned an error instead of the expected content. Instead, we should first check that the request was successful, and only then attempt to parse the body.

Reviewed By: quark-zju

Differential Revision: D15426868

fbshipit-source-id: ceaf0d6691b509bcd934d6b99ceefb3e83e798ca
2019-05-20 22:58:42 -07:00
Jun Wu
bb67907b7b indexedlog: rename LogRotate to RotateLog
Summary: The name was suggested by DurhamG. It's a nice idea. Therefore the rename.

Reviewed By: singhsrb, xavierd

Differential Revision: D15420361

fbshipit-source-id: 1f591c2ecd8082607c3b6fd34c83068e5f555c99
2019-05-20 20:21:46 -07:00
Xavier Deguillard
25cfb922d7 revisionstore: implement flush for indexedlogdatastore
Summary: The flush method is now in the MutableDeltaStore, so move it there.

Reviewed By: kulshrax

Differential Revision: D15416711

fbshipit-source-id: 55eb411e4e4cf98c51813ef29364dcba74dc7f66
2019-05-20 19:17:32 -07:00
Xavier Deguillard
257d48d39b revisionstore: add flush to MutableDeltaStore
Summary:
A MutableDeltaStore isn't object safe due to the close method. This means that
we can't use them in generic context and the code has to work around this
limitation.

Let's replace the close method by a flush one, that no longer takes the
ownership of self. The behavior of flush is to simply make the previous writes
visible, while still allowing future writes to the same object.

Reviewed By: kulshrax

Differential Revision: D15416709

fbshipit-source-id: 11c96d672171eaac91add3d7bcad7f8eae70de16
2019-05-20 19:17:31 -07:00
Xavier Deguillard
fecbf6f441 revisionstore: add a MultiplexStore
Summary: This new store duplicates all the writes to all the stores that it's made of.

Reviewed By: kulshrax

Differential Revision: D15337751

fbshipit-source-id: f9458f7e76b8893b302cdd5dec1409c439a236c9
2019-05-20 19:17:31 -07:00
Arun Kulshreshtha
da6f7284a5 fileserverclient: do not return pack paths from data fetching functions
Summary: As of D15154509, the data fetching functions in remotefilelog write to shared mutable packs rather than opening new packs. As such, there is no need to return pack paths. In fact, the code has already been updated so that the returned paths are always `None`, so the code removed in this diff is already dead.

Reviewed By: xavierd

Differential Revision: D15419765

fbshipit-source-id: c999d5388042b429a8bda9f72a06569364d8e2e1
2019-05-20 14:23:24 -07:00
Arun Kulshreshtha
ce5b9382c8 edenapi: add tree fetching
Summary: This diff adds an `hg debuggettrees` command that downloads trees from the API server and stores them in a datapack.

Reviewed By: xavierd

Differential Revision: D15301607

fbshipit-source-id: 7820d82d7d021c420e911a6a2e9bfce62b69fa2e
2019-05-20 11:52:59 -07:00
Arun Kulshreshtha
889f598f74 edenapi: write data as it is received
Summary: Previously, the EdenAPI client would buffer all of the received data for a given set of requests until all requests had completed, and then wrote the data to the store afterwards. This could cause OOMs in situations where the number of requests is very large. This diff changes the client to write the received data to the store upon the completion of each individual request.

Reviewed By: xavierd

Differential Revision: D15405910

fbshipit-source-id: c9c381e67dadf9fa6c8b8308c00e213821964afa
2019-05-20 11:52:58 -07:00
Arun Kulshreshtha
cdd92e9951 types: make DataEntry fields private
Summary: Change the API so that the act of getting the data from a data entry (optionally) forces hash validation.

Reviewed By: xavierd

Differential Revision: D15405742

fbshipit-source-id: c127286322c707eb066f89021ac45315e89aa718
2019-05-20 11:52:58 -07:00
Arun Kulshreshtha
64cfee5321 edenapi: make multi_request take callback
Summary: Refactor `multi_request` to take a callback to process each received response. This will allow us to write responses as soon as we get them rather than buffering them (this will happen in a later diff).

Reviewed By: xavierd

Differential Revision: D15405299

fbshipit-source-id: 1f7317f5c1ae4a6570c2e5c354b1fbcdf1f1127a
2019-05-20 11:52:58 -07:00
Mark Thomas
157325e38d commitcloud: limit the number of backup bookmarks the client sends
Reviewed By: mitrandir77

Differential Revision: D15373957

fbshipit-source-id: a197a39fc5b423f57e07ab92aa6544f62439d9d3
2019-05-20 06:19:49 -07:00
Mark Thomas
66d79c86c8 pull: remove postincoming advice
Summary:
The postincoming checks prints out advice of the following forms:

* `(run 'hg heads' to see heads)`
* `(run 'hg heads' to see heads, 'hg merge' to merge)`
* `(run 'hg heads .' to see heads, 'hg merge' to merge)`
* `(run 'hg update' to get a working copy)`

This advice is no longer useful, so remove it.

Reviewed By: DurhamG, farnz

Differential Revision: D15317185

fbshipit-source-id: 50ba576406c96715fa058399da53462be9b7a3bf
2019-05-20 06:19:49 -07:00
Mark Thomas
a2db36c434 commitcloud: log background backup command and start time
Summary:
Improve logging of background backup commands by including the command that was
run and the time it was started in the background backup logs.

Reviewed By: mitrandir77

Differential Revision: D15334879

fbshipit-source-id: 932e91a43033c5cb06c79ede7b5224da2e34eb7d
2019-05-20 06:19:49 -07:00
Mark Thomas
7f08a38705 commitcloud: pull heads in small groups
Summary:
When pulling heads from commit cloud during sync, pull them in small groups
of heads from around the same time, to prevent overloading the server when
pulling a large number of heads.

Reviewed By: mitrandir77

Differential Revision: D15317184

fbshipit-source-id: 5e69eb970b18292a4f5d643b25fac80c90c5d537
2019-05-20 06:19:49 -07:00
Mark Thomas
3d5a86db59 commitcloud: refactor remote path handling
Summary:
Lift determination of the correct remote path to connect to up to the top-level
command.  This prevents the need to pass around the command-line `**opts` in
all of the commit cloud functions.

Differential Revision: D15295811

fbshipit-source-id: 0e14c1643bad96022c7a01126b447b2a6fcabaed
2019-05-20 06:19:48 -07:00
Mark Thomas
7359c3df5d commitcloud: refactor sync processing
Summary:
Refactor how commit cloud sync works.

Sync is simplified by delegating backup processing to the existing backup code.
This happens first, which means the user's work is backed up earlier, and the
sync processing can assume that all backed up commits are available in the
cloud storage.

Sync no longer attempts to handle the case where cloud storage has changed.
Instead, backup processing should ensure that all local commits are backed up
to the current cloud storage.

If a commit can't be backed up, then treat this as a normal failure to
sync and ignore that commit for this sync attempt.  If a commit can't be
downloaded from the server then the sync fails.

Reviewed By: mitrandir77

Differential Revision: D15295499

fbshipit-source-id: d371c5bf0daedbbe42e8c7d4a0c3d1a40c21a36f
2019-05-20 06:19:48 -07:00
Mark Thomas
7f84c86805 commitcloud: add test demonstrating bad sync behaviour when removing obsolete bookmark
Summary:
If the user has a bookmark pointing at an obsolete commit, and then moves that
bookmark away from that commit, commit cloud can't tell whether the commit
should really be obsolete or not.  Previously the bookmark was the only thing
keeping the commit visible, but commit cloud doesn't know that.

I can't think of a way to fix this with obsmarkers.  It works with separate
mutation and visibility (T34204947).

Reviewed By: quark-zju

Differential Revision: D15097845

fbshipit-source-id: 5926553b4878b28823a6ce47d29c0346cba04e5e
2019-05-20 06:19:48 -07:00
Mark Thomas
5de98a79fb commitcloud: refactor commitcloudutil into separate modules
Summary:
Move token location into the `token` module.

Move subscription management into the `subscription` module.

Move obsmarker management into the `obsmarkers` module.

Move everything else to a `util` module which can be disambiguated at import time.

Differential Revision: D15282859

fbshipit-source-id: 7f20c449fd79ffc33b069236a05fc73fac0e7d63
2019-05-20 06:19:48 -07:00
Mark Thomas
4d832ec6b1 commitcloud: rename commitcloudcommands to commands
Summary:
The name is too long.  We can disambiguate with `edenscm.mercurial.commands` at
import time if required.

Differential Revision: D15282860

fbshipit-source-id: e55357a121b583d9fd659f27dd5e2adc8a3d4d2f
2019-05-20 06:19:47 -07:00
Mark Thomas
7188ff5a82 commitcloud: refactor errors into the error module
Differential Revision: D15282858

fbshipit-source-id: b832b593588290cf94d1826ea20af7ce8d410468
2019-05-20 06:19:47 -07:00
Mark Thomas
4f3b9594b9 commitcloud: refactor backuplock and sync progress into the backuplock module
Differential Revision: D15282857

fbshipit-source-id: 666a8cab25ef1a837dd4340f118e9e88b2b109a2
2019-05-20 06:19:47 -07:00
Mark Thomas
81d738646f commitcloud: incorporate infinitepush backups into commitcloud
Summary:
Merge the functionality of the infinitepushbackup extension (backing up commits
to commit cloud) into the commitcloud extension.

These two extensions are highly coupled, and the commitcloud extension
monkey-patches the infinitepushbackup extension for a lot of its functionality.
There is also a lot of code duplication between the two extensions which we can
remove if they are part of the same extension.

The infinitepushbackup commands (`hg pushbackup`, ...) are moved to subcommands
of the `hg cloud` command, e.g. `hg cloud backup`.

Each feature of the infinitepushbackup extension is moved to a new module
in the commit cloud extension:

The `background` module controls background execution of `hg cloud backup` and
`hg cloud sync`.

The `backupbookmarks` module tracks and updates scratch bookmarks for backups.
This will be deprecated in the future.

The `backupstate` module tracks whether or not a commit has been backed up.
This is now tracked separately from backup bookmarks in a new file:
`.hg/commitcloud/backedupheads.<remote-identifier>`.  This also covers hidden
commits, preventing a re-backup of previously backed up commits when they are
unhidden.

Previously the commitcloud extension customized the smartlog annotations: `Backing up`
became `Syncing`, etc.  This is now removed for consistency.

Previously the infinitepushbackup extension disabled background backup by
injecting an `infinitepushbackup.disableduntil` config entry into the user's
config.  This is now replaced with a state file at `.hg/commitcloud/autobackup`.
Either option can be set to disable auto backup.  Commit cloud will wait until
both have expired before starting to run background backups again.

Reviewed By: DurhamG

Differential Revision: D15276939

fbshipit-source-id: 1d28989a157286e47d3dd97ca9c70b27f692dda1
2019-05-20 06:19:47 -07:00
Mark Thomas
6c0e62aec2 rust: switch to thin lto
Summary:
Thin lto is much faster to compile, and doesn't make the resulting binaries
that much bigger.

Reviewed By: xavierd

Differential Revision: D15396282

fbshipit-source-id: 3e2bf059756d47218061d7e41f041e445d7f60c8
2019-05-20 04:08:03 -07:00
Mark Thomas
abb390625f bindings: merge pyrevisionstore code into bindings
Summary:
D15381038 made the `pyrevisionstore` crate a strongly-coupled dependency of the
`bindings` crate.  For simplicity, just move the code into the bindings crate.

Reviewed By: xavierd

Differential Revision: D15392547

fbshipit-source-id: 3dfa924b33722760ef7829fbb8659ce0262e6671
2019-05-20 04:08:03 -07:00
Jun Wu
12747763a5 pathmatcher: make gitignore "explain" low cost and more verbose
Summary:
This is a nice-to-have feature requested by nikz. He made an initial version
at D15029612, which changes `MatchResult` to include enough infomation to
explain a rule.

The diff reworked the feature so the runtime CPU and memory overhead stay
minimal if nothing needs to be explained.  The change also makes it easier
to display more information - all rules matching a path, to make it easier
to detect and remove duplicated or conflicting rules.

Reviewed By: DurhamG

Differential Revision: D15095576

fbshipit-source-id: 5784aabd50d9b716dceead10bc593f9155228046
2019-05-17 14:25:26 -07:00
Stefan Filip
8a99978193 manifest: improve deserialization error reporting
Summary:
The old code did not provide enough information to start debugging
a problem in the serialization code.

(Note: this ignores all push blocking failures!)

Reviewed By: quark-zju

Differential Revision: D15380388

fbshipit-source-id: 9da51cfe4d735de3961e840bd9cd2a1595131cd9
2019-05-17 10:24:16 -07:00
Stefan Filip
d0aaaeffe2 utils: add executable for reading from datapack files
Summary:
Useful for debugging the rust code. I used it to isolate
a bug in the delta patching logic in the rust code.

(Note: this ignores all push blocking failures!)

Reviewed By: xavierd

Differential Revision: D15380387

fbshipit-source-id: 5980d352b85ee4836bd654045eda2eae131e5847
2019-05-17 10:24:16 -07:00
Stefan Filip
bf10b4c037 exec/utils/manifest: add test executable for rust manifests
Summary:
Intended to provide a quick way of executing the rust manifest code.
Going forward this provides testing oportunity for the python conversion
layer.

(Note: this ignores all push blocking failures!)

Reviewed By: quark-zju

Differential Revision: D15290169

fbshipit-source-id: 874dbfc4907eff587ffe108efe29eb33ce301038
2019-05-17 10:24:16 -07:00
Stefan Filip
e0aaaf7cbb manifest: update flush to hash content only
Summary:
Flush encapsulates the closed abstraction approach.
Finalize addresses the implementations that need to handle
history.

(Note: this ignores all push blocking failures!)

Reviewed By: quark-zju

Differential Revision: D15290173

fbshipit-source-id: 2cfd7a3f7ca0de1c2566ce3ae680d5b1451e4f91
2019-05-17 10:24:16 -07:00
Stefan Filip
3044a0d869 manifest: add finalize method
Summary:
The plan is to have finalize do the complicated history managing stuff and
have flush be a light weight content only hashing approach to storage.
Flush will be used in tests in the short term.
Finalize would be used in Python to write to Revlogs and handle linknodes.

(Note: this ignores all push blocking failures!)

Reviewed By: quark-zju

Differential Revision: D15290171

fbshipit-source-id: 54ed5c791254507fd9f2e874315284b70bc6b597
2019-05-17 10:24:15 -07:00