Summary:
Add automigrate to commitcloud, which will automatically connect the user's
repo to commit cloud on pull.
Reviewed By: mitrandir77
Differential Revision: D16666810
fbshipit-source-id: a1d0857164d2ce6bf1db5784360681f04d35ed90
Summary:
Running `hg cloud leave` on a repo that was never connected should mark the
repo as explicitly disconnected so that automatic joining will not try to
connect the repo later on.
Reviewed By: quark-zju
Differential Revision: D16687470
fbshipit-source-id: 0552ffa42a1dac40874bba30eeb93509a2227aeb
Summary:
The `SubscriptionManager` is never a long-lived object, and cannot be
constructed if the user is not connected to a workspace. Simplify this to
function calls, which are safe to call at all times.
Reviewed By: quark-zju
Differential Revision: D16687467
fbshipit-source-id: c7f81290a3e8012f7b154af3398771ac9254387f
Summary:
`hg cloud rejoin` limits joining to when the user has an authentication token
and the workspace already exists. If the user uses a different authentication
method, or if the workspace is brand new, the rejoin does nothing.
Change this to always attempting to join, and only printing a message if the
join failed because of an authentication error, prompting the user to authenticate.
Reviewed By: mitrandir77
Differential Revision: D16666365
fbshipit-source-id: 3ea4542125a1b5266711fab2c31d9455ab764cef
Summary:
When `treemanifest.usehttp` is enabled, make `remotetreestore` fetch tree nodes over HTTP rather than SSH.
Note that unlike the SSH prefetch operation, this downloads only a single tree node, which will change the I/O behavior of Mercurial to fetch manifest nodes on demand. In general, this will result in excessive round trips, but for certain commands (such as `hg cat`), this works reasonably well.
Future diffs will expand upon this functionality to make the HTTP behavior more performant. For now, this won't affect anyone unless they specifically enable the aforementioned config option.
Reviewed By: xavierd
Differential Revision: D16663197
fbshipit-source-id: 4117e057996ed30f0bfd186238264e31484c2620
Summary:
Add the `debuguploadsnapshotmanifest oid` command.
It checks that the local lfs has `oid`, then uploads it and all the related blobs to remote lfs.
Differential Revision: D16667158
fbshipit-source-id: 2978a6c0e7c58c3710f8253cf7b9ab36b24886ce
Summary:
Previously, we would use `None` as the start value for HTTP data fetching progress bars so that the bar would be rendered as a spinner until we received a response (which would contain a content size header, allowing us to set the progress bar total).
This would result in incorrect behavior if the server took a long time to return a response, because by default if no start value is provided the progress bar framework will display the number of seconds that have elapsed. Given that we've specified a byte count format function for the progress value, the progress bar would end up displaying the number of seconds elapsed as a byte count, which was very confusing.
Reviewed By: quark-zju
Differential Revision: D16663124
fbshipit-source-id: 0e224b3b670abc803356214cd12205a6f4259cd9
Summary: Matching more of the existing API.
Reviewed By: quark-zju
Differential Revision: D16607233
fbshipit-source-id: 7a71f22089067ecfccbfcb2ad072fbf21e360439
Summary:
The initial attempt at supporting tree fetching over HTTP involved reimplementing the existing Mercurial prefetch functionality (corresponding to the gettreepack wireproto command) in the API server. Unfortunately, while this worked from a functionality perspective, it was far too slow to be usable in practice.
Rather than maintaining this unused code path, let's remove it and repurpose the config flag for a more sensible version of HTTP tree fetching.
Reviewed By: farnz
Differential Revision: D16663198
fbshipit-source-id: a489d5ca177b788f93383b8a9f758316e889ca5b
Summary:
The hgcache packs directory is being written to in several places, most of the
files being created there are temporary ones and renamed once ready to be
visible. In some cases, when hg crashes midway, or when the packfile is mmap'ed
on windows, temporary files are left around.
While we were trying to remove these files before, the solution taken involved
removing files we knew were safe to be removed. Unfortunately, that meant we
missed some of the temporary files. Let's instead switch to removing everything
but packfiles and the repacklock.
Reviewed By: kulshrax
Differential Revision: D16657105
fbshipit-source-id: f4dd45aa71c02acba52a745b9bec3019d20e03c4
Summary:
Add `not public()` to the unhide revset to improve its performance. We can't
unhide public commits anyway, as they can't be hidden.
Reviewed By: mitrandir77
Differential Revision: D16645983
fbshipit-source-id: f9f23e7e31050e652f1389489734416fe3278219
Summary:
Add a self-descriptive command `debugcreatesnapshotmanifest`.
For now it supports only deleted and unknown files.
1) Uploads all the untracked files to the local lfs storage.
2) Creates a json-like snapshot with the following structure:
```
{
"deleted": {
"path/to/file": None, # this is done for consistency
"path/to/another/file": None
},
"unknown": {
"added": {
"oid": "oid in local blobstore",
"size": 42
}
"another/added": {
"oid": "another oid in local blobstore",
"size": 24
}
}
}
```
...and stores it in the local blobstore.
Reviewed By: markbt
Differential Revision: D16621864
fbshipit-source-id: 6c497d1bb756561b3c3368483b838a2307b0b5f9
Summary:
The original code path is extremely slow because it has to iterate all files in manifest.
The new path instead only has to lookup the entries in keptdirs and therefore is O(change).
Reviewed By: mitrandir77
Differential Revision: D16646075
fbshipit-source-id: cb2c152d236ffa6f01349c223c9470205c540379
Summary:
To avoid the scenario where we are incorrectly uploading the data that we're
supposed to upload, we need to reset the file pointer to read from the
beginning so that for each retry of uploading we get the correct data.
Previously before this patch, Mercurial would have nothing to upload on a retry
and the connection would 'hang' waiting for the data to be send to the server.
Reviewed By: krallin
Differential Revision: D16620072
fbshipit-source-id: 2238b99ff612e06dc0640717bc42fe345c35037d
Summary: Make the number of retries for HTTP operations configurable. Previously, they were hardcoded to 3, which may not be ideal in situations where the retries are caused by server side timeouts. (If a single timeout takes 30 seconds it would take 90 seconds to fall back to SSH.)
Reviewed By: quark-zju
Differential Revision: D16592862
fbshipit-source-id: a9ba5273a1271532ff9814bcc47cb32e60ee87b7
Summary:
Similar to diff, the `match` argument can't be easily expressed using CPython
crate bindings. This argument is not used a lot so we can rename it.
Reviewed By: quark-zju
Differential Revision: D16571840
fbshipit-source-id: 19c7dea82924b7ec4c0b66d1675b9ad4569f8b62
Summary:
`match` is a keyword in Rust. This is causing troubles in adding Rust bindings
for functions that use that as a keyword argument. Renaming the argument to
something else seems to be the easiest path forward.
Reviewed By: quark-zju
Differential Revision: D16496134
fbshipit-source-id: c923f49577564527a99d43dda3d3d9da43122b3e
Summary:
The diff algorithm takes the `clean` flag. When `clean` is used all the files
that are not changed between the two manifests are returned. In short the set
of files is equal to |files(M1) U files(M2)|.
This functionality would have to be implemented in the Rust manifest. I don't
feel that a flag on the diff algorithm should be used in this case. First, I
don't like how it interacts with the core diff algorithm, it changes it to the
point where it feel like it should be a different function. Second is that this
behavior can be achieved by getting all the files in the manifest and removing
the items in the diff. Third is that this operation is done quite rarely, being
so expensive.
The downside is that the places where this flag is used get a bit more
expensive.
Reviewed By: quark-zju
Differential Revision: D16496136
fbshipit-source-id: 205dcc23517b896de5c14634683bcbd5f2aa6666
Summary:
This is used by Jellyfish and sent to Phabricator. In the future, we won't have svnrev
and therefore we should use globalrev instead.
More context: https://fb.workplace.com/groups/248282915800791/permalink/372855146676900/
Reviewed By: singhsrb
Differential Revision: D16561651
fbshipit-source-id: 284ad26b1bf77f222086bb7e2104b1c2dbf65449
Summary:
This command uses svnrev directly. However once we migrate to www-hg, this fields will
go and we can only use globalrev instead.
Let's add that and put it behind a config.
More context: https://fb.workplace.com/groups/248282915800791/permalink/372855146676900/
Differential Revision: D16560447
fbshipit-source-id: de3100ed1e6cc39eaaeff2fe11af04d2f1e2c41a
Summary: This makes IPython work without disabling demandimport.
Reviewed By: xavierd
Differential Revision: D16509106
fbshipit-source-id: d4443d8b58c90a0fd7a34c620756e88f4f788337
Summary: Added shortcuts a, d that allow you to skip 1 day forward or back in the historical smartlogs interactive view
Reviewed By: mitrandir77
Differential Revision: D16438722
fbshipit-source-id: e61a126ed7390b5ee77ee71694d8b23f3351854a
Summary: The interactive view doesn't support the pager, so it is problematic for longer smartlogs. As a quick fix the interactive view only contains two weeks of commits. The full version is accessible through hg cloud sl --version_number
Reviewed By: mitrandir77
Differential Revision: D16496065
fbshipit-source-id: 7224258b426724872bf796af618ef70cbf4c9d0b
Summary:
With fastdatapack gone, the cdatapack bindings are no longer necessary and can
be removed.
Reviewed By: singhsrb
Differential Revision: D16476584
fbshipit-source-id: 130a9c5aed4e4f005876c420961f09d398f6e6aa
Summary: This is no longer used anywhere, we can remove it.
Reviewed By: singhsrb
Differential Revision: D16476582
fbshipit-source-id: fe6a8f33cbc3c37fb1d8fb33226352e41bcbaa2a
Summary: This code isn't used anywhere, let's get rid of it.
Reviewed By: singhsrb
Differential Revision: D16476583
fbshipit-source-id: d42376dbb2cf631a170ade3e2764d1f70922d882
Summary: This code is no longer used anywhere.
Reviewed By: singhsrb
Differential Revision: D16462343
fbshipit-source-id: 3e11994575a6de75562cb1ebd8839f7058abc075
Summary:
Our reverse sync job is too slow when pushing to svn. It seems like the slowness comes
keep doing push-pull-rebase which doesn't seem necessary in our case.
From my understanding, we need to do push-pull-rebase because we have multiple writers.
In our sync job, we only have one writer and therefore can we skip the pulls and rebases?
Reviewed By: DurhamG
Differential Revision: D16442559
fbshipit-source-id: 926d1c516e8e6d59298d310fc67927ace37f72c9
Summary:
Util method to generate Enum, since some machines don't have the
python library installed.
Reviewed By: suitingtseng
Differential Revision: D16491020
fbshipit-source-id: e06470a609605c482f591418583b516918c49d93
Summary: There no users left, let's get rid of it.
Reviewed By: kulshrax
Differential Revision: D16423137
fbshipit-source-id: 6898e681f800ab677010d7b6cdd36d377e3ef644
Summary: The Rust code is the default.
Reviewed By: kulshrax
Differential Revision: D16423134
fbshipit-source-id: 30baf041a5e7c786a28b31cfe5025e893b34594c
Summary:
The Rust code is now always taken, let's start removing all the references to
the python mutabledatapack code.
Reviewed By: kulshrax
Differential Revision: D16392287
fbshipit-source-id: dfccd4f4ec052a46975b6f9144106b51c3282988
Summary: This is now enabled for the entire fleet, let's hardcode this in the code now.
Reviewed By: kulshrax
Differential Revision: D16392289
fbshipit-source-id: 462152ded12d00cf8218526d51a911d6fe5975ca
Summary: Checks if the retrieved content of a file is equal to a `magic string` representing a blacklisted file. If so, then the content is replaced by a readable text which suggests a `rebase` or `update` to a newer commit.
Reviewed By: ikostia
Differential Revision: D16260011
fbshipit-source-id: ac1d40132b9c947927271d8e6efda98b19dce984
Summary: The debug messages from Eden API provide Source Control team members with useful diagnostic information about HTTP data fetching, but they have the potential to be spammy when written to log files. To prevent log spam, let's only print these messages during interactive usage.
Reviewed By: quark-zju
Differential Revision: D16445346
fbshipit-source-id: 001dc75e440eaf797f4f953648453086421f624e
Summary:
When using fetchpacks, memcache will write to an indexedlog, which can't be
repacked. I'm also suspecting that there is a race between this repack, and
hg_memcache_client opening the newly created packfiles which can cause the
misses to not be sent to memcache.
Reviewed By: kulshrax
Differential Revision: D16432538
fbshipit-source-id: 62362682474883bcd58249791c02b9fed5cb8fea
Summary: Bindings so that the rust manifest code can be used in Python.
Reviewed By: quark-zju
Differential Revision: D16352532
fbshipit-source-id: 34d4522f5e084f531f31bcd21770950f15f2fe13
Summary:
Copytrace modified the global definitions table which was making it very difficult to keep track of side-effects as the code was executed, as well as making it harder to replace the fancyopts calls with native Rust.
Since the copytrace behavior can be achieved through a configuration, it now will no longer modify the global definitions table, and will display the correct flag for a user to use in order to get this same behavior.
Reviewed By: quark-zju
Differential Revision: D15902449
fbshipit-source-id: 1c254162d56823e65085b7047bb37513f187b487
Summary:
When rebasing or showing a diff for a commit which moved files, remotefilectx.ancestors (called by _tracefile) calculates the linkrev for each ancestor. Sometimes [1], this is a disaster:
* remotefilectx._linkrev executes its slow path and scans the change log.
* For each entry in the change log, remotefilectx._linkrev downloads trees if needed.
* Hg downloads trees one-by-one (as of D15964145).
remotefilectx.ancestors is only calculating linkrevs so it can sort the ancestors topologically. _tracefile only needs the ancestors to be ordered topologically, not by linkrev. remotefilectx.ancestors's calls to remotefilectx._linkrev are redundant.
Optimize _tracefile's use of remotefilectx.ancestors: order remotefilectx objects topologically (breadth-first) without sorting by linkrev. Create a new function for this purpose (topological_ancestors) to avoid possibly breaking other callers of remotefilectx.ancestors. As a side effect, make this new function return remotefilectx objects lazily, similar to the filectx.ancestors function.
On my machine, with warm caches, this speeds up 'hg diff -c' and 'hg rebase' for a modestly-sized commit. 'hg diff -c' takes 0.64 seconds, down from 65.6 seconds.
[1] Hypothesis: After 'hg amend', 'hg bundle' packages linkrevs which refer to the pre-amend commit (which is not serialized into the bundle) rather than the post-amend commit. 'hg unbundle' thus creates linkrevs referring to a missing commit.
Reviewed By: DurhamG
Differential Revision: D16297426
fbshipit-source-id: 407597d5e36fc06b33719c28f5ea5052e01dc7a3
Summary:
If one of the repo checkouts doesn't have remote bookmarks synchronization enabled, it must not affect the Cloud's remote bookmarks state.
I also changed `localserver` (is used for our tests) because Commit Cloud server deletes the "old" bookmark names from the db and inserts "new". However, the `localserver` just set the "new" books dictionary as a new state, which is not quite correct.
Reviewed By: simpkins
Differential Revision: D16338257
fbshipit-source-id: d77d9218b1c35ea1a097bbe7393d0910ce7b4d38