Jun Wu <quark@fb.com> [Fri, 26 Feb 2016 15:07:58 +0000] rev 28263
dispatch: add wd parameter to _getlocal
Before this patch, _getlocal uses os.getcwd() to locate repo in current dir.
chgserver needs it to load repo config and has to do chdir twice: the first
is to set current directory and the second is to redo the side effect (in case
hg --cwd some/relative/path, chdir will be called again in dispatch later),
which is not pretty.
This patch adds an optional wd parameter to make it possible to specify wd
without chdir (and its side effect).
Jun Wu <quark@fb.com> [Fri, 26 Feb 2016 14:50:04 +0000] rev 28262
chgserver: add utilities to calculate confighash
confighash is the hash of sensitive config items like [extensions], and
sensitive environment variables like HG*, LD_*, etc. The config items
can come from global, user, repo config, and command line flags.
For chgserver, it is designed that once confighash changes, the server is
not qualified to serve its client and should redirect the client to a new
server. The server does not need to exit in this case, since it can still
be valid (have a matched confighash) to serve other chg clients.
Jun Wu <quark@fb.com> [Fri, 26 Feb 2016 14:13:12 +0000] rev 28261
chg: detect chg started by chg
Sometimes people may create a symbol link from hg to chg, or write a wrapper
script named hg calling chg. Without $HG and $CHGHG set, this will lead to
chg executes itself causing deadlock. The user will notice chg hangs for some
time and aborts with a timed out message, without knowing the root cause and
how to solve it.
This patch sets a dummy environment variable before executing hg to detect
this situation, and print a fatal message with some possible solutions.
CHGINTERNALMARK is set by chg client to detect the situation that chg is
started by chg. It is temporary and should be dropped to avoid possible
side effects.
Jun Wu <quark@fb.com> [Fri, 26 Feb 2016 14:17:59 +0000] rev 28260
chg: fallback to original hg for some unsupported commands or flags
There are some known unsupported commands or flags for chg, such as hg serve -d
and hg foo --time. This patch detects these situations and transparently fall
back to the original hg. So the users won't bother remembering what chg can and
cannot do by themselves.
The current detection is not 100% accurate since we do not have an equivalent
command line parser in C. But it tries not to cause false positives that
prevents people from using chg for legit cases. In the future we may want to
implement a more accurate "unsupported" check server-side.
David R. MacIver <david@drmaciver.com> [Wed, 24 Feb 2016 13:20:06 +0000] rev 28259
testing: add a 'continuous' profile
This gives a good way of letting Hypothesis run until it
finds an error, save that error, and be restarted without it
picking up on the old bug. This lets you run long-running
Hypothesis processes and then perform a manual deduplication
task on the bugs found at the end.
It's not an entirely satisfying way of using this, but anything
much better would require extensive changes to Hypothesis itself.
David R. MacIver <david@drmaciver.com> [Wed, 24 Feb 2016 13:11:30 +0000] rev 28258
testing: allow Hypothesis to enable extensions
This adds support for testing extensions, including both tests
that extensions don't change behaviour and test for specific
commands.
We use the precondition system to determine what commands are
available to us. If we never use any commands enabled by an
extension then that extension is *skippable* and should not
have changed the behaviour of the test. We thus rerun the test
with an environment variable which is designed to turn off the
extension.
David R. MacIver <david@drmaciver.com> [Fri, 26 Feb 2016 17:24:14 +0000] rev 28257
testing: test multiple repositories with Hypothesis
This expands the Hypothesis based stateful testing so that
rather than having a single repository under test, Hypothesis
manages a family of repositories. Some of these are freshly
created, some are clones of others.
David R. MacIver <david@drmaciver.com> [Wed, 24 Feb 2016 13:06:43 +0000] rev 28256
testing: expand Hypothesis tests with branch commands
This builds on the previous work to add Hypothesis based stateful
testing to add branching commands to the model.
David R. MacIver <david@drmaciver.com> [Wed, 24 Feb 2016 13:05:45 +0000] rev 28255
testing: generate tests operations using Hypothesis
The idea of this patch is to expand the use of Hypothesis
within Mercurial to use its concept of "stateful testing".
The result is a test which runs a sequence of operations
against a Mercurial repository. Each operation is given a
set of allowed ways it can fail. Any other non-zero exit
code is a test failure.
At the end, the whole sequence is then reverified by
generating a .t test and testing it again in pure
mode (this is also useful for catching non-determinism
bugs).
This has proven reasonably effective at finding bugs,
and has identified two problems in the shelve extension
already (
issue5113 and
issue5112).
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 29 Feb 2016 22:52:29 +0900] rev 28254
i18n-ja: synchronized with
cb6a952efbf4
Yuya Nishihara <yuya@tcha.org> [Mon, 15 Feb 2016 22:46:07 +0900] rev 28253
log: fix order of revisions filtered by multiple OR options (
issue5100)
This is the simplest workaround for the issue of the ordering of revset, which
is that the expression "x or y" takes over the ordering specified by the input
set (or the left-hand-side expression.) For example, the following expression
A & (x | y)
will be evaluated as if
(A & x) | (A & y)
That's wrong because revset has ordering. I'm going to fix this problem in
the revset module, but that wouldn't fit to stable. So, this patch just works
around the common log cases.
Since this change might have some impact on performance, it is enabled only
if the expression built from log options has ' or ' operation.
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 25 Feb 2016 22:35:11 -0800] rev 28252
demandimport: add _imp to ignore list
Mozilla is seeing an issue with demand importing of _imp
failing in pkg_resources/__init__.py:fixup_namespace_packages.
It strangely only reproduces when using a modern version of
setuptools/pip in certain scenarios. Adding _imp to the demand import
ignore list seems to make the problem go away.
timeless <timeless@mozdev.org> [Thu, 25 Feb 2016 16:54:14 +0000] rev 28251
tests: rename regression tests
Danek Duvall <danek.duvall@oracle.com> [Thu, 25 Feb 2016 10:01:59 -0800] rev 28250
zeroconf: fix crash in "hg paths" when zeroconf server is up
Running "hg paths" with zeroconf enabled and when a zeroconf server is up
and running gives a traceback with "ValueError: rawloc must be defined".
This is because zeroconf needs to wrap ui.configsuboptions(), introduced in
dccbebcff075.
Danek Duvall <danek.duvall@oracle.com> [Wed, 24 Feb 2016 22:22:18 -0800] rev 28249
zeroconf: fix setsockopt() call on Solaris to send payload of correct length
The zeroconf extension has been broken on Solaris since the beginning, but
no one noticed until the testsuite started poking it after changeset
72f2a19c5f88, when it started running "hg paths" with the extension
enabled.
Solaris requires that, for IP_MULTICAST_{TTL,LOOP}, the argument passed in
be of length 1. With the original code here, it gets passed in as an int
-- length 4 -- and so the system call fails with EINVAL. Thankfully,
Python's socket.setsockopt() allows you to pass in a string instead of an
integer, and it passes that string to libc's setsockopt() with the correct
value and length.
timeless <timeless@mozdev.org> [Wed, 03 Feb 2016 04:54:40 +0000] rev 28248
blackbox: properly replace ui class
Without this, anyone creating a ui object using: uimod.ui()
skips the blackbox.
Also, anyone doing ui.copy() skipped the blackbox.
Unfortunately, the ui object lifestyle is a bit messy,
the first one that's created is never actually initialized
with subclasses, instead pieces of the subclass are adopted
into the primal ui object. In order to handle this, a
_partialinit method will be called to ensure that the
blackboxui is properly initialized.
timeless <timeless@mozdev.org> [Wed, 03 Feb 2016 17:05:04 +0000] rev 28247
blackbox: store the blackbox ui object instead of the log file
Without this, the last logged entry didn't have access to
the repository, and thus couldn't report its version
(and especially that an add or similar dirtied it).
A side-effect is that one repo leaks until process exit...
timeless <timeless@mozdev.org> [Tue, 09 Feb 2016 15:44:13 +0000] rev 28246
blackbox: log dirty state
If blackbox.dirty = True, use `+` to indicate dirty repositories.
timeless <timeless@mozdev.org> [Tue, 09 Feb 2016 19:16:06 +0000] rev 28245
blackbox: log working directory version
Without this, while you could see the list of commands run,
it wasn't possible to identify what they were doing, because commads
could rely on revsets (including remote input which varies over time).
timeless <timeless@mozdev.org> [Mon, 08 Feb 2016 03:37:26 +0000] rev 28244
blackbox: rename fp variable
timeless <timeless@mozdev.org> [Wed, 03 Feb 2016 15:41:31 +0000] rev 28243
blackbox: avoid creating multiple file handles for a single log
There are multiple ui objects in Mercurial that can relate to a repository,
before this change, each one would have its own file pointer, which
results in unfortunate logging behavior.
Also, any log rotation results would be bad because only the
active blackboxui object's file pointer would be refreshed.
Note that this does not prevent two long running hg commands for the same
repository from causing problems.
timeless <timeless@mozdev.org> [Wed, 24 Feb 2016 20:04:32 +0000] rev 28242
tests: mock getpid to reduce glob usage
Updating tests based on
ac49ecb2a897.
Martin von Zweigbergk <martinvonz@google.com> [Mon, 22 Feb 2016 14:43:14 -0800] rev 28241
changegroup: drop special-casing of flat manifests
Since
c08814b48ae5 (changegroup: avoid iterating the whole manifest,
2015-12-04), the manifest linkrev callback iterates over only the
files that were touched according the the changeset. Before that
change, we iterated over all files returned in
manifest.readfast(). That method returns the files in the delta, if
the delta parent is a parent, otherwise it returns the full
manifest. Most manifest revisions end up using one of the parents as
its delta parent, so most of the time, the method returns a short
manifest. It seems that that happens often enough that it doesn't
really matter; I could not reproduce the timings reported in that
change.
Since the treemanifest code now works quite differently, and since
that code also works correctly for flat manifests, let's drop the
special-casing of flat manifests.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 12 Feb 2016 23:09:09 -0800] rev 28240
changegroup: fix treemanifests on merges
The current code for generating treemanifest revisions takes the list
of files in the changeset and finds the directories from them. This
does not work for merges, since a merge may pick file A from one side
and file B from another and neither of them would appear in the
changeset's "files" list, but the manifest would still change.
Fix this by instead walking the root manifest log for all needed
revisions, storing all needed file and subdirectory revisions, then
recursively visiting the subdirectories. This also turns out to be
faster: cloning a version of hg core converted to treemanifests went
from ~28s to ~19s (timing somewhat unfair: before this patch, timed
until crash; after this patch, timed until manifests complete).
The new algorithm is used only on treemanifest repos. Although it
works equally well on flat manifests, we leave the iteration over
files in the changeset for flat manifests for now.
Yuya Nishihara <yuya@tcha.org> [Sun, 27 Dec 2015 20:21:37 +0900] rev 28239
templatekw: workaround for utf-8 round-trip of {desc}
Though our encoding strategy is best effort, {desc} is a primitive keyword
that should be worth enough to try hard to preserve UTF-8 bytes.
Pierre-Yves David <pierre-yves.david@fb.com> [Thu, 25 Feb 2016 10:34:31 +0100] rev 28238
test: update test-bundle2-format.t comment
Now that bundle2 is used by default for all exchanges, this comment is obviously
out of date. Having deep testing of the API and expected behavior of the format
and its processing is still valuable, so the comment is updated.
Jun Wu <quark@fb.com> [Wed, 24 Feb 2016 14:24:00 +0000] rev 28237
chg: extract gethgcmd logic to a function
gethgcmd is to get original hg (not chg) binary name. This patch extracts
the logic from execcmdserver to make it available for the following patch.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Wed, 24 Feb 2016 23:00:33 +0900] rev 28236
destutil: use cached branch information instead of query for efficiency
Before this patch, calculation of "the tipmost branch head on current
branch" uses revset query "max(.::(head() and branch(BRANCH)))", but
this isn't efficiency, because:
- head() predicate lists up heads on all branches, but
- branch() predicate eliminates heads on other branches
In addition to it, without "literal:" prefix for branch name,
branch(BRANCH) tries to (1) look up BRANCH in "repo.branchmap()" and
(2) look up BRANCH as symbol name again, if there is no branch
matching against BRANCH. The latter looking up is obviously redundant.
This patch uses repo.branchheads(closed=True) to get all branch heads
on specified branch instead of "head() and branch(BRANCH)" revset
query part.
This patch also makes catching RepoLookupError meaningless, because it
is only raised by revset predicate "branch()". But "currentbranch in
repo.branchmap()" can detect whether currentbranch actually exists or
not.
Therefore, this patch replaces try/except for RepoLookupError by
if/else for "currentbranch in repo.branchmap()".
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Wed, 24 Feb 2016 23:00:33 +0900] rev 28235
destutil: replace wc.branch() invocations by cached value for efficiency
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Wed, 24 Feb 2016 23:00:32 +0900] rev 28234
destutil: remove redundant examination
Before this patch, "len(heads) != len(otherheads)" is examined to
detect whether message should be displayed or not.
But if "repo.revs('%ln and parents()', heads)", heads should contain
"parents()" and otherheads is always less than heads.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Wed, 24 Feb 2016 23:00:32 +0900] rev 28233
destutil: add new local variable to increase readability
Before this patch, local variable 'heads' is used not only for "all
branch heads" but also for "branch heads other than current parent".
This patch newly adds local variable 'otherheads' for the latter
purpose, to increase readability.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 12 Feb 2016 23:30:18 -0800] rev 28232
changegroup: write root manifests and subdir manifests in a single loop
This is another step towards making the manifest generation recurse
along the directory trees. The loop over 'tmfnodes' now takes the form
of a queue. At this point, we only add to the queue twice: we add the
root manifests, and, while visiting the root manifest revisions, we
add all subdirectory revisions (for treemanifest repos). Thus, any
iterations over 'tmfnodes' after the first will not add any items and
the "queue" will just keep shrinking.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 12 Feb 2016 23:26:15 -0800] rev 28231
changegroup: introduce makelookupmflinknode(dir)
This is another step towards making the manifest generation recurse
along the directory trees. It makes the two calls to _packmanifests()
more similar.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 12 Feb 2016 21:21:28 -0800] rev 28230
changegroup: prune subdirectory dirlogs too
We already prune changesets, root manifests and files whose linkrev is
in the set of common revisions. We should do the same for dirlogs.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 12 Feb 2016 15:42:16 -0800] rev 28229
changegroup: include subdirectory manifests in verbose size
When verbose logging is one, we report the size in bytes of the
manifest data in the changegroup. For files, we report the size per
file, but I'm not sure we need that level of detail (i.e. size per
directory manifest). Instead, report a single figure for the size of
root manifest plus submanifests.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 12 Feb 2016 15:18:56 -0800] rev 28228
changegroup: make _packmanifests() dumber
The next few patches will rewrite the manifest generation code to work
with merges. We will then walk dirlogs recursively. This prepares for
that by moving much of the treemanifest code out of _packmanifests()
and into generatemanifests(). For this to work, it also adds
_manifestsdone() method that returns the "end of manifests" close
chunk for cg3 and an empty string for cg1 and cg2.
Martin von Zweigbergk <martinvonz@google.com> [Thu, 11 Feb 2016 20:19:48 -0800] rev 28227
changegroup: extract generatemanifests()
The changegroup.generate() function is pretty long, so let's extract
the manifest generation part of it.
Martin von Zweigbergk <martinvonz@google.com> [Tue, 23 Feb 2016 10:59:25 -0800] rev 28226
merge: use any() instead of for loop when checking for dirty subrepos
I think it's both simpler and clearer to use any() than the current
for loop.
While at it, also drop the call to sorted(), since it doesn't matter
which order we iterate over subrepos.
Kostia Balytskyi <ikostia@fb.com> [Wed, 24 Feb 2016 19:31:55 +0000] rev 28225
templater: fix list templating bug
High-level use case: printing a list of objects with formatter
when each object in turn contains a list of properties (like
when % template symbol is used in {things % '{thing}'}
Let the top-level list contain one thing with two properties:
objs = [{
'props': [
{ 'value': 1, 'show': 1 },
{ 'value': 2 }]
}]
(please note that second property does not have 'show' key)
If a templateformatter is used to print this with template
"{props % '{if(show, value)}'}"
current implementation will print value for both properties,
which is a bug. This happens because in `templater.runmap`
function we only rewrite mapping values with existing new
values for each item. If some mapping value is missing in
the item, it will not be removed.
Pierre-Yves David <pierre-yves.david@fb.com> [Wed, 24 Feb 2016 16:58:07 +0100] rev 28224
histedit: also handle locally missing nodes when reading obsolescence
The previous version of the code was interpreting markers to a missing
node as a prune in all cases. The expected way to handle such
situation is to keep reading markers, only turning successors into
"prune" if they are at the end of a chain.
We update the code and add a test for this.
Jun Wu <quark@fb.com> [Wed, 24 Feb 2016 18:42:59 +0000] rev 28223
chgserver: auto exit after being idle for too long or lose the socket file
This is a part of the one server per config series. In multiple-server setup,
new server may be started for a temporary config change like in command line,
--config extensions.foo=bar.py. This may end up with a lot of not so useful
server processes. Other questions are about socket file and process management,
How to stop these processes? What if a new server wants to listen on a same
address, replacing the old one?
This patch introduces AutoExitMixIn, which will:
1. Exit after being idle for too long. So useless servers won't run forever.
2. Periodically check the ownership of socket file, exit if it is no longer
owned. This brings strong consistency between the filesystem and the
process, and handles some race conditions neatly.
Since rename is atomic, a new server can just have a same server address
with an old one and won't worry about how to make sure the old server is
killed, address conflict, service downtime issues.
The user can safely stop all servers by simply removing the socket files,
without worrying about outdated or accidentally removed pidfiles.
Pierre-Yves David <pierre-yves.david@fb.com> [Mon, 22 Feb 2016 23:36:04 +0100] rev 28222
unionrepo: properly handle hidden linkrev in revlog (
issue5070)
The unionrepository have to do some special magic to handle linkrev of the
unioned filerev and manifestrev. That logic was done from a repoview and
obsolescence marker affecting bundled changeset could lead to a crash. We now
ensure we operate on unfiltered repository.
Pierre-Yves David <pierre-yves.david@fb.com> [Mon, 22 Feb 2016 23:34:54 +0100] rev 28221
bundlerepo: properly handle hidden linkrev in manifestlog (
issue4945)
The bundlerepository have to do some special magic to handle linkrev of the
bundled manifest. That logic was done from a repoview and obsolescence marker
affecting bundled changeset could lead to a crash. We now ensure we operate on
unfiltered repository.
Pierre-Yves David <pierre-yves.david@fb.com> [Mon, 22 Feb 2016 18:35:40 +0100] rev 28220
bundlerepo: properly handle hidden linkrev in filelog (
issue4945)
The bundlerepository have to do some special magic to handle linkrev of the
bundlerepo filerev. That logic was done from a repoview and obsolescence marker
affecting bundled changeset could lead to a crash. We now ensure we operate on
unfiltered repository.
Jun Wu <quark@fb.com> [Wed, 24 Feb 2016 18:42:14 +0000] rev 28219
check-code: allow old style class with special comments
The following chgserver change will use an old style class to comply with
SocketServer's code style. This patch made it possible to pass check-code.
Matt Mackall <mpm@selenic.com> [Wed, 24 Feb 2016 15:55:44 -0600] rev 28218
merge with stable
Durham Goode <durham@fb.com> [Wed, 24 Feb 2016 10:41:15 -0800] rev 28217
revset: use smartset minus operator
Previously, revsets like 'X - Y' were translated to be 'X and not Y'. This can
be expensive, since if Y is a single commit then 'not Y' becomes a huge set and
sometimes the query optimizer doesn't account for it well.
This patch changes revsets to use the built in smartset minus operator, which is
often smarter than 'X and not Y'.
On a large repo this saves 2.2 seconds on rebase and histedit because "X:: - X"
becomes almost instant.
Relevant performance numbers from revsetbenchmark.py
revset #13: roots((tip~100::) - (tip~100::tip))
plain min max first last reverse rev..rst rev..ast sort sor..rst sor..ast
0) 0.001080 0.001107 0.001102 0.001118 0.001121 0.001114 0.001141 0.001123 0.001099 0.001123 0.001137
1) 0.000708 65% 0.000738 66% 0.000735 66% 0.000739 66% 0.000784 69% 0.000780 70% 0.000807 70% 0.000756 67% 0.000727 66% 0.000759 67% 0.000808 71%
revset #14: roots((0::) - (0::tip))
plain min max first last reverse rev..rst rev..ast sort sor..rst sor..ast
0) 0.131304 0.079168 0.133129 0.076560 0.048179 0.133349 0.049153 0.077097 0.129689 0.076212 0.048543
1) 0.065066 49% 0.036941 46% 0.066063 49% 0.034755 45% 0.048558 0.071091 53% 0.047679 0.034984 45% 0.064572 49% 0.035680 46% 0.048508
revset #22: (not public() - obsolete())
plain min max first last reverse rev..rst rev..ast sort sor..rst sor..ast
0) 0.000139 0.000133 0.000133 0.000138 0.000134 0.000155 0.000157 0.000152 0.000157 0.000156 0.000153
1) 0.000108 77% 0.000129 0.000129 0.000134 0.000132 0.000127 81% 0.000151 0.000147 0.000127 80% 0.000152 0.000149
revset #25: (20000::) - (20000)
plain min max first last reverse rev..rst rev..ast sort sor..rst sor..ast
0) 0.050560 0.045513 0.022593 0.043588 0.021909 0.045517 0.021822 0.044660 0.049740 0.044227 0.021819
1) 0.018614 36% 0.000171 0% 0.019659 87% 0.000168 0% 0.015543 70% 0.021069 46% 0.015623 71% 0.000180 0% 0.018658 37% 0.000186 0% 0.015750 72%
Kostia Balytskyi <ikostia@fb.com> [Tue, 23 Feb 2016 21:38:36 +0000] rev 28216
histedit: make histedit aware of obsolescense not stored in state (
issue4800)
Before this change, when histedit exited to interactive session (during edit
command for example), user could introduce obsolescence markers that would not
be known to histedit. For example, user could've amended one of the commits.
The fact of this amendment would not be stored in histedit's state file
and later, when histedit would try to process all the replacements,
one of the final successors (in histedit's opinion) would turn out to be hidden.
This behavior is described in
issue4800. This commit fixes it.
Martin von Zweigbergk <martinvonz@google.com> [Tue, 09 Feb 2016 20:22:33 -0800] rev 28215
treemanifest: allow setting flag to 't'
When using treemanifests, an on-disk manifest entry with the 't' flag
set means that that entry is a directory and not a file. When read
into memory, these become instances of the treemanifest class. The 't'
flag should therefore never be visible to outside of manifest.py, so
setflag() checks that it is not called with the 't' flag. However, it
turns out that it will be useful for the narrowhg extension to expose
the 't' flag to the user (see below), so let's drop the assertion.
The narrowhg extension allows cloning only a given set of files and
directories. Filelogs and dirlogs that don't match that set will not
be included in the clone. The extension currently doesn't work with
treemanifests. I plan on changing it so directories outside the narrow
clone appear in the manifest. For example, if a directory 'outside/'
is not part of the narrow clone, it will look like a file 'outside'
with the 't' flag set. That will make e.g. manifestmerge() just work
in most cases (and make it well prepared to handle the other
cases).
Tony Tung <tonytung@merly.org> [Tue, 23 Feb 2016 17:22:51 -0800] rev 28214
treemanifest: use "cp xyz/." instead of "cp xyz/*"
This is more similar to cp -T because it covers hidden files.
Yuya Nishihara <yuya@tcha.org> [Sun, 27 Dec 2015 18:50:03 +0900] rev 28213
templatefilters: drop old jsonescape() function
It's been superseded by encoding.jsonescape(paranoid=True).
Yuya Nishihara <yuya@tcha.org> [Sun, 27 Dec 2015 17:59:57 +0900] rev 28212
templatefilters: make json filter be byte-transparent (BC) (
issue4926)
This is necessary to preserve filename encoding over JSON. Instead, this
patch inserts "|utf8" where non-ascii local-encoding texts can be passed
to "|json".
See also the commit that introduced "utf8" filter.
Yuya Nishihara <yuya@tcha.org> [Mon, 04 Jan 2016 23:05:09 +0900] rev 28211
hgweb: add option to convert encoding of graphdata()
Because future patches will change "|json" filter to handle input bytes
transparently, i.e. use UTF-8b encoding, "{jsdata}" must keep data in UTF-8
bytes, whereas "{nodes}" are text.
This patch inserts encodestr() where localstr is likely to survive.
Yuya Nishihara <yuya@tcha.org> [Mon, 04 Jan 2016 22:55:05 +0900] rev 28210
hgweb: remove unused argument from graphdata() factory
As graphdata() is wrapped by lambda, there's no reason to pass unused
arguments to it.
Yuya Nishihara <yuya@tcha.org> [Sun, 27 Dec 2015 17:45:05 +0900] rev 28209
templatefilters: add "utf8" to get utf-8 bytes from local-encoding text
This will be applied prior to "|json" filter. This sounds like odd, but it
is necessary to handle local-encoding text as well as raw filename bytes.
Because filenames are bytes in Mercurial and Unix world, {filename|json} should
preserve the original byte sequence, which implies
{x|json} -> '"' toutf8b(x) '"'
On the other hand, most template strings are in local encoding. Because
"|json" filter have to be byte-transparent to filenames, we need something to
annotate an input as a local string, that's what "|utf8" will do.
{x|utf8|json} -> '"' toutf8b(fromlocal(x)) '"'
"|utf8" is an explicit call, so aborts if input bytes can't be converted to
UTF-8.
Yuya Nishihara <yuya@tcha.org> [Sun, 27 Dec 2015 17:16:45 +0900] rev 28208
templatefilters: drop broken "jsonescape" from filters table (BC)
It's been unused, undocumented and flawed in that it expects a unicode input,
never works correctly if an input has non-ascii character. We should use "json"
filter instead.
Martin von Zweigbergk <martinvonz@google.com> [Sat, 20 Feb 2016 23:57:21 -0800] rev 28207
treemanifest: rewrite text() using iterentries()
This simplifies a bit. Note that the function is only used when
manually testing with _treeinmem=True.
Martin von Zweigbergk <martinvonz@google.com> [Sun, 07 Feb 2016 21:14:01 -0800] rev 28206
treemanifest: implement iterentries()
To make tests pass with _treeinmem manually set to True, we need to
implement the recently added iterentries() on the treemanifest class
too.
Martin von Zweigbergk <martinvonz@google.com> [Thu, 11 Feb 2016 15:38:56 -0800] rev 28205
verify: show progress while verifying dirlogs
In repos with treemanifests, the non-root-directory dirlogs often have
many more total revisions than the root manifest log has. This change
adds progress out to that part of 'hg verify'. Since the verification
is recursive along the directory tree, we don't know how many total
revisions there are at the beginning of the command, so instead we
report progress in units of directories, much like we report progress
for verification of files today.
I'm not very happy with passing both 'storefiles' and 'progress' into
the recursive calls. I tried passing in just a 'visitdir(dir)'
callback, but the results did not seem better overall. I'm happy to
update if anyone has better ideas.
Martin von Zweigbergk <martinvonz@google.com> [Wed, 03 Feb 2016 15:35:15 -0800] rev 28204
verify: check for orphaned dirlogs
We already report orphaned filelogs, i.e. revlogs for files that are
not mentioned in any manifest. This change adds checking for orphaned
dirlogs, i.e. revlogs that are not mentioned in any parent-directory
dirlog.
Note that, for fncachestore, only files mentioned in the fncache are
considered, there's not check for files in .hg/store/meta that are not
mentioned in the fncache. This is no different from the current
situation for filelogs.