Summary: The recent reformat caused a few test failures, this should fix them.
Differential Revision: D8207359
fbshipit-source-id: ced37aff3038715e5876fe27b58a60ebe45e4097
Summary: Mostly empty lines removed and added. A few bugfixes on excessive line splitting.
Reviewed By: quark-zju
Differential Revision: D8199128
fbshipit-source-id: 90c1616061bfd7cfbba0b75f03f89683340374d5
Summary:
`len()` on a hybrid manifest wrapping a treemanifest would raise an attribute error. But if there is no treemanifest or there is *only* a treemanifest, then a TypeError is raised. Using `len()` on an object that doesn't support length should always raise `TypeError`, consistently.
Instead of looking up the `__len__` attribute, use the built-in `len()` function, which will raise `TypeError` if the wrapped manifest in a hybrid doesn't have a `__len__` method. This ensures that we get a consistent exception.
Reviewed By: farnz
Differential Revision: D7485510
fbshipit-source-id: 4132d6b383171cde8dd99dd60098716d4aedc527
Summary: fastmanifest used the statvfs function to be smart about how much disk space it used. That function isn't available on windows though. This optimization is optional, and we probably won't end up using the fastmanifest cache on windows anyways, so let's just skip it if its not available.
Reviewed By: quark-zju
Differential Revision: D7478478
fbshipit-source-id: e9595f3fef397d66d76f3ecfa54f8e4328ce0921
Summary:
Previously we were just putting nullid as the linknode in client side
trees, because when the trees were added the changelog hadn't been written yet,
so we didn't know the linknode. As part of fixing this, let's add linknode to
the manifestlog.add api. A future diff will fill this in with the right value.
Reviewed By: ryanmce
Differential Revision: D7280103
fbshipit-source-id: dad3d2456e0cbde39392bf77af53ceeaadb49913
Summary:
Currently revlog writing is done through a custom external path. Let's
hide it behind manifestlog.add as well. This will make it simpler to support the
transition to a tree only server in an upcoming diff.
Reviewed By: ryanmce
Differential Revision: D7148822
fbshipit-source-id: af43a639395e4686cf4b3d654d4408e0747c1b47
Summary:
Once we move to a treeonly world, there won't be any more manifest revlogs.
During the transition we'll still use hybrid manifest's though (the class, and
it will just resolve to treemanifests every time), so we need to support hybrid
manifests that don't actually have a revlog.
This also sets manifestlog._opener. We were already storing that on the other
manifestlog implementations, so we should do it on the main one for consistency
(and because this diff depends on it).
Reviewed By: ryanmce
Differential Revision: D7148821
fbshipit-source-id: 8f278a7bf4c0909423257165df59eae400a05a9e
Summary:
Previously we passed the p1tree directly. It's actually more convient
to pass the p1node, since in a future diff we'll be adding data to the tree
revlogs and they need p1node. This is also safer, since now the caller can't
accidentally pass the wrong p1tree.
Reviewed By: quark-zju
Differential Revision: D7148820
fbshipit-source-id: a489308ebcb2960643b61ff73dc90f1285a94ae3
Summary:
The addmemtree function was originally created to allow making
pending trees readable (i.e. trees that have been written but not committed).
Now that all writes are immediately readable, we don't need addmemtree anymore.
Reviewed By: quark-zju
Differential Revision: D7101314
fbshipit-source-id: f9ecabf366ba7bc59abee42d264e17ab66b7f0dd
Summary:
Now that _writeclientmanifest is basically just calling
manifestlog.add, let's get rid of it.
Differential Revision: D7083029
fbshipit-source-id: eee18cefd5a6ae3d95bba58b419364fc9fdb15b3
Summary:
As part of a series of diffs that will remove the need for addmemtree,
let's remove it from the _writeclientmanifest function so we can replace
_writeclientmanifest with a cleaner interface that doesn't call addmemtree.
Reviewed By: ryanmce
Differential Revision: D7083037
fbshipit-source-id: 51885ec547df5aa21e66afe36eb1f3224c3eae66
Summary:
We now have a unified place for writing trees to packs, so let's move
the fastmanifest code to use it.
Reviewed By: ryanmce
Differential Revision: D7083043
fbshipit-source-id: f5fc312b7614906b917fc7ca10866705fbd47aac
Summary:
A future diff will be removing the fastmanifest tree write helper. To
simplify that transition, let's move all the fastmanifest specific logic out of
the fastmanifest helper function.
Reviewed By: ryanmce
Differential Revision: D7083054
fbshipit-source-id: bf023efb857af2511b4ed7ae7ef069ee15575f08
Summary:
A future diff will move fastmanifest to use the common
_writeclientmanifest logic. Since the logic is subtly different, let's do it in
stages by first moving the existing logic to its own function (this diff), then
refactoring out the differences, then moving to the common _writeclientmanifest.
Reviewed By: ryanmce
Differential Revision: D7083044
fbshipit-source-id: 55d14d1fb0d95b1ba6c130b58deb21cbc97501fc
Summary:
Port of D6798134 to fbsource. It eliminates module-import failures as well as errors like this:
```
mercurial.error.ForeignImportError: hgext.extlib.treedirstate: /home/phillco/.local/lib/python2.7/site-packages/hgext/extlib/treedirstate.so lives outside /..../hg
```
....that block other tests, like test-help.t
(Note: this ignores all push blocking failures!)
Reviewed By: quark-zju
Differential Revision: D6799259
fbshipit-source-id: b77d1b565dbf52165e0847002be498648658e064
Summary:
D6685044 changed the location of fastmanifest which exposed it to the
additional test that failed. This commit fixes fastmanifest to address that
test.
Test Plan: Ran all the tests.
Reviewers: #mercurial, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D6685170
Summary:
This is part of the overall plan to move extensions from fb-hgext to
hgext. Follow up commits will address some of the test issues and move the
fastmanifest related tests out of fb-hgext to hgext.
Test Plan: Ran all the tests.
Reviewers: durham, #mercurial, #sourcecontrol
Reviewed By: durham
Subscribers: durham
Differential Revision: https://phabricator.intern.facebook.com/D6685044
Signature: 6685044:1515524660:7cb9f8f28478e7bbf816f3823406c788b79a053a