bundlerepo: rename _bundle to _cgunpacker
_bundle is really a changegroup unpacker instance. Rename the
variable accordingly.
Differential Revision: https://phab.mercurial-scm.org/D1379
bundlerepo: assign bundle attributes in bundle type blocks
It is a bit wonky to assign the same object to multiple
attributes and then possibly overwrite them later.
Refactor the code to use a local variable and defer attribute
assignment until the final values are ready.
This required passing the bundle instance to _handlebundle2part().
The only use of this method I could find is Facebook's
treemanifest extension. Since it is a private method, I don't
think it warrants an API callout.
Differential Revision: https://phab.mercurial-scm.org/D1378
bundlerepo: make bundle and bundlefile attributes private
These attributes are implementation details and shouldn't be
exposed outside the class.
.. api::
bundlerepo.bundlerepository.bundle and
bundlerepo.bundlerepository.bundlefile are now prefixed with an
underscore.
Differential Revision: https://phab.mercurial-scm.org/D1377
bundlerepo: don't assume there are only two bundle classes
exchange.readbundle() can return a type that represents a stream
clone bundle. Explicitly handle the bundle1 type and raise a
reasonable error message for unhandled bundle types.
Differential Revision: https://phab.mercurial-scm.org/D1376
bundlerepo: add docstring for bundlerepository class
Differential Revision: https://phab.mercurial-scm.org/D1375
bundlerepo: rename arguments to bundlerepository.__init__
To reflect what they actually are.
Differential Revision: https://phab.mercurial-scm.org/D1374
bundlerepo: use suffix variable
It looks like the refactor in
702a26fec3e2 attempted to establish
this method argument but failed to use it. My editor caught it.
Differential Revision: https://phab.mercurial-scm.org/D1373
bundlerepo: make methods agree with base class
My editor was complaining about mismatches between method
signatures.
For methods that are implemented, we change arguments to match
the base. For those that aren't, we use variable arguments
because it shouldn't matter.
Differential Revision: https://phab.mercurial-scm.org/D1372
bundle2: use os.SEEK_* constants
Constants make code easier to read than magic numbers.
I also threw in an explicit argument in a caller to further
increase code comprehension.
Differential Revision: https://phab.mercurial-scm.org/D1370