Durham Goode <durham@fb.com> [Sun, 30 Aug 2015 13:58:11 -0700] rev 26117
revlog: change generaldelta delta parent heuristic
The old generaldelta heuristic was "if p1 (or p2) was closer than the last full text,
use it, otherwise use prev". This was problematic when a repo contained multiple
branches that were very different. If commits to branch A were pushed, and the
last full text was branch B, it would generate a fulltext. Then if branch B was
pushed, it would generate another fulltext. The problem is that the last
fulltext (and delta'ing against `prev` in general) has no correlation with the
contents of the incoming revision, and therefore will always have degenerate
cases.
According to the blame, that algorithm was chosen to minimize the chain length.
Since there is already code that protects against that (the delta-vs-fulltext
code), and since it has been improved since the original generaldelta algorithm
went in (2011), I believe the chain length criteria will still be preserved.
The new algorithm always diffs against p1 (or p2 if it's closer), unless the
resulting delta will fail the delta-vs-fulltext check, in which case we delta
against prev.
Some before and after stats on manifest.d size.
internal large repo
old heuristic - 2.0 GB
new heuristic - 1.2 GB
mozilla-central
old heuristic - 242 MB
new heuristic - 261 MB
The regression in mozilla central is due to the new heuristic choosing p2r as
the delta when it's closer to the tip. Switching the algorithm to always prefer
p1r brings the size back down (242 MB). This is result of the way in which
mozilla does merges and pushes, and the result could easily swing the other
direction in other repos (depending on if they merge X into Y or Y into X), but
will never be as degenerate as before.
I future patch will address the regression by introducing an optional, even more
aggressive delta heuristic which will knock the mozilla manifest size down
dramatically.
Durham Goode <durham@fb.com> [Sun, 30 Aug 2015 13:34:30 -0700] rev 26116
revlog: move textlen calculation to be above delta chooser
This moves the textlen calculation to be above the delta chooser. Since textlen
is needed for calling isgooddelta, we need it above the delta chooser so future
patches can call isgooddelta.
Durham Goode <durham@fb.com> [Sun, 30 Aug 2015 13:33:00 -0700] rev 26115
revlog: move delta check to it's own function
This moves the delta vs fulltext comparison to its own function. This will allow
us to reuse the function in future patches for more efficient delta choices. As
a side effect, this will also allow extensions to modify our delta criteria.
Anton Shestakov <av6@dwimlabs.net> [Wed, 19 Aug 2015 21:43:13 +0800] rev 26114
monoblue: add archive links on summary page
timeless@mozdev.org [Sun, 30 Aug 2015 19:03:38 -0400] rev 26113
help: distinguish sections when multiple match (issue4802)
Matt Mackall <mpm@selenic.com> [Mon, 31 Aug 2015 17:21:38 -0500] rev 26112
merge with stable
Augie Fackler <augie@google.com> [Tue, 25 Aug 2015 00:06:41 -0400] rev 26111
hghave: add a check for docker support
This currently refuses to operate if on a non-Linux host. I suspect
that Docker running on FreeBSD 11 or on an Illumos derivative would
work fine, but I don't have ready access to such a system.
On OS X using boot2docker (I used a hacky xhyve-based one for
testing), it won't work because $TESTTEMP doesn't end up inside the
set of directories that get forwarded to the boot2docker VM, so you
can't actually drop debs in the $TESTTEMP at all. It would be possible
(probably even trivial) to hack around this by using a randomly-named
temporary directory inside the working directory, but that seems
unlikely to be useful enough to justify the ugliness.
Augie Fackler <augie@google.com> [Tue, 25 Aug 2015 00:03:15 -0400] rev 26110
hghave: add a check for debian packaging tools
Augie Fackler <augie@google.com> [Mon, 24 Aug 2015 22:23:45 -0400] rev 26109
run-tests: add support for marking tests as very slow
I want to add tests for our packaging rules, but those necessarily run
a whole build, or possibly two if both native packaging and docker are
available. This lets us flag such tests with a `#require slow` so that
they don't unnecessarily slow down normal test runs.
Augie Fackler <augie@google.com> [Tue, 25 Aug 2015 00:02:44 -0400] rev 26108
builddeb: rework how output dir and platform are specified
This makes it possible to write tests for both builddeb and dockerdeb
that actually build .debs and then sanity check the contents.
Augie Fackler <augie@google.com> [Wed, 26 Aug 2015 10:20:07 -0400] rev 26107
parsers: fix two cases of unsigned long instead of Py_ssize_t
We had to do this before because Python 2.4 didn't understand the n
format specifier in Py_BuildValue and friends. We no longer have that
problem.
Yuya Nishihara <yuya@tcha.org> [Sat, 04 Jul 2015 16:07:42 +0900] rev 26106
templatefilters: remove redundant 'date' and 'strip' filters
These filters are defined as 'date()' and 'strip()' functions. Help messages
are moved to the corresponding functions.
Yuya Nishihara <yuya@tcha.org> [Sat, 04 Jul 2015 16:03:36 +0900] rev 26105
templater: introduce unified filter syntax for unary functions
"filter(expr)" is allowed already. This patch adds the opposite, "expr|func".
Yuya Nishihara <yuya@tcha.org> [Sat, 04 Jul 2015 15:59:03 +0900] rev 26104
templater: inline getfilter() to buildfilter()
This prepares for the unified filter syntax that will be introduced by the
next patch.
liscju <piotr.listkiewicz@gmail.com> [Sun, 30 Aug 2015 11:47:43 +0200] rev 26103
clone: fix updaterev to update to latest branch changeset (issue4528)
Before this patch if clone --updaterev points to branch which head
on src repo wasnt in dest repo, clone updated dest repo to
default branch. After applying this patch, if changeset from
src repo pointing at given branch is not in dest repo, it searches
for changeset pointing for given branch locally in dest repo.
Lookup in destination repo:
559: uprev = destrepo.lookup(update)
is wrapped by try/except block to preserve current behaviour when
given revset to -u is not found - it will not fail,but silently update
dest repo to head of default branch.
liscju <piotr.listkiewicz@gmail.com> [Thu, 20 Aug 2015 17:19:32 +0200] rev 26102
revsets: makes follow() supports file patterns (issue4757) (BC)
Before this patch, follow only supports full, exact filenames.
This patch makes follow argument to be treated like file
pattern same way like log treats their arguments.
It preserves current behaviour of follow() matching paths
relative to the repository root by default.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 31 Aug 2015 23:14:58 +0900] rev 26101
i18n-ja: synchronized with b930d4ef7739
timeless@mozdev.org [Fri, 28 Aug 2015 15:50:36 -0400] rev 26100
histedit: improve discoverability of edit commit message
Pierre-Yves David <pierre-yves.david@fb.com> [Thu, 27 Aug 2015 17:57:33 -0700] rev 26099
revset: cache smartset's min/max
As the content of a smartset never changes, min and max will never change
either. This will save us time when this function is called multiple times.
This is relevant for issue4782 but does not fix it.
timeless@mozdev.org [Fri, 28 Aug 2015 10:53:55 -0400] rev 26098
spelling: behaviour -> behavior
timeless@mozdev.org [Fri, 28 Aug 2015 12:18:12 -0400] rev 26097
glossary: fixup use of periods at end of entries
* Include trailing period for entries
* Move trailing period inside quotations for example sentences
timeless@mozdev.org [Fri, 28 Aug 2015 11:31:44 -0400] rev 26096
histedit: fix grammar for help for safety aborts
Yuya Nishihara <yuya@tcha.org> [Fri, 28 Aug 2015 11:15:31 +0900] rev 26095
revset: mark reachablerootspure as private
Yuya Nishihara <yuya@tcha.org> [Fri, 28 Aug 2015 11:14:24 +0900] rev 26094
reachableroots: construct and sort baseset in revset module
This can remove the dependency from changelog to revset, which seems a bit awkward
for me.
Pierre-Yves David <pierre-yves.david@fb.com> [Fri, 21 Aug 2015 16:12:24 -0700] rev 26093
reachableroots: use smartset min
smartset min are likely to be optimised, cached or other magical property.
Pierre-Yves David <pierre-yves.david@fb.com> [Fri, 21 Aug 2015 16:03:25 -0700] rev 26092
graphmod: stop building a list out of branchgroupiter
Not only does this defeat the purpose of having `branchgroupiter` an iterable, but
this also makes revs something else than a smartset preventing to use revs.min()
in the call to reachablerevs.
Pierre-Yves David <pierre-yves.david@fb.com> [Mon, 24 Aug 2015 15:40:42 -0700] rev 26091
reachableroots: sort the smartset in the pure version too
Changeset be8a4e0800d8 uses smartset lazy sorting for the C version. We need to
apply the same to the pure version for consistency. This is fixing the tests
with --pure.
Augie Fackler <augie@google.com> [Mon, 24 Aug 2015 23:58:32 -0400] rev 26090
builddeb: actually run make when building the deb (issue4778)
As of this change, we no longer produce broken debs, but I've already
got followups written that will produce much more standard-looking
packages and test the resulting packages.
Augie Fackler <augie@google.com> [Mon, 24 Aug 2015 23:47:43 -0400] rev 26089
docker-debian-jessie: fix errant mkdir
Augie Fackler <augie@google.com> [Thu, 27 Aug 2015 14:24:39 -0400] rev 26088
makefile: rename debian-jessie to deb
`make debian-jessie` was a poor name choice on my part, because it
really builds a package for the current debian platform, whatever that
happens to be, rather than a specific platform. Rename it to just
`make deb` so that it's a little clearer. As a result, it now places
built debs in a "debian-unknown" directory.
Augie Fackler <augie@google.com> [Tue, 25 Aug 2015 00:40:42 -0400] rev 26087
run-tests: ignore failed removal of nonexistent installerrs
When running tests with -j100 or so on a large machine, I see this
os.remove call failing semi-regularly. Since it's not really a problem
when the file is already gone, just suppress the error in that case.
Matt Mackall <mpm@selenic.com> [Tue, 25 Aug 2015 13:38:20 -0500] rev 26086
templater: move verbosity-to-template matcher to constructor
We're going to reuse this and it's silly for it to be done per-cset anyway.
Matt Mackall <mpm@selenic.com> [Tue, 25 Aug 2015 12:59:08 -0500] rev 26085
templater: remove pseudo-ternary
Matt Mackall <mpm@selenic.com> [Tue, 25 Aug 2015 12:57:21 -0500] rev 26084
templater: fix variable name that shadows built-in
Matt Mackall <mpm@selenic.com> [Tue, 25 Aug 2015 09:38:06 -0500] rev 26083
templater: minor whitespace tweaks
Matt Mackall <mpm@selenic.com> [Mon, 24 Aug 2015 13:26:10 -0500] rev 26082
lock: make trylock private
Matt Mackall <mpm@selenic.com> [Mon, 24 Aug 2015 13:24:43 -0500] rev 26081
lock: loop a finite number of times in trylock (issue4787)
..before falling back to lock, which will sleep. This only addresses
the CPU consumption of the reported issue.
Yuya Nishihara <yuya@tcha.org> [Fri, 14 Aug 2015 12:25:14 +0900] rev 26080
reachableroots: silence warning of implicit integer narrowing issued by clang
Tested with CFLAGS=-Wshorten-64-to-32 CC=clang which is the default of
Mac OS X.
Because a valid revnum shouldn't exceed INT_MAX, we don't need long width for
large tovisit array.
Yuya Nishihara <yuya@tcha.org> [Fri, 14 Aug 2015 12:22:08 +0900] rev 26079
reachableroots: narrow scope of minidx variable
minidx is never used if includepath is false, so let's define it where it
is used.
Durham Goode <durham@fb.com> [Tue, 25 Aug 2015 15:54:33 -0700] rev 26078
convert: fix syncing deletes from p2 merge commit
Recently we fixed converting merges to correctly sync changes from p2. We missed
the case of deletes though (so p2 deleted a file that p1 had not yet deleted,
and the file does not belong to the source).
The fix is to detect when p2 doesn't have the file, so we just sync it as a
delete to p1 in the merge.
Updated the test, and verified it failed before the fix.
Durham Goode <durham@fb.com> [Mon, 24 Aug 2015 22:16:01 -0700] rev 26077
convert: add convert.git.skipsubmodules option
This adds an option to not pull in gitsubmodules during a convert. This is
useful when converting large git repositories where gitsubmodules were allowed
historically, but are no longer wanted.
Durham Goode <durham@fb.com> [Mon, 24 Aug 2015 19:33:36 -0700] rev 26076
paths: move path validation logic to its own function
Hard coding the '.hg' path in the paths class made it difficult for the hggit
extension to pull from gitrepos.
This patch moves the logic out to it's own function so extensions can add
additional checks to what is a valid path (i.e. a git repo is valid when hggit
is enabled).
Augie Fackler <augie@google.com> [Fri, 21 Aug 2015 14:33:51 -0400] rev 26075
parsers: avoid int/unsigned conversions
Detected with
make local CFLAGS='-Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter' CC=clang
Augie Fackler <augie@google.com> [Fri, 21 Aug 2015 14:29:42 -0400] rev 26074
base85: fix comparison of an int and a long
Caught using
make local CFLAGS='-Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter' CC=clang
Augie Fackler <augie@google.com> [Tue, 25 Aug 2015 15:52:54 -0400] rev 26073
progress: restore testedwith to the stub
Without this, hg always claims progress is at fault for problems,
which is completely crazy.
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 22 Aug 2015 22:59:51 -0700] rev 26072
hgweb: make refresh interval configurable
hgwebdir refreshes the set of known repositories periodically. This
is necessary because refreshing on every request could add significant
request latency.
More than once I've found myself wanting to tweak this interval at
Mozilla. I've also wanted the ability to always refresh (often when
writing tests for our replication setup).
This patch makes the refresh interval configurable. Negative values
indicate to always refresh. The default is left unchanged.
Erik Huelsmann <ehuels@gmail.com> [Sun, 16 Aug 2015 10:19:00 +0200] rev 26071
filemerge: add 'union' merge to internal merge tool
'union merge' is a merge strategy which adds both left and right hand side
of a conflict region. Git implements this merge strategy which is very
practical to have for merging e.g. the Changelog file.
Erik Huelsmann <ehuels@gmail.com> [Sun, 16 Aug 2015 00:24:29 +0200] rev 26070
filemerge: split internal merge into api entry point and internal helper
This is a step toward adding 'union merge' to the internal merge tool.
'union merge' is a merge strategy which adds both left and right hand side
of a conflict region. Git implements this merge strategy which is very
practical to have for merging to e.g. the Changelog file.
Erik Huelsmann <ehuels@gmail.com> [Sun, 16 Aug 2015 00:00:34 +0200] rev 26069
simplemerge: add 'mode' kwarg which - when 'union' - suppresses markers
This is a step toward adding 'union merge' to the internal merge tool.
'union merge' is a merge strategy which adds both left and right hand side
of a conflict region. Git implements this merge strategy which is very
practical to have for merging to e.g. the Changelog file.
Note: the identifiers with underscores in this commit are all using existing
variable names and/or keyword arguments.
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 22 Aug 2015 10:37:38 -0700] rev 26068
hghave: remove quiet option
The --quiet flag appears to be unused. Kill it.
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 22 Aug 2015 10:28:34 -0700] rev 26067
hghave: move feature checking into hghave.py
Upcoming patches will kill hghave (the script - not hghave.py) and
will move to a model where requirements checking is performed as
a function call.
Start diminishing the utility of hghave by moving some code to
hghave.py.
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 22 Aug 2015 10:22:12 -0700] rev 26066
tests: move '#require bzr' into .t files
The bzr tests are the only .t tests calling hghave (aside from the tests
testing hghave itself). This pattern is a one-off and prevents
desired refactors to how requirements checking is integrated into tests.
Use the convention used everywhere else.
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 08 Aug 2015 00:12:41 -0700] rev 26065
commands.push: use "pushloc" path attribute
Path instances now have a "pushloc" attribute that exposes the path
to be used for pushing. The "default-push" path is automatically
captured in the "pushloc" attribute of the "default" path.
Drop references to "default-push" and use the "pushloc" attribute
for looking up where to push to.
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 07 Aug 2015 21:53:34 -0700] rev 26064
ui: capture push location on path instances
Currently, we treat "default" and "default-push" as separate paths,
even though they are the same logical entity but with different paths
for different operations. Because they are the same entity and
because we will eventually be implementing an official mechanism
for declaring push URLs for paths, we establish a "pushloc" attribute
on path instances. We populate this attribute on the "default" path
with the "default-push" value, if present. This will enable
consumers stop referencing "default-push" which will make their code
simpler.
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 25 May 2015 13:10:38 -0700] rev 26063
worker: use multiprocessing to find cpu count
The multiprocessing package was added in Python 2.6.
The implementation of worker.countcpus() is very similar to
multiprocessing.cpu_count(). Ditch our one-off code.
multiprocessing does result in a number of imports. However,
the lazy importer ensures that we don't import anything until
cpu_count() is called. Furthermore, if we are doing something
with multiple cores, chances are the time of that operation
will dwarf the import time, so module bloat isn't a concern
here.
Augie Fackler <augie@google.com> [Mon, 24 Aug 2015 10:09:00 -0400] rev 26062
import-checker: ensure multiprocessing is treated as from stdlib
On my linux machines multiprocessing appears to defeat the logic in
import-checker to detect stdlib modules. Since we now only use
versions of Python which ship with multiprocessing, let's just
whitelist the module.
Pierre-Yves David <pierre-yves.david@fb.com> [Thu, 20 Aug 2015 17:23:21 -0700] rev 26061
reachableroots: use baseset lazy sorting
smartset sorting is lazy (so faster in some case) and better (informs that the
set is sorted allowing some optimisation). So we rely on it directly.
Some test output are updated because we now have more information (ordering).
Pierre-Yves David <pierre-yves.david@fb.com> [Thu, 20 Aug 2015 17:19:56 -0700] rev 26060
baseset: keep the input set around
Baseset needs a list to operate, but will convert that list back to a set for
membership testing. It seems a bit silly to convert the set into a list to
convert it back afterward.
Yuya Nishihara <yuya@tcha.org> [Sun, 16 Aug 2015 09:30:37 +0900] rev 26059
reachableroots: unroll loop that checks if one of parents is reachable
The difference is small, but fewer loops should be better in general:
revset #0: 0::tip
0) 0.001609
1) 0.001510 93%
Yuya Nishihara <yuya@tcha.org> [Sat, 15 Aug 2015 19:38:03 +0900] rev 26058
reachableroots: handle error of PyList_Append()
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 07 Aug 2015 22:39:47 -0700] rev 26057
commands.push: use paths API
ui.path instances now collect most of the data used by commands.push().
Move away from ui.expandpath() and call ui.paths.getpath() to get a
path instance.
Some "pushing to" output was dropped as one test demonstrates. I believe
the dropped message was redundant with the error message and the change
to be acceptable.
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 08 Aug 2015 00:16:02 -0700] rev 26056
ui: move URL and path detection into path API
ui.expandpath() has code for recognizing URLs or local filesystem
paths. Our goal is to use ``path`` class instances everywhere a path
is represented.
Changing ui.expandpath() to return path instances is a lot of work.
Our goal is to slowly marginalize it by moving logic into the paths
API and to convert callers to the paths API.
Many callers of ui.expandpath() pass in a value that could be a
local filesystem path or URI. We move the detection of these strings
from ui.expandpath() to paths.getpath() and path.__init__(). To do
this properly in a way that is compatible with future callers, we
need to parse the "#branch" syntax out of locations. This is a bit
complicated, but it is necessary.
The code for URL parsing is essentially a copy of hg.parseurl().
Once all consumers are speaking the paths API, it is likely that
this function won't be called any more and it can be deleted.
Yuya Nishihara <yuya@tcha.org> [Fri, 14 Aug 2015 15:52:19 +0900] rev 26055
reachableroots: return list of revisions instead of set
Now we don't need a set of reachable revisions, and the caller wants a sorted
list of revisions, so constructing a set is just a waste of time.
revset #0: 0::tip
2) 0.002536
3) 0.001598 63%
PyList_New() should set an appropriate exception on error, so we don't need
to call PyErr_NoMemory() manually.
This patch lacks error handling of PyList_Append() as it was before for
PySet_Add(). It should be fixed later.
Yuya Nishihara <yuya@tcha.org> [Fri, 14 Aug 2015 15:49:11 +0900] rev 26054
reachableroots: use internal "revstates" array to test if rev is reachable
This is faster than using PySet_Contains().
revset #0: 0::tip
1) 0.003678
2) 0.002536 68%
Yuya Nishihara <yuya@tcha.org> [Fri, 14 Aug 2015 15:43:29 +0900] rev 26053
reachableroots: use internal "revstates" array to test if rev is a root
The main goal of this patch series is to reduce the use of PyXxx() function
that is likely to require ugly error handling and inc/decref. Plus, this is
faster than using PySet_Contains().
revset #0: 0::tip
0) 0.004168
1) 0.003678 88%
This patch ignores out-of-range roots as they are in the pure implementation.
Because reachable sets are calculated from heads, and out-of-range heads raise
IndexError, we can just take out-of-range roots as unreachable. Otherwise,
the test of "hg log -Gr '. + wdir()'" would fail.
"heads" argument is changed to a list. Should we have to rename the C function
as its signature is changed?
Augie Fackler <augie@google.com> [Tue, 18 Aug 2015 16:40:10 -0400] rev 26052
parsers: set exception when there's too little string data to extract parents
Previously we were returning NULL from this function without actually
setting up an exception. This fixes that problem, which was detected
with cpychecker.
Augie Fackler <augie@google.com> [Tue, 18 Aug 2015 16:39:26 -0400] rev 26051
parsers: drop spurious check of readlen value
We're about to check if len < 40 after assigning readlen to len, which
means that if len < 40 we'll still abort, but I'm about to add a
sensible exception to that failure, so let's just discard this useless
check.
Augie Fackler <augie@google.com> [Tue, 18 Aug 2015 16:32:41 -0400] rev 26050
pathencode: check result of .digest() method in sha1hash
Without this it was theoretically possible .digest() would fail and
return NULL but we wouldn't notice. Detected with cpychecker.
Augie Fackler <augie@google.com> [Tue, 18 Aug 2015 16:43:26 -0400] rev 26049
parsers: correctly decref normed value after PyDict_SetItem
Previously we were leaving this PyObject* with a refcount that was one
too high. Detected with cpychecker.
Augie Fackler <augie@google.com> [Tue, 18 Aug 2015 17:15:04 -0400] rev 26048
parsers: fix two leaks in index_ancestors
Both happy paths through this function leaked the returned list:
1) If the list was of size 0 or 1, it was retained an extra time and then
returned.
2) If the list was passed to find_deepest, it was never released before
exiting this function.
Both paths spotted by cpychecker.
Matt Mackall <mpm@selenic.com> [Tue, 18 Aug 2015 18:38:56 -0500] rev 26047
merge with stable
Matt Mackall <mpm@selenic.com> [Tue, 18 Aug 2015 18:37:50 -0500] rev 26046
merge with i18n
Wagner Bruna <wbruna@softwareexpress.com.br> [Thu, 13 Aug 2015 16:50:05 -0300] rev 26045
i18n-pt_BR: synchronized with d14590f90cb6
Yuya Nishihara <yuya@tcha.org> [Fri, 14 Aug 2015 15:30:52 +0900] rev 26044
reachableroots: extend "revstates" to array of bit flags
Yuya Nishihara <yuya@tcha.org> [Fri, 14 Aug 2015 15:23:42 +0900] rev 26043
reachableroots: rename "seen" array to "revstates" for future extension
It will be an array of bit flags, SEEN | ROOT | REACHABLE.
Yuya Nishihara <yuya@tcha.org> [Sat, 15 Aug 2015 18:29:58 +0900] rev 26042
reachableroots: give anonymous name to short-lived "numheads" variable
I'll reuse it for the length of the roots list.
Yuya Nishihara <yuya@tcha.org> [Sat, 15 Aug 2015 18:03:47 +0900] rev 26041
reachableroots: reduce nesting level by jumping to next iteration by continue
This can eliminate lines over 80 columns. No code change except for the
outermost "if" condition.
Augie Fackler <augie@google.com> [Mon, 17 Aug 2015 19:03:58 -0400] rev 26040
test-convert-git: work around output format changes in git
git version 2.4.3:
--- /home/augie/hg/tests/test-convert-git.t
+++ /home/augie/hg/tests/test-convert-git.t.err
@@ -659,7 +659,7 @@
$ touch a && git add a && git commit -am "commit a"
[master (root-commit) 8ae5f69] commit a
Author: nottest <test@example.org>
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 a
$ cd ..
$ git clone git-repo7 git-repo7-client
git version 1.7.9.5:
--- /home/augie/hg/tests/test-convert-git.t
+++ /home/augie/hg/tests/test-convert-git.t.err
@@ -659,7 +659,7 @@
$ touch a && git add a && git commit -am "commit a"
[master (root-commit) 8ae5f69] commit a
Author: nottest <test@example.org>
- 1 file changed, 0 insertions(+), 0 deletions(-)
+ 0 files changed
create mode 100644 a
$ cd ..
$ git clone git-repo7 git-repo7-client
I don't know when this changed in git and am too lazy to try and
bisect it, so just work around the change.
Augie Fackler <augie@google.com> [Mon, 17 Aug 2015 22:56:12 -0400] rev 26039
histedit: correct spelling etc in more comments
Spotted during review of another patch.
Pierre-Yves David <pierre-yves.david@fb.com> [Fri, 31 Jul 2015 12:54:16 -0700] rev 26038
histedit: add a missing "s" in a comment
Durham Goode <durham@fb.com> [Fri, 14 Aug 2015 15:22:47 -0700] rev 26037
convert: fix convert dropping p2 contents during filemap merge
When converting a merge commit using a filemap convert (i.e. when moving
contents from the root of the repo into subdir1/), convert would silently drop
the entire contents of the target repo's p2. This was because when it built the
target commit, it did so by taking the target p1 and adding only the files that
changed in the source repo's merge commit.
This breaks in the case where the target repo has files that are unrelated to
the source repo (like in the case where you use convert to import a repo as a
subdirectory of another).
The fix is to use Mercurial's merge logic to detect which files in p2 we should
carry over to the merge. It follows three rules:
1) if the file belongs to the source, don't try to merge it. Rely on the list of
files provided to putcommit to be correct.
2) if the file requires merging or user input (change vs deleted), throw an
exception. We don't have enough info to do this.
3) if p2 has the newest, non-merge-requiring version of the file, take it
I've also added a test to cover this issue.
Durham Goode <durham@fb.com> [Sat, 15 Aug 2015 13:46:30 -0700] rev 26036
convert: implements targetfilebelongstosource for filemap source
This is an implementation of the new targetfilebelongstosource() function for
the filemapper. It simply checks if the given file name is prefixed by any of
the rename destinations.
It is not a perfect implementation since it doesn't account for the filemap
specifying includes or excludes, but that makes the problem much harder, and
this implementation should suffice for most cases.
Durham Goode <durham@fb.com> [Sat, 15 Aug 2015 13:44:55 -0700] rev 26035
convert: add function to test if file is from source
This adds a base implementation of a function that tests if a given file from a
target repo came from the source repo. This will be used later to detect which
files did not come from the source repo during a merge, so we can merge those
files correctly instead of dropping them.
Yuya Nishihara <yuya@tcha.org> [Sat, 15 Aug 2015 17:50:59 +0900] rev 26034
revsetbenchmarks: run make after update so that C extensions are built
Yuya Nishihara <yuya@tcha.org> [Fri, 14 Aug 2015 12:36:41 +0900] rev 26033
reachableroots: fix memleak of integer objects at includepath loop
In the first visit loop, val is decref-ed correctly after PySet_Add().
Let's do the same for the includepath loop.
Yuya Nishihara <yuya@tcha.org> [Fri, 14 Aug 2015 12:31:56 +0900] rev 26032
reachableroots: bail if integer object cannot be allocated
This patch also replaces Py_XDECREF() by Py_DECREF() because we known "val"
and "p" are not NULL.
BTW, we can eliminate some of these allocation and error handling of int objects
if the internal "seen" array has more information. For example,
enum { SEEN = 1, ROOT = 2, REACHABLE = 4 };
/* ... build ROOT mask from roots argument ... */
if (seen[revnum + 1] & ROOT) { /* instead of PySet_Contains(roots, val) */
>From my quick hack, it is 2x faster.
Laurent Charignon <lcharignon@fb.com> [Sat, 01 Aug 2015 05:43:39 -0700] rev 26031
devel-warn: issue a warning when writing bookmarks without holding the wlock
I saw an issue in an extension that we develop where we were writing bookmarks
without holding the wlock. Another extension was taking a lock at the same time
and wiped out the bookmarks we were about to write. This patch adds a
devel-warning to urge people to fix their invalid code.
Matt Mackall <mpm@selenic.com> [Thu, 13 Aug 2015 19:37:47 -0500] rev 26030
merge with stable
Pierre-Yves David <pierre-yves.david@fb.com> [Tue, 11 Aug 2015 16:45:11 -0700] rev 26029
rebase: lock the repo during the full rebase operation
Running `hg pull --rebase` would move bookmarks without any repository locking.
So we now lock the repository. For good measure and avoiding sneaky race
conditions, we lock the repository for the whole operation.
There is no code change besides the indentation.
Pierre-Yves David <pierre-yves.david@fb.com> [Tue, 11 Aug 2015 16:26:12 -0700] rev 26028
update: wlock the repo for the whole 'hg update' command
The update command is touching the repository and should lock it for
the length of its operations. Equally importantly, it should lock the
repository when it is writing bookmarks. It wasn't doing so until now,
leaving doors open for all kinds of drunk beaver parties.
This results in some minor tests changes, and the fixing of a couple
of bugs from race conditions.
Code does not receive any changes beside extra indentation.
Wagner Bruna <wbruna@softwareexpress.com.br> [Thu, 13 Aug 2015 11:09:36 -0300] rev 26027
help: fix typo in scripting documentation
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Thu, 13 Aug 2015 15:07:07 +0900] rev 26026
hg: avoid auto sharing when the clone destination is remote
Before this patch, when auto sharing is enabled, 'hg.clone()' tries to
create local clone regardless of locality of the clone destination on
the host, and causes failure.
To avoid auto sharing when the clone destination is remote, this patch
adds examination of 'islocal(dest)' before auto sharing in
'hg.clone()'.
'islocal(dest)' is examined after 'sharepool', because:
- the former is more expensive than the latter
- without enabling share extension, the later is always negative
Matt Harbison <matt_harbison@yahoo.com> [Wed, 12 Aug 2015 12:26:39 -0400] rev 26025
largefiles: ensure lfutil.getstandinmatcher() only matches standins
Previously, simply having the largefiles extension loaded without any largefiles
added would crash when amending with -I. The problem was with no files in the
matcher, the pattern list of files joined with 'standindir' was empty, and
scmutil.match() would match everything. In lfutil.composestandinmatcher(), the
match function is used to test if the file is a standin, and after getting a
false positive, proceeds to call lfutil.splitstandin(). This returns None
because it isn't a standin, which blows up when passed to rmatcher.matchfn().
Manually overriding _always in getstandinmatcher() probably isn't necessary
anymore, but we leave well enough alone on stable. This regressed in
ab618e52788a.
Durham Goode <durham@fb.com> [Wed, 12 Aug 2015 19:44:21 -0700] rev 26024
dirstate: add --minimal flag to debugrebuilddirstate
On repositories with hundreds of thousands of files, hg
debugrebuilddirstate causes every dirstate entry to be marked lookup,
and the next hg status can take many minutes.
This adds a --minimal flag that allows us to only rebuild the parts of the
dirstate that are inconsistent. This follows two rules:
1) If a file is in the dirstate but not in the parent manifest, and it is not
marked 'add', it is busted and we should drop it.
2) If a file is not in the dirstate at all, but it is in the parent
manifest, it should be added to the dirstate and we need to mark it as
lookup.
This allows us to fix repositories where the dirstate doesn't match
the manifest much more quickly.
Tested by artificially adding bad dirstate entries (via code) for both cases
above.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Thu, 13 Aug 2015 22:10:52 +0900] rev 26023
tests: make filterpyflakes.py read target files relatively to cwd
Before this patch, 'filterpyflakes.py' reads target files relatively
to own location.
But this prevents third party tools from using it in own source tree,
because their files are placed separately from 'filterpyflakes.py'.
In fact, 'test-check-pyflakes.t', which is the only user of
'filterpyflakes.py', changes current working directory (cwd) to the
root of "test target" source tree before using it. Therefore,
composing the root of source tree in 'filterpyflakes.py' is redundant.
This patch makes 'filterpyflakes.py' read target files relatively to
cwd by invoking 'open()' without any path composition. This also
removes importing 'os' module, because there is no user of it after
this patch.
This is a one of preparation of issue4677.
Anton Shestakov <av6@dwimlabs.net> [Tue, 11 Aug 2015 13:48:57 +0800] rev 26022
monoblue: remove duplicate font-family property from td.source
Anton Shestakov <av6@dwimlabs.net> [Tue, 11 Aug 2015 13:45:54 +0800] rev 26021
monoblue: remove unused elements and related css
Since 91b0ada2d94b and c9b88695d894, when monoblue was introduced, the code
this patch removes was untouched. Presumably, there supposed to be nice
graphics in the screen corners, but there never were due to:
- the css being commented out
- ids of the elements and of the css selectors being different
- and the png files absent
The "corner" elements were unstyled and didn't affect the rest of the page, so
I think it's safe to remove all this.
Yuya Nishihara <yuya@tcha.org> [Thu, 13 Aug 2015 16:15:43 +0900] rev 26020
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
The odd-range hack was introduced by 2a0efa1112ac for backward compatibility,
but it was too widely applied. I've checked cmdutil.revpair() at 1.6, and
found that ".:", ":0" and ":" are also handled as pairs. So let's enable the
hack only for "x:y", "x:", "y:" and ":".
test-revset.t is updated because "tip^::tip^ or tip^" shouldn't be taken as
an odd range. This patch adds "tip^:tip^" instead.
This patch is written for the default branch because parse() of the stable
branch lacks compatibility hack for "foo+bar" tag. If we want to mitigate the
issue in stable, we can add something like "and '::' in revs[0]".
Yuya Nishihara <yuya@tcha.org> [Thu, 13 Aug 2015 16:27:32 +0900] rev 26019
revpair: update test to make a difference if odd range not handled specially
It was added at 2a0efa1112ac, but there was no difference between -r2 and -r2:2
because the working directory was clean.
Yuya Nishihara <yuya@tcha.org> [Thu, 13 Aug 2015 18:59:49 +0900] rev 26018
reachableroots: verify type of each item of heads argument
Though PyInt_AS_LONG() can return a value no matter if it isn't an int object,
it could exceed the boundary of the underlying struct. I think C API should be
defensive to such errors.
Yuya Nishihara <yuya@tcha.org> [Thu, 13 Aug 2015 18:38:46 +0900] rev 26017
reachableroots: verify integer range of heads argument (issue4775)
Now it raises IndexError instead of SEGV for 'wdir()' as it was before.
Yuya Nishihara <yuya@tcha.org> [Thu, 13 Aug 2015 18:29:38 +0900] rev 26016
reachableroots: unify bail cases to raise exception correctly
Before this patch, release_seen_and_tovisit did not return NULL, so the
exception was not raised immediately. As Py_XDECREF() and free() are safe
for NULL, we can simply bail in any case.
Yuya Nishihara <yuya@tcha.org> [Thu, 13 Aug 2015 17:58:33 +0900] rev 26015
reachableroots: pass NULL to PySet_New() as it expects a pointer, not an int
Matt Mackall <mpm@selenic.com> [Wed, 12 Aug 2015 17:01:50 -0500] rev 26014
merge with stable
Durham Goode <durham@fb.com> [Tue, 27 Jan 2015 11:26:27 -0800] rev 26013
copy: add flag for disabling copy tracing
Copy tracing can be up to 80% of rebase time when rebasing stacks of commits in
large repos (hundreds of thousands of files). This provides the option of
turning off the majority of copy tracing. It does not turn off _forwardcopies()
since that is used to carry copy information inside a commit across a rebase.
This will affect the situation where a user edits a file, then rebases on top of
commits that have moved that file. The move will not be detected and the user
will have to manually resolve the issue (possibly by redoing the rebase with
this flag off).
The reason to have a flag instead of trying to fix the actual copy tracing
performance is that copy tracing is fundamentally an O(number of files in the
repo) operation. In order to know if file X in the rebase source was copied
anywhere, we have to walk the filelog for every new file that exists in the
rebase destination (i.e. a file in the destination that is not in the common
ancestor). Without an index that lets us trace forward (i.e. from file Y in the
common ancestor forward to the rebase destination), it will never be an O(number
of changes in my branch) operation.
In mozilla-central, rebasing a 3 commit stack across 20,000 revs goes from 39s
to 11s.
Pierre-Yves David <pierre-yves.david@fb.com> [Sat, 08 Aug 2015 14:50:03 -0700] rev 26012
strip: use the 'finally: tr.release' pattern during stripping
The previous code, was calling 'abort' in all exception cases. This was wrong
when an exception was raised by post-close callback on the transaction. Calling
'abort' on an already closed transaction resulted in a error, shadowing the
original error.
We now use the same pattern as everywhere else. 'tr.release()' will abort the
transaction if we escape the scope without closing it. We add a test to make
sure we do not regress.
Augie Fackler <augie@google.com> [Tue, 11 Aug 2015 15:06:02 -0400] rev 26011
changelog: trust C implementation of reachableroots more
There are no remaining codepaths in reachableroots where it will
return None, so just trust it completely and simplify this method.
Result by revset
================
Revision:
0) Revision 1c75249e159b: style: adjust whitespaces in webutil.py
1) Revision d1d91b8090c6: changelog: trust C implementation of reachableroots more
revset #0: 0::tip
plain
0) 0.067684
1) 0.006622 9%
revset #1: 0::@
plain
0) 0.068249
1) 0.009394 13%
IOW this is a 10x speedup in my repo for hg itself for 0::tip and
similar revsets now that the C code is correctly wired up.
Augie Fackler <augie@google.com> [Tue, 11 Aug 2015 14:53:47 -0400] rev 26010
reachableroots: return NULL if we're throwing an exception
Based on my reading of [0] and surrounding sections, if we want an
exception to be properly raised when something goes wrong in the C
code, we need to make sure we return NULL here. Do so.
https://docs.python.org/2/extending/extending.html#back-to-the-example
Augie Fackler <augie@google.com> [Tue, 11 Aug 2015 15:34:10 -0400] rev 26009
reachableroots: fix transposition of set and list types in PyArg_ParseTuple
This is being masked by the function not properly returning NULL when
it raises an exception, so the client code was just falling back to
the native codepath when it got None back. A future change removes all
reason for this C function to return None, which exposed this problem
during development.
Augie Fackler <augie@google.com> [Tue, 11 Aug 2015 14:50:39 -0400] rev 26008
reachableroots: consistently use short-form of PyErr_NoMemory()
Augie Fackler <augie@google.com> [Tue, 11 Aug 2015 14:49:40 -0400] rev 26007
reachableroots: if allocating a new set fails, use PyErr_NoMemory()
My inspection of the implementation of PySet_New() indicates that it
does *not* reliably set an exception in the cases where it returns
NULL (as far as I can tell it'll never do that!), so let's set that up
ourselves.
Laurent Charignon <lcharignon@fb.com> [Thu, 06 Aug 2015 22:11:20 -0700] rev 26006
reachableroots: default to the C implementation
This patch is part of a series of patches to speed up the computation of
revset.reachableroots by introducing a C implementation. The main motivation is to
speed up smartlog on big repositories. At the end of the series, on our big
repositories the computation of reachableroots is 10-50x faster and smartlog on is
2x-5x faster.
Before this patch, reachableroots was computed in pure Python by default. This
patch makes the C implementation the default and provides a speedup for
reachableroots.
Laurent Charignon <lcharignon@fb.com> [Thu, 06 Aug 2015 22:10:31 -0700] rev 26005
changelog: add way to call the reachableroots C implementation
This patch is part of a series of patches to speed up the computation of
revset.reachableroots by introducing a C implementation. The main motivation is
to speed up smartlog on big repositories. At the end of the series, on our big
repositories the computation of reachableroots is 10-50x faster and smartlog on
is 2x-5x faster.
This patch allows us to call the new C implementation of reachableroots from
python by creating an entry point in the changelog class.
Laurent Charignon <lcharignon@fb.com> [Thu, 06 Aug 2015 21:28:45 -0700] rev 26004
reachableroots: add a C implementation
This patch is part of a series of patches to speed up the computation of
revset.reachableroots by introducing a C implementation. The main motivation is to
speed up smartlog on big repositories. At the end of the series, on our big
repositories the computation of reachableroots is 10-50x faster and smartlog on is
2x-5x faster.
This patch introduces a C implementation for reachableroots following closely the
Python implementation but optimized by using C data structures.
Laurent Charignon <lcharignon@fb.com> [Fri, 19 Jun 2015 20:28:52 -0700] rev 26003
revset: remove grandparent by using reachableroots
This patch is part of a series of patches to speed up the computation of
revset.reachableroots by introducing a C implementation. The main motivation
is to speed up smartlog on big repositories. At the end of the series, on our
big repositories the computation of reachableroots is 10-50x faster and
smartlog on is 2x-5x faster.
Before this patch, we had a custom computation for grandparent that was very
close to the idea of reacheablerooots. This patch expresses grandparent with
reachableroots to reduce the amount of code.
Laurent Charignon <lcharignon@fb.com> [Fri, 19 Jun 2015 20:18:54 -0700] rev 26002
revset: rename revsbetween to reachableroots and add an argument
This patch is part of a series of patches to speed up the computation of
revset.revsbetween by introducing a C implementation. The main motivation is to
speed up smartlog on big repositories. At the end of the series, on our big
repositories the computation of revsbetween is 10-50x faster and smartlog on is
2x-5x faster.
This patch rename 'revsbetween' to 'reachableroots' and makes the computation of
the full path optional. This will allow graphlog to compute grandparents using
'reachableroots' and remove the need for a dedicated grandparent function.
Laurent Charignon <lcharignon@fb.com> [Fri, 07 Aug 2015 02:13:42 -0700] rev 26001
revset: make revsbetween public
This patch is part of a series of patches to speed up the computation of
revset.revsbetween by introducing a C implementation. The main motivation is to
speed up smartlog on big repositories. At the end of the series, on our big
repositories the computation of revsbetween is 10-50x faster and smartlog on is
2x-5x faster.
Later in this serie, we want to reuse the implementation of revsbetween in the
changelog module, therefore, we make it public.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 06 Aug 2015 21:00:16 -0400] rev 26000
match: fix a caseonly rename + explicit path commit on icasefs (issue4768)
The problem was that the former name and the new name are both normalized to the
case in dirstate, so matcher._files would be ['ABC.txt', 'ABC.txt'].
localrepo.commit() calls localrepo.status(), passing along the matcher. Inside
dirstate.status(), _walkexplicit() simply grabs matcher.files() and processes
those items. Since the old name isn't present, it is silently dropped. There's
a fundamental tension here, because the status command should also accept files
that don't match the filesystem, so we can't drop the normalization in status.
The problem originated in baa11dde8c0e.
Unfortunately with this change, the case of the old file must still be specified
exactly, or the old file is again silently excluded. I went back to
baa11dde8c0e^, and that had the same behavior, so we are no worse off. I'm open
to ideas from a matcher or dirstate expert on how to fix that half.
Anton Shestakov <av6@dwimlabs.net> [Tue, 11 Aug 2015 13:19:42 +0800] rev 25999
style: adjust whitespaces in webutil.py
Turns out, all this came from the single d605a82cf189.
Matt Mackall <mpm@selenic.com> [Mon, 10 Aug 2015 15:30:28 -0500] rev 25998
merge with stable