Comments
Patch
@@ -155,6 +155,7 @@
from .i18n import _
from . import (
+ bookmarks as bookmod,
changegroup,
error,
obsolete,
@@ -287,13 +288,21 @@
* a way to construct a bundle response when applicable.
"""
- def __init__(self, repo, transactiongetter, captureoutput=True):
+ def __init__(self, repo, transactiongetter, captureoutput=True,
+ input=None):
+ """
+ `input` is a dictionary that is passed to part handlers to tweak
+ their behaviour
+ """
self.repo = repo
self.ui = repo.ui
self.records = unbundlerecords()
self.gettransaction = transactiongetter
self.reply = None
self.captureoutput = captureoutput
+ if input is None:
+ input = {}
+ self.input = input
"input" shadows a Python built-in function. And because of the security implications of input() (it is evil, don't ever use it), every time I see "input" as a standalone symbol name I grow paranoid. Could this be renamed to something else like "purpose" or "behavior?"
Also, you can write this as: self.foo = foo or {} (differentiating between None and a falsy value isn't interesting here).