context: override workingctx.hex() to avoid a crash
Since node is None for workingctx, it can't use the base class
implementation of 'hex(self.node())'.
It doesn't appear that there are any current callers of this, but there will be
when archive supports 'wdir()'. My first thought was to use "{p1node}+", but
that would cause headaches elsewhere [1].
We should probably fix up localrepository.__getitem__ to accept this hash for
consistency, as a followup. This works, if the full hash is specified:
@@ -480,7 +480,7 @@
return dirstate.dirstate(self.vfs, self.ui, self.root, validate)
def __getitem__(self, changeid):
- if changeid is None:
+ if changeid is None or changeid == 'ff' * 20:
return context.workingctx(self)
if isinstance(changeid, slice):
return [context.changectx(self, i)
That differs from null, where it will accept any number of 0s, as long as it
isn't ambiguous.
[1] https://www.selenic.com/pipermail/mercurial-devel/2015-June/071166.html
test-fileset: remove bashism, use test instead of '[[ ]]'
Debian dash complains about it.
$TESTTMP.sh: 213: $TESTTMP.sh: [[: not found
tests: test symbolic revision (de)reference in all hgweb styles
Right now the way revisions get specified in hgweb urls is ignored, i.e. after
revision is resolved, only its node hash (or sometimes local revision number)
is used for all links in the templates. So, basically, every page for "tip"
revision (or any other symbolic rev id) will dereference it: lose the nice
symbolic name by putting node hash/local rev number in its place. The only
exception so far is archive links on some pages: /archive/tip.{bz2,gz,zip}.
The fact that this dereferencing is neither convenient nor intuitive is
reflected in
issue2296,
issue2826 and
issue3594.
issue3634 also mentions this.
But to fix this it's first needed to demonstrate and test the way templates
currently form links.
The new test file is separate from other hgweb tests, since it seems big and
distinct enough. And it's so big because links are formed in each template
independently, so it's necessary to test them all to avoid any inconsistent
behavior.
dirstate: use a presized dict for the dirstate
This uses a simple heuristic to avoid expensive resizes.
On a real-world repo with around 400,000 files, perfdirstate:
before: ! wall 0.155562 comb 0.160000 user 0.150000 sys 0.010000 (best of 64)
after: ! wall 0.132638 comb 0.130000 user 0.120000 sys 0.010000 (best of 75)
On another real-world repo with around 250,000 files:
before: ! wall 0.098459 comb 0.100000 user 0.090000 sys 0.010000 (best of 100)
after: ! wall 0.089084 comb 0.090000 user 0.080000 sys 0.010000 (best of 100)
parsers: factor out code to create a presized dict
In upcoming patches we'll expose this as an API.
progress: respect ui.quiet (
issue4726)
Caught when I was running the hgsubversion testsuite and it started
printing progress bars over top of my test output lines.