Summary:
D13853115 adds `edenscm/` to `sys.path` and code still uses `import mercurial`.
That has nasty problems if both `import mercurial` and
`import edenscm.mercurial` are used, because Python would think `mercurial.foo`
and `edenscm.mercurial.foo` are different modules so code like
`try: ... except mercurial.error.Foo: ...`, or `isinstance(x, mercurial.foo.Bar)`
would fail to handle the `edenscm.mercurial` version. There are also some
module-level states (ex. `extensions._extensions`) that would cause trouble if
they have multiple versions in a single process.
Change imports to use the `edenscm` so ideally the `mercurial` is no longer
imported at all. Add checks in extensions.py to catch unexpected extensions
importing modules from the old (wrong) locations when running tests.
Reviewed By: phillco
Differential Revision: D13868981
fbshipit-source-id: f4e2513766957fd81d85407994f7521a08e4de48
Summary:
Replace the `-w` option of the commit cloud commands that process workspace
names with general options of the form:
* `-u` or `--user` - to select the workspaces of a particular user.
* `-w` or `--workspace` - to select a particular workspace for that user.
A (hidden) `--raw-workspace` option is provided to allow use a workspace
by its exact name, should that be needed.
The `-w` option still accepts full user workspaces, but shows a warning.
These options apply uniformly to any command that takes a workspace.
Reviewed By: liubov-dmitrieva
Differential Revision: D13730839
fbshipit-source-id: d1b884b100caf909619511db4861eb1b880a0d3e
Summary:
I faced an issue where I had the following DAG:
```
A B
@ o
| /
| /
|/
o C
```
I did the following operations at that point:
```
hg hide -r A
hg up top
```
but the update took me back to A instead of taking me to B as I expected.
quark-zju debugged the issue and we found out that this was due to D6899232.
This commit fixes the issue by ensuring that we do not make a filtered repo
unfiltered before the update operation.
Reviewed By: DurhamG
Differential Revision: D13388494
fbshipit-source-id: 1678f97a4b3179720c30cf1366e9301a2c27a5ba
Summary:
Add a new config option: `commitcloud.max_sync_age`. When set, commit cloud
will not pull in any commits that are older than this when it is joining or
syncing. The commits are still nominally in the cloud workspace, we just
save join or sync time by not including the commits.
Reviewed By: liubov-dmitrieva
Differential Revision: D13062470
fbshipit-source-id: 17a4bdb4095766a83a4bf6d4151ae86b39edf59c
Summary:
When syncing a commit cloud repo, if the user has put a bookmark on a public
commit that we don't have locally, also pull that public commit into the repo
so that we can put the bookmark on it.
Reviewed By: quark-zju
Differential Revision: D12815471
fbshipit-source-id: 080038e4e239170cad994ff4ab9326d787d1c0fa
Summary:
The functionality we care about is provided by the `fbamend`
extension. Therefore, lets replace the `amend` extension with the `fbamend`
extension.
Reviewed By: farnz
Differential Revision: D10320739
fbshipit-source-id: 5700d39f488777fcc4033f60ce0a51cda15ef2ad
Summary:
this is usefull when a user have a lot of other users commits in the default workspace
the set of commits includes all the stacks where at least one commit is user's own
the option is for the default workspace only, it doesn't apply for other workspaces a user may collaborate in
the idea is that the client code will never offer other user's commits to sync, so cloud sync will perfectly work with some extra commit might present on any machine.
this allow users to continue have other users commits in their workspace for review or other purposes even if it is very very large, but provides reliable backup and sync solution for user's own work.
the option works for all commands `hg cloud join` `hg cloud rejoin` `hg cloud sync` and `hg cloud recover`
Reviewed By: simpkins
Differential Revision: D9645571
fbshipit-source-id: 9adb68568083c87c22bb86c19fb7a5bb0f639265
Summary:
this is an option to take into consideration only specified heads that run cloud sync
this is helpful to debug issues with individual stacks on push part of cloud sync
Reviewed By: quark-zju
Differential Revision: D9349821
fbshipit-source-id: c5220be3b30cfc300bf62bdcfc472368ce74104e
Summary:
Like D9323267, hg tests commonly reinvent common aliases to render the DAG, and they often differ very slightly. This makes adding a test require more boilerplate, and reading a test in a foreign new area slightly more overhead.
Let's standardize these to reduce the copypasta.
It's necessary to define this as a shell function instead of an hgrc alias to prevent tests that list aliases from printing it. Plus that enforces a nice separation of test/stdlib logic.
Bookmarks and branches are easy enough to add since they're empty if not used. A good number added `{phase}` -- I renamed this to `tglogp`.
Reviewed By: quark-zju
Differential Revision: D9347072
fbshipit-source-id: 6aac7de3e65d2295a7ebecd2ab30901709af3ff1
Summary:
Add this as an experimental option
We don't have switching of workspaces so far, but hg clone is very fast with eden, so it is easy to create a brand new repo and join to any workspace.
This is already useful for debugging and repro user's issues.
You just join to the user's workspace from a brand new repo and can see what is going on there.
Reviewed By: quark-zju
Differential Revision: D9082157
fbshipit-source-id: 561314cddfced07c81c4bb6c1c2ccf99e140b27c
Summary:
this command will be use in fbclone
it does sync and join if a person has been used already the commit cloud workspace in that repo
Reviewed By: markbt
Differential Revision: D8640667
fbshipit-source-id: 9c8d96497cf7930b995a49c8bdaebe7048e0c1e8
Summary:
recent refactoring broke user experience if token is not found
not found is actually an error, rather than an empty result for security command
Reviewed By: markbt
Differential Revision: D8489287
fbshipit-source-id: 5ee6e821ce79877b43f93cb86b6935294b9e4a67
Summary:
security command normally show a GUI prompt to allow you to type your password if the keychain is locked
if it is unable to do so, it returns 36 and empty stderr
it is ok that it is failed, because it happens due to security reasons,
the problem is only that stderr is empty, so the reason of failure is not clear to user.
I didn't find any option in the man of security command itself. So, I checked the status code.
Reviewed By: markbt
Differential Revision: D8418363
fbshipit-source-id: 0c8f0bf55f588822e50395c3ec8bfa8d3188ecf7
Summary:
Avoid transient partially synced stated by updating the bookmarks and
obsmarkers as part of the pull command, if there is one. Additionally,
prevent remotenames bookmarks from being updated in cloud-sync pulls that
happen to include public commits. That's preferable, as usually this will only
be a subset of remote bookmarks, and this can give confusing results.
Reviewed By: DurhamG
Differential Revision: D8401117
fbshipit-source-id: 5ee646d8c7e49ea70d3ec5fd7df5c9009de7bcdd
Summary:
Rather than pushing a bundle containing all unpushed draft commits, instead
push stack by stack. This reduces the individual bundle size, and means
failure to push some commits means we can still make progress.
Reviewed By: DurhamG
Differential Revision: D8241383
fbshipit-source-id: 6f1528613fa228627fe156a8e4720dd46929ebe2
Summary:
Split the infinitepush backups code into a separate module.
The infinitepush extension is responsible for providing scratch pushes, as well
as the server-side implementation for storing scratch bundles.
The infinitepushbackup extension uses this feature to provide automatic backup
support. It is an alternative to the commitcloud extension, and the two will
be mutually exclusive.
Reviewed By: DurhamG
Differential Revision: D8204418
fbshipit-source-id: 9279c426da35d451a5e7b39a72f2c91d364e3fd4
Summary:
These are secret options for SCM Daemon
1. specify the version that comes from notification.
if notification comes from itself, we can save server time from unnecessary requests.
2. respect auto backup current settings
before auto backup setting were only respected by the background backup triggered when you make a commit. It is logical that SCM Daemon will also respect that settings
Reviewed By: markbt
Differential Revision: D8143296
fbshipit-source-id: 0d407d489a723543bdb2ce25af8b9fd6687e2d53
Summary:
The infinitepushbackupstate file must be written using the vfs of the source
repo when the share extension is in use.
Reviewed By: mitrandir77
Differential Revision: D7936097
fbshipit-source-id: a57e241ca969632ced65029cb5ccf61373bd8aeb
Summary:
In order to prevent newly added obsmarkers from being lost while we are syncing
them, we separate out the obsmarkers that we are in the process of syncing into
a separate `syncing` file. New obsmarkers that are created during sync go into
the `pending` file and are synced on the next sync, which means it's safe to
delete the `syncing` file when sync completes.
Differential Revision: D7932299
fbshipit-source-id: bd86e836ded10e75790b87ca6734a29f068f3571
Summary:
A command that creates obsmarkers while they are being synced can cause the
obsmarkers to be dropped.
In this test, the obsmarker for the rebase restack is lost.
Differential Revision: D7932300
fbshipit-source-id: 11988f2a2c77eed9f9fab258a6623abd8c50e1cd
Summary:
Rework the commit cloud commands:
* Arrange them under a top-level `cloud` command.
* Make `join` call `register` if necessary and `sync`. This gives one-step
on-boarding.
* Add help text to all commands; clean up existing help text.
* Simplify output a little.
Differential Revision: D7876295
fbshipit-source-id: 1f7c0cabfa3d426ced34b90bdca64bef78d78211
Summary:
Make commitcloud push unsynced commits to the server before modifying the cloud
state.
At the moment, this uses an infinitepush push, calling the underlying push
functions directly (since commitcloud knows exactly which commits to push,
there is no point performing discovery to calculate them). Infinitepush pushes
require the full draft stack to be included, but in the future, this will be
replaced with an even smaller push of just the changed commits to Mononoke.
The re-use of infinitepush's internal functions is a bit hacky. Later on I
will refactor the common functionality out to a utility library.
Reviewed By: StanislavGlebik
Differential Revision: D7535890
fbshipit-source-id: 975028a63bd6d9377a37e224a0cfd95ae1f1e16d
Summary:
move logic to update current rev to its new location (optional)
we are trying to update only if it is unambiguous
Reviewed By: DurhamG
Differential Revision: D7431940
fbshipit-source-id: 72e7fea7365a231c4d98ceb4cf4872a4db02d9ca
Summary:
[commitcloud] commit cloud recover state
`hg cloudrecover` command
It might be helpful to have a command like this in cases something goes wrong
with the local state
Reviewed By: DurhamG
Differential Revision: D7417147
fbshipit-source-id: 4b236f2753b1f212ff4881a649032e53e032c66c
Summary:
Add obsmarkers to the things that are synced.
For the LocalService, obsmarkers are stored base64-encoded using version 1 of
the obsmarker binary format. This is sufficient for unit tests.
Differential Revision: D7181399
fbshipit-source-id: 61377105986de561622a160134d20fdbd54bb88f
Summary:
Adds the initial skeleton of the `commitcloud` extension to Mercurial, which
will synchronise heads and bookmarks (and later, obsmarkers) with commit cloud.
Current limitations:
- only supports a stub version of the service that uses local files
- requires manual pushbackup to send commits to the server via infinitepush
- doesn't do anything with obsmarkers
Differential Revision: D7167715
fbshipit-source-id: 53443f3fb8dff0fe52257d7b20fc601dbe10c883