Summary:
https://www.python.org/dev/peps/pep-0479/
If you are in a generator (a function that uses "yield") you are never allowed to raise StopIteration instead you should just `return` or pass out of scope (implicit return None)
Reviewed By: thatch
Differential Revision: D17749640
fbshipit-source-id: 9f1be673cf877ff193a0379a0208d037dd2d7bae
Summary: This is a better way to wrap smartlog functionality.
Reviewed By: mitrandir77
Differential Revision: D17686738
fbshipit-source-id: 770b32c19c89a59aee0f8b25251faaae7685a4dd
Summary: The graphnode templatekw must be wrapped in the keywords dict, and the phabstatus template needs to work if the requested revision is hidden.
Reviewed By: mitrandir77
Differential Revision: D17685575
fbshipit-source-id: 5e4a8b45dfe6564af3f72de3511d834aa498d154
Summary:
Essentially, snapshots are being synced exactly like heads are.
A dedicated table in CC DB etc.
Reviewed By: markbt
Differential Revision: D17345491
fbshipit-source-id: a1e65c2a4815f437a11da68f9d46c27f046453a9
Summary: Now help text for the snapshot extension doesn't have any TODOs.
Reviewed By: markbt
Differential Revision: D17627630
fbshipit-source-id: 3e02f6540ab84010712a146a069dbb4a3968182f
Summary:
If some bundle consisted of several snapshots, and the client requests a part of that data, the server can trigger the rebundling process.
This diff teaches snapshots to the rebundling process.
The `bundlerepo` object should store data in memory, so a `unionstore` class is made up.
It allows to "pair" in-memory store with a regular local store and query them via the same API.
Reviewed By: markbt
Differential Revision: D17684945
fbshipit-source-id: 0bdb1f70b777fb2d8193b3bfa46b5915c2019663
Summary:
`hg hide <snapshot id>` should remove it from the list of snapshots (=> no sync and not shown in smartlog).
`hg unhide <snapshot id>` should restore the snapshot in the list, but do not unhide the underlying commit.
Reviewed By: markbt
Differential Revision: D17570798
fbshipit-source-id: 895f7b53464860b80f4f2498ea97f8db270b4d67
Summary:
Storing nodes in a `set` does not make much sense because of possible aliases etc.
It is possible to remove duplicates via `util.removeduplicates` function.
List, on the other hand, preserves order and there will be less conversions during sync (later in the stack).
Differential Revision: D17397594
fbshipit-source-id: ba76e0a1f53516544f055355356d0beaf1c8bfa8
Summary:
Right now `hg pull -r REV` marks all pulled revs as visible.
This makes sense for regular commits (if they exist in the cloud, then they are not hidden).
For snapshots, it is wrong, thus we need not to mark snapshots as visible when pulling.
Differential Revision: D17289438
fbshipit-source-id: d16237b9e471f49bb44317104bc445472bedc16c
Summary: It will be needed to sync snapshots while bypassing the `sync` transaction.
Reviewed By: markbt
Differential Revision: D17571650
fbshipit-source-id: ff6c0382a1b1e763c3e37610d188f5bbfb382510
Summary:
Snapshots are essentially hidden commits that can be backed up/synced via infinitepush.
When we back up the repo state, we want it to access snapshots without explicitly specifying that they are hidden.
Differential Revision: D17260966
fbshipit-source-id: aa7f24043dddb052cab89c1ba939440887e99339
Summary:
We decided not to re-serialize the existing metadata files.
Even though CBOR is good, multiple cycles of serialization can lead to ambiguous encoding.
Thus, the bundle part would look like that:
```
{
"metadatafiles": {
<metadata oid>: {
"content": <binary CBOR-serialized metadata content>,
},
. . .
},
"auxfiles": {
<file oid>: {
"content": <binary file content>,
},
. . .
}
}
```
Reviewed By: quark-zju
Differential Revision: D17466032
fbshipit-source-id: 6d81aacbe76e2037b4b9acae760b759f1c31ecac
Summary: This is better that `json` because it will allow to store any binary data inside the metadata (e.g. file content).
Reviewed By: quark-zju
Differential Revision: D17464502
fbshipit-source-id: 3d559f390cc7827300fc51c23f004f1d833f0ab4
Summary: They became redundant and impose restrictions on the code.
Reviewed By: quark-zju
Differential Revision: D17463968
fbshipit-source-id: 83cb8d9dca037747e62f9e8c41a4081259c92e91
Summary: Do not keep a reference to the repo and provide a better API.
Reviewed By: quark-zju
Differential Revision: D17463871
fbshipit-source-id: d54256208b5f571ca8a4f4e2d07353edd9e825b2
Summary: Also remove debug commands that are strictly related to remote lfs.
Reviewed By: markbt
Differential Revision: D17184902
fbshipit-source-id: da38a2150212500bab62191ddcfab0990276605e
Summary:
Instead of the lfs remote storage it was chosen to send the snapshot metadata via bundles.
Snapshot metadata consists of: the actual metadata blob + several other blobs (untracked files etc).
If we have several snapshot revisions in a single bundle, the blobs could repeat.
Then we should store each blob as a separate entry in a binary stream, keeping its id and contents.
Here we introduce a new bundle part type `"b2x:snapshotmetadataparttype"`.
```
1 byte of version info
[ # a list of binary entries, each corresponds to a separate file
# (either a metadata file itself or a related -- externally stored -- file)
<oid><length><data>
:oid: is a 64char string with the hash of the file
:length: is an unsigned int with length of the data
:data: is binary data of length <length>, the actual file contents
]
```
So far there is an ongoing discussion on the exact format of serialization.
Actual state is at [the quip doc](https://fb.quip.com/R5OVAzabX8oo).
Reviewed By: markbt
Differential Revision: D17184222
fbshipit-source-id: 90f833ec71556e90d513e3be3f3efa7f870b037d
Summary: That way it'll be easier to pack it into a blob.
Reviewed By: markbt
Differential Revision: D17183018
fbshipit-source-id: 44e21103f201aafb6f417a5b5a7b3d4735f32039
Summary: In the next diff I will replace remote lfs with bundle2
Reviewed By: markbt
Differential Revision: D17132405
fbshipit-source-id: a0dfff3ebad067abb0231cf31de08ae62affe7ce