manifest: rearrange add() method and add comments for clarity
Omit the check of bool(p1) since it's always true in practice: it will
either be nullid or some valid manifest sha, and we know nullid won't
ever be in the cache so we can simplify understanding of this code.
manifest: simplify manifest.add() by making args required
I verified that changed was never false (it was always a 2-tuple) by
adding
@@ -220,6 +225,8 @@ class manifest(revlog.revlog):
def add(self, map, transaction, link, p1=None, p2=None,
changed=None):
+ if not changed:
+ assert False, 'changed was %r' % changed
# if we're using the cache, make sure it is valid and
# parented by the same node we're diffing against
if not (changed and p1 and (p1 in self._mancache)):
and observing that the test suite still passed. Making all the
arguments required should help future readers understand what's going
on here.
manifest: move manifest parsing to module-level
We'll need this in the sharded manifest hashing routine, and I need to
tweak it anyway, so make it module-level now.
revlog: move references to revlog.hash to inside the revlog class
This will make it possible for subclasses to have different hashing
schemes when appropriate. I anticipate using this in manifests.
Note that there's still one client of mercurial.revlog.hash() outside
of revlog: mercurial.context.memctx uses it to construct the file
entries in an in-memory manifest. I don't think this will be a problem
in the immediate future, so I've left it as-is.
revlog: mark nullhash as module-private
No other module should ever need this, so mark it with _ so nobody
tries to use it.
ui: disable echo back of prompt input if ui is set to non-tty purposely
9ab18a912c44 is nice for test output, but it also affects command-server
channel. Command-server client shouldn't receive echo-back message, which
makes it harder to parse the output.