templater: catch regexp error at sub() function
This patch splits re.sub() into re.compile() and sub() so that it can
distinguish which argument causes re.error.
graphmod: compute slow revset query once prior to reachableroots (
issue4782)
Because revsets query is evaluated lazily, "list(revs)" may take long for
complicated query. So we shouldn't iterate revs many times. This patch is the
easiest workaround for the
issue4782. We could introduce more aggressive
caching, but it wouldn't be as fast as the simple baseset operation.
Gregory Szorc said "this makes `hg wip` on my Firefox clone ~4x faster than
3.5.1 (~6.5s to ~1.5s). This is after a regression in @ to ~45s."
profiling: add config option for enabling profiling
Previously you could only enable profiling via the --profile option. This is
awkward when trying to debug a server side operation. Let's add a config option
to enable profiling.
In the future, this could be extended to allow profiling a certain percentage of
operations (and potentially reporting that information to an external service).
blackbox: add pid to output
This adds the process id to the line header for the blackbox output. This is
useful for distinguishing processes when using the blackbox on a server and many
processes are writing to the blackbox at once.
exchange: allow fallbackheads to use lazy set behavior
The common ancestor set implementation was made lazy a couple years ago, but
this piece of code still required processing the entire repo by putting set()
around the lazy set. The code was introduced in
5653f2d166ea, a year before the
lazy ancestor set was added.
Dropping the set() shaves 3.5 seconds off of 'push -r' in repos with hundreds of
thousands of commits.
hgweb: move templater instantiation to requestcontext
This code needs to access a lot of config options. All our config
lookups have moved to requestcontext. It makes sense to move this
function there.