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.