Commit Graph

21 Commits

Author SHA1 Message Date
Mark Thomas
e28d4a84e0 fix tests after reformat
Summary: The recent reformat caused a few test failures, this should fix them.

Differential Revision: D8207359

fbshipit-source-id: ced37aff3038715e5876fe27b58a60ebe45e4097
2018-05-30 13:47:50 -07:00
Lukasz Langa
dfda82e492 Upgrade to 18.5b1
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
2018-05-30 02:23:58 -07:00
Martijn Pieters
0aa55642b8 hg: make sure len(manifest) always raises TypeError
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
2018-04-13 21:51:45 -07:00
Durham Goode
e53a3e253a hg: don't use statvfs when it's not available
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
2018-04-13 21:51:45 -07:00
Durham Goode
976ae65ec7 hg: add linknode to manifestlog.add apis
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
2018-04-13 21:51:29 -07:00
Durham Goode
2ffaf8c08e hg: support writing to revlogs through manifestlog.add
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
2018-04-13 21:51:26 -07:00
Durham Goode
b248124ba7 hg: allow hybrid manifest's to exist without revlogs
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
2018-04-13 21:51:26 -07:00
Durham Goode
761c2d8c0a hg: replace p1tree with p1node, p2node in manifestlog.add
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
2018-04-13 21:51:26 -07:00
Durham Goode
1d15f87a30 hg: get rid of addmemtree
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
2018-04-13 21:51:19 -07:00
Durham Goode
ac2fc36da3 hg: move all manifest writes to manifestlog.add
Summary:
Now that _writeclientmanifest is basically just calling
manifestlog.add, let's get rid of it.

Differential Revision: D7083029

fbshipit-source-id: eee18cefd5a6ae3d95bba58b419364fc9fdb15b3
2018-04-13 21:51:18 -07:00
Durham Goode
4eaeb4fcd8 hg: move addmemtree out of _writeclientmanifest
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
2018-04-13 21:51:17 -07:00
Durham Goode
d62e207aad hg: move fastmanifest to use _writeclientmanifest
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
2018-04-13 21:51:17 -07:00
Durham Goode
7abe8756d1 hg: move fastmanifest specific logic out of tree write helper
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
2018-04-13 21:51:17 -07:00
Durham Goode
1077037f2e hg: move fastmanifest tree write to its own function
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
2018-04-13 21:51:17 -07:00
Jun Wu
2946a1c198 codemod: use single blank line
Summary: This makes test-check-code cleaner.

Reviewed By: ryanmce

Differential Revision: D6937934

fbshipit-source-id: 8f92bc32f75b9792ac67db77bb3a8756b37fa941
2018-04-13 21:51:08 -07:00
Phil Cohen
45c4a072f9 hgext: use relative imports wherever possible
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
2018-04-13 21:50:56 -07:00
Durham Goode
b805623673 fastmanifest: fix import paths 2018-01-09 15:23:52 -08:00
Durham Goode
3435e3fb82 cfastmanifest: move into hgext.extlib module 2018-01-09 15:23:52 -08:00
Durham Goode
3cc56d6007 imports: fix imports to refer to hgext 2018-01-09 15:23:52 -08:00
Saurabh Singh
163b35ec2e fastmanifest: fix test-check-code.t related errors
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
2018-01-09 11:13:10 -08:00
Saurabh Singh
ad7d64e944 fastmanifest: move fastmanifest from fb-hgext to hgext
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
2018-01-09 11:13:10 -08:00