Sat, 02 Dec 2017 06:32:41 +0530 tests: removes bashism from test-unamend.t
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 02 Dec 2017 06:32:41 +0530] rev 35206
tests: removes bashism from test-unamend.t FreeBSD builders fail because of bashism. Differential Revision: https://phab.mercurial-scm.org/D1578
Fri, 01 Dec 2017 12:28:05 -0800 run-tests: avoid calculating _testdir again
Martin von Zweigbergk <martinvonz@google.com> [Fri, 01 Dec 2017 12:28:05 -0800] rev 35205
run-tests: avoid calculating _testdir again Differential Revision: https://phab.mercurial-scm.org/D1574
Fri, 01 Dec 2017 12:27:28 -0800 run-tests: simplify by using dict.pop() with default
Martin von Zweigbergk <martinvonz@google.com> [Fri, 01 Dec 2017 12:27:28 -0800] rev 35204
run-tests: simplify by using dict.pop() with default Differential Revision: https://phab.mercurial-scm.org/D1573
Mon, 20 Nov 2017 23:23:10 -0800 py3: use byteskwargs in sparse.py
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 20 Nov 2017 23:23:10 -0800] rev 35203
py3: use byteskwargs in sparse.py This removes several dozen failures in Python 3. Differential Revision: https://phab.mercurial-scm.org/D1482
Mon, 20 Nov 2017 23:13:09 -0800 py3: define __next__ in patch.py
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 20 Nov 2017 23:13:09 -0800] rev 35202
py3: define __next__ in patch.py This needed to appease Python 3's iterator protocol. This is crasher #5 in Python 3. Differential Revision: https://phab.mercurial-scm.org/D1480
Mon, 20 Nov 2017 23:02:32 -0800 run-tests: mechanism to report exceptions during test execution
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 20 Nov 2017 23:02:32 -0800] rev 35201
run-tests: mechanism to report exceptions during test execution Sometimes when running tests you introduce a ton of exceptions. The most extreme example of this is running Mercurial with Python 3, which currently spews thousands of exceptions when running the test harness. This commit adds an opt-in feature to run-tests.py to aggregate exceptions encountered by `hg` when running tests. When --exceptions is used, the test harness enables the "logexceptions" extension in the test environment. This extension wraps the Mercurial function to handle exceptions and writes information about the exception to a random filename in a directory defined by the test harness via an environment variable. At the end of the test harness, these files are parsed, aggregated, and a list of all unique Mercurial frames triggering exceptions is printed in order of frequency. This feature is intended to aid Python 3 development. I've only really tested it on Python 3. There is no shortage of improvements that could be made. e.g. we could write a separate file containing the exception report - maybe even an HTML report. We also don't capture which tests demonstrate the exceptions, so there's no turnkey way to test whether a code change made an exception disappear. Perfect is the enemy of good. I think the current patch is useful enough to land. Whoever uses it can send patches to imprve its usefulness. Differential Revision: https://phab.mercurial-scm.org/D1477
Mon, 20 Nov 2017 21:26:11 -0800 run-tests: make --extra-config-opt work with Python 3
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 20 Nov 2017 21:26:11 -0800] rev 35200
run-tests: make --extra-config-opt work with Python 3 And add test coverage to ensure it works. Differential Revision: https://phab.mercurial-scm.org/D1476
Mon, 20 Nov 2017 21:08:18 -0800 run-tests: organize options into argument groups
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 20 Nov 2017 21:08:18 -0800] rev 35199
run-tests: organize options into argument groups And sort arguments so help output is more legible. There are probably a ton of ways to group things. I tried to picture the test harness as a pipeline and attempted to draw boundaries around stages in that pipeline to create the groupings. Differential Revision: https://phab.mercurial-scm.org/D1475
Mon, 20 Nov 2017 20:41:43 -0800 run-tests: convert to argparse
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 20 Nov 2017 20:41:43 -0800] rev 35198
run-tests: convert to argparse optparse has been deprecated since Python 3.2. Best to get on the new boat before the old one sinks. It looks like argparse formats its usage string differently than optparse. Meh. Differential Revision: https://phab.mercurial-scm.org/D1474
Fri, 01 Dec 2017 15:21:05 -0600 merge with stable
Kevin Bullock <kbullock+mercurial@ringworld.org> [Fri, 01 Dec 2017 15:21:05 -0600] rev 35197
merge with stable
Thu, 16 Nov 2017 03:52:42 +0100 server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net> [Thu, 16 Nov 2017 03:52:42 +0100] rev 35196
server: introduce a 'experimental.single-head-per-branch' option When the option is set, the repository will reject any transaction adding multiple heads to the same named branch. For now we reject all scenario with multiple heads. One could imagine handling closed branches differently. We prefer to keep things simple for now. The feature might get extended later. Branch closing is not the best experience Mercurial has to offer anyway.
Thu, 16 Nov 2017 03:52:38 +0100 scmutil: extra utility to display a reasonable amount of nodes
Boris Feld <boris.feld@octobus.net> [Thu, 16 Nov 2017 03:52:38 +0100] rev 35195
scmutil: extra utility to display a reasonable amount of nodes Push have some logic to display a reasonable amount nodes. We extract it to an utility function to make it reusable.
Fri, 06 Oct 2017 04:17:36 +0530 uncommit: unify functions _uncommitdirstate and _unamenddirstate to one
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 06 Oct 2017 04:17:36 +0530] rev 35194
uncommit: unify functions _uncommitdirstate and _unamenddirstate to one The _unamenddirstate() function was inspired by _uncommitdirstate() function as the logic was same but we were unable to use the latter function directly. So previous patch introduced the _unamenddirstate() function and now this patch unifies both the function and we have a _fixdirstate() function. Adding function in previous patch and unifying in a later patch makes the reasoning easier and also leaves the last patch dedicated to what it is meant to be. Differential Revision: https://phab.mercurial-scm.org/D971
Sun, 24 Sep 2017 00:56:52 +0530 unamend: move fb extension unamend to core
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 24 Sep 2017 00:56:52 +0530] rev 35193
unamend: move fb extension unamend to core unamend extension adds an unamend command which undoes the effect of the amend command. This patch moves the unamend command from that extension to uncommit extension and this one does not completely undoes the effect of amend command as it creates a new commit, rather than reviving the old one back. This also adds tests for the same. .. feature:: A new unamend command in uncommit extension which undoes the effect of the amend command by creating a new changeset which was there before amend and moving the changes that were amended to the working directory. Differential Revision: https://phab.mercurial-scm.org/D821
Tue, 28 Nov 2017 13:27:43 -0500 color: respect HGPLAINEXCEPT=color to allow colors while scripting (issue5749)
Augie Fackler <augie@google.com> [Tue, 28 Nov 2017 13:27:43 -0500] rev 35192
color: respect HGPLAINEXCEPT=color to allow colors while scripting (issue5749) I'd also like --color=always on the command-line to override HGPLAIN=1 et al, but that's more work, and this seems like a better fix. We've got a fair number of programs that actually want to automate hg and get colored output to users, so they should set HGPLAINEXCEPT=alias (what we usually recommend), but this has been breaking them because they then lose color. .. feature:: The ``HGPLAINEXCEPT`` environment variable can now include ``color`` to allow automatic output colorization in otherwise automated environments. Differential Revision: https://phab.mercurial-scm.org/D1532
Sun, 26 Nov 2017 11:22:27 +0900 test-ssh: do not actually look up "brokenrepository" by DNS
Yuya Nishihara <yuya@tcha.org> [Sun, 26 Nov 2017 11:22:27 +0900] rev 35191
test-ssh: do not actually look up "brokenrepository" by DNS
Thu, 23 Nov 2017 01:21:10 -0500 largefiles: explicitly set the source and sink types to 'hg' for lfconvert
Matt Harbison <matt_harbison@yahoo.com> [Thu, 23 Nov 2017 01:21:10 -0500] rev 35190
largefiles: explicitly set the source and sink types to 'hg' for lfconvert I stumbled into this prior to adding the type indicator on the source and sink, but there's no reason to try to infer the types for this conversion.
Wed, 22 Nov 2017 22:38:50 -0500 lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com> [Wed, 22 Nov 2017 22:38:50 -0500] rev 35189
lfs: add a repo requirement for this extension when converting to lfs This covers both the vanilla repo -> lfs repo and largefiles -> lfs conversions. The largefiles extension adds the requirement directly, because it has a dedicated command to convert. Using the convert extension is better, because it supports more features. I'd like ideas about how to ensure that converting away from lfs works on all files. (See comments in test-lfs.t)
Sun, 26 Nov 2017 14:59:39 -0500 convert: allow the sink object to be wrapped when the extension isn't loaded
Matt Harbison <matt_harbison@yahoo.com> [Sun, 26 Nov 2017 14:59:39 -0500] rev 35188
convert: allow the sink object to be wrapped when the extension isn't loaded The next patch will wrap the conversion code, in order to write out a requirement for 'lfs' when appropriate. Wrapping convcmd.convertsink() in an afterloaded callback works fine when the convert extension is enabled by the user. The problem here is that lfconvert uses the convert extension, whether or not it was formally enabled by the user. My first attempt was to have lfs install an afterloaded callback that would wrap the convert sink if convert was loaded, or wrap lfconvert if it wasn't. Then the lfconvert override could install an afterloaded callback to try wrapping the convert sink again, before calling the original lfconvert. But that breaks down if largefiles can't load the convert extension on the fly. [1] Further, some tests were failing with an error indicating that the size of the afterloaded list changed while iterating it. Yuya mentioned that maybe some bits of convert could be moved into core, but I'm not sure where to draw that line. The convertsink() method depends on the list of sinks, which in turn depends on the sink classes. [1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-November/108038.html
Wed, 22 Nov 2017 20:49:01 -0500 convert: save an indicator of the repo type for sources and sinks
Matt Harbison <matt_harbison@yahoo.com> [Wed, 22 Nov 2017 20:49:01 -0500] rev 35187
convert: save an indicator of the repo type for sources and sinks This seems like basic info to have, and will be used shortly when deciding whether or not to wrap the class for lfs conversions. The other option is to just add a function to each class. But this seems better in that the strings aren't duplicated, and the constructor for most of these will run even if the VCS isn't installed, so it's easier to catch errors.
Wed, 15 Nov 2017 23:43:15 -0500 lfs: add a repo requirement for this extension once an lfs file is committed
Matt Harbison <matt_harbison@yahoo.com> [Wed, 15 Nov 2017 23:43:15 -0500] rev 35186
lfs: add a repo requirement for this extension once an lfs file is committed Largefiles does the same thing (also delayed until the first largefile commit), to prevent access to the repo without the extension. In the case of this extension, not having the extension loaded while accessing an lfs file results in cryptic errors about "missing processor for flag '0x2000'". If enabled locally but not remotely, the cryptic error message is about no common changegroup version. (It wants '03', which is currently experimental.) The largefiles extension looks for any tracked file that starts with '.hglf/'. Unfortunately, that doesn't work here. I didn't see any way to get the files that were just committed, without doing a full status. But since there's no secondary check on adding an lfs file once the extension is loaded and a threshold set, the best practice is to only enable this locally on a repo that needs it. That should minimize the unnecessary overhead for repos without an lfs file.
Thu, 30 Nov 2017 22:32:13 +0900 match: remove doc about undefined behavior of visitdir()
Yuya Nishihara <yuya@tcha.org> [Thu, 30 Nov 2017 22:32:13 +0900] rev 35185
match: remove doc about undefined behavior of visitdir() This was added by 8545bd381504, but core matchers support visitdir() of arbitrary locations since 2773540c3650, and verifier._verifymanifest() doesn't seem to strictly obey the restriction. I have no idea how important this API contract is for third-party extensions. That's why this patch is RFC.
Thu, 30 Nov 2017 15:48:42 -0500 merge with stable
Augie Fackler <augie@google.com> [Thu, 30 Nov 2017 15:48:42 -0500] rev 35184
merge with stable
Wed, 22 Nov 2017 22:18:06 +0800 hgweb: add .jshintrc with some basic rules
Anton Shestakov <av6@dwimlabs.net> [Wed, 22 Nov 2017 22:18:06 +0800] rev 35183
hgweb: add .jshintrc with some basic rules This file is picked up automatically by jshint, so no extra changes required in test-check-jshint.t.
Wed, 22 Nov 2017 22:11:37 +0800 hgweb: look up "URLSearchParams" in "window" to work around jshint issues
Anton Shestakov <av6@dwimlabs.net> [Wed, 22 Nov 2017 22:11:37 +0800] rev 35182
hgweb: look up "URLSearchParams" in "window" to work around jshint issues Unfortunately, current version of jshint (2.9.5) doesn't know such a global variable and complains that it's undefined. Since this line tries to look up URLSearchParams in a global scope (i.e. window), let's simply preface it with "window." to work around jshint.
Wed, 22 Nov 2017 21:49:36 +0800 hgweb: define locally used variables as actually local in mercurial.js
Anton Shestakov <av6@dwimlabs.net> [Wed, 22 Nov 2017 21:49:36 +0800] rev 35181
hgweb: define locally used variables as actually local in mercurial.js Variables that are used or assigned without any declaration using var (or let, or const) are considered global. In many cases this is inadvertent and actually causes a variable leaking to a broader scope, such as a temporary variable used inside a loop suddenly being accessible in global scope. (This corresponds to "undef" option of jshint). So this patch limits the scope of variables that don't need to be global. There are a lot of helper variables in Graph.render() used in a loop, I've declared them all on one line to reduce patch size. "radius" is special because it wasn't passed to graph.vertex, but was used there (it worked because this variable leaked to global scope). "window.graph" is created by an inline script in graph.tmpl so that it can be used in ajaxScrollInit() function, this patch makes this fact explicit by assigning window.graph to a local variable.
Wed, 22 Nov 2017 21:32:18 +0800 hgweb: rename an instance of XMLHttpRequest to xhr in mercurial.js
Anton Shestakov <av6@dwimlabs.net> [Wed, 22 Nov 2017 21:32:18 +0800] rev 35180
hgweb: rename an instance of XMLHttpRequest to xhr in mercurial.js "xhr" is a really widespread name for this kind of things, no idea where did "xfr" come from (the original 2228bd109706 doesn't explain that). Let's just change one letter so the name makes more sense.
Wed, 22 Nov 2017 21:15:44 +0800 hgweb: properly iterate over arrays and objects in mercurial.js
Anton Shestakov <av6@dwimlabs.net> [Wed, 22 Nov 2017 21:15:44 +0800] rev 35179
hgweb: properly iterate over arrays and objects in mercurial.js In JavaScript, using for-in loops to access every property of an object can have unexpected results when inheritance is involved. For example, if some piece of code adds a property (it may be a method too) to Object.prototype, then all for-in loops that iterate over keys of any object (also anything that inherits Object) will get that property on one of the iterations. To filter out such unexpected properties for-in loops have to use Object.hasOwnProperty() method. (This corresponds to "forin" option of jshint). In the two first cases "data" and "edges" are arrays, to it's simpler to just switch to using a regular for-with-a-counter loop.
Wed, 22 Nov 2017 20:52:59 +0800 hgweb: use strict equals in mercurial.js
Anton Shestakov <av6@dwimlabs.net> [Wed, 22 Nov 2017 20:52:59 +0800] rev 35178
hgweb: use strict equals in mercurial.js This patch changes "==" (equals operator) to "===" (strict equals operator). The difference between them is that the latter doesn't do any type coercions. It's handy to compare string '1' to number 1 sometimes, but most of the time using "==" is inadvertent and can be replaced by an explicit type conversion. (This corresponds to "eqeqeq" option of jshint). Some of the changes in this patch are straightforward, e.g. when comparing results of typeof (they could only be strings). The same goes for 'none' and similar strings that can't be sensibly coerced to some other type. Two changes that compare values to "1" and "0" can be clarified: getAttribute() returns either a string or null, but comparing null to a string is always false, so no logic is lost.
Wed, 22 Nov 2017 20:32:07 +0800 hgweb: use strict equals, remove non-breaking space in followlines.js
Anton Shestakov <av6@dwimlabs.net> [Wed, 22 Nov 2017 20:32:07 +0800] rev 35177
hgweb: use strict equals, remove non-breaking space in followlines.js The first hunk had a non-breaking space character just before "{", it's not an error or anything, but let's fix it while we're at it. (This corresponds to "nonbsp" option of jshint). Hunks 2 and 3 change "==" (equals operator) to "===" (strict equals operator). The difference between them is that the latter doesn't do any type coercions. It's handy to compare string '1' to number 1 sometimes, but most of the time using "==" is inadvertent and can be replaced by an explicit type conversion. (This corresponds to "eqeqeq" option of jshint). Most of this file already uses strict equals operator, and in the code affected type coercion is not needed, because tagName and selectableTag are both strings and endId and startId are both numbers.
Wed, 29 Nov 2017 10:34:49 -0800 run-tests: make "| foo (re)" not match everything
Martin von Zweigbergk <martinvonz@google.com> [Wed, 29 Nov 2017 10:34:49 -0800] rev 35176
run-tests: make "| foo (re)" not match everything We make "foo (re)" match the entire line by adding a \Z to the regular expression before matching. However, that doesn't help when the regular expression is something like "| foo", because that gets translated to "| foo\Z", where the "|" has lower precedence and it thus matches the empty string, which is of course a prefix of every string. Fix by wrapping expression in a group before adding the \Z to the end. Differential Revision: https://phab.mercurial-scm.org/D1546
Wed, 29 Nov 2017 10:58:32 -0800 tests: fix regex in test-subrepo-git.t to match entire string
Martin von Zweigbergk <martinvonz@google.com> [Wed, 29 Nov 2017 10:58:32 -0800] rev 35175
tests: fix regex in test-subrepo-git.t to match entire string Due to a bug in the test runner (fixed by the next commit), the regex used for matching lines like " foobar | 2 +-" stoppped at the "|" and the test passed even though the rest of the line did not match. The test seems to have been supposed to match "|" and "+" literally on those lines, so this changes the regex to escape those characters. It also changes a "\s*" to "\s+" since I think we'll always include a space after the "|" in the diffstat output. Differential Revision: https://phab.mercurial-scm.org/D1545
Wed, 29 Nov 2017 17:06:45 -0500 contrib: improve check-code ban on $LOCALIP in output without (glob)
Augie Fackler <augie@google.com> [Wed, 29 Nov 2017 17:06:45 -0500] rev 35174
contrib: improve check-code ban on $LOCALIP in output without (glob) Differential Revision: https://phab.mercurial-scm.org/D1553
Wed, 29 Nov 2017 17:05:51 -0500 tests: re-add (glob) for $LOCALIP matches
Augie Fackler <augie@google.com> [Wed, 29 Nov 2017 17:05:51 -0500] rev 35173
tests: re-add (glob) for $LOCALIP matches This should fix most of the failing tests on the FreeBSD builder, since it has no 127/8 series IP as a side effect of being trapped in a jail. Differential Revision: https://phab.mercurial-scm.org/D1552
Wed, 29 Nov 2017 08:44:06 +0530 py3: make sure the first argument of time.strftime() is str
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 29 Nov 2017 08:44:06 +0530] rev 35172
py3: make sure the first argument of time.strftime() is str time.strftime() does not accepts bytes as its first argument on py3. Differential Revision: https://phab.mercurial-scm.org/D1559
Wed, 29 Nov 2017 08:46:37 +0530 py3: alias xrange to range in tests/seq.py
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 29 Nov 2017 08:46:37 +0530] rev 35171
py3: alias xrange to range in tests/seq.py Differential Revision: https://phab.mercurial-scm.org/D1560
Wed, 29 Nov 2017 08:40:58 +0530 py3: use pycompat.maplist() instead of map()
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 29 Nov 2017 08:40:58 +0530] rev 35170
py3: use pycompat.maplist() instead of map() Differential Revision: https://phab.mercurial-scm.org/D1558
Thu, 30 Nov 2017 16:30:43 +0800 tests: move JSON escape test to test-hgweb-json.t
Anton Shestakov <av6@dwimlabs.net> [Thu, 30 Nov 2017 16:30:43 +0800] rev 35169
tests: move JSON escape test to test-hgweb-json.t The original tests (kanji and null) in test-hgweb-commands.t come from aff419e260f9 and 823a7d79ef82, but they check json escape filter by using JavaScript variable on /graph page, which is awkward, and I'm planning to remove commit description from this variable soon. Let's move the parts that check json template filter to a more appropriate file and use normal json-* templates.
Wed, 29 Nov 2017 07:57:17 +0530 py3: fix handling of keyword arguments in revert
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 29 Nov 2017 07:57:17 +0530] rev 35168
py3: fix handling of keyword arguments in revert Differential Revision: https://phab.mercurial-scm.org/D1554
Tue, 28 Nov 2017 11:00:54 -0500 fsmonitor: issue debug messages when we fall back to core status
Boris Feld <boris.feld@octobus.net> [Tue, 28 Nov 2017 11:00:54 -0500] rev 35167
fsmonitor: issue debug messages when we fall back to core status Having more information about when and why fsmonitor bails out help when looking into status performance.
Wed, 29 Nov 2017 04:47:27 +0530 py3: add b'' to regular expressions which are raw strings
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 29 Nov 2017 04:47:27 +0530] rev 35166
py3: add b'' to regular expressions which are raw strings Differential Revision: https://phab.mercurial-scm.org/D1538
Wed, 29 Nov 2017 04:41:19 +0530 py3: use '%d' for integers rather than '%s'
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 29 Nov 2017 04:41:19 +0530] rev 35165
py3: use '%d' for integers rather than '%s' obsolete._readmarkers() returns an integer version number. Differential Revision: https://phab.mercurial-scm.org/D1537
Wed, 29 Nov 2017 04:41:48 +0530 py3: fix args handling for obsfate template
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 29 Nov 2017 04:41:48 +0530] rev 35164
py3: fix args handling for obsfate template Differential Revision: https://phab.mercurial-scm.org/D1536
Wed, 29 Nov 2017 06:48:52 +0530 py3: remove test-terse-status.t from python3 whitelist as it was renamed
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 29 Nov 2017 06:48:52 +0530] rev 35163
py3: remove test-terse-status.t from python3 whitelist as it was renamed The renamed file exists in the whitelist. Differential Revision: https://phab.mercurial-scm.org/D1540
Tue, 21 Nov 2017 00:24:09 -0500 test-lfs: allow the test server to be killed on Windows
Matt Harbison <matt_harbison@yahoo.com> [Tue, 21 Nov 2017 00:24:09 -0500] rev 35162
test-lfs: allow the test server to be killed on Windows Apparently '$!' doesn't return a Win32 PID, so the process was never killed, and the next run was screwed up. Oddly, without the explicit killdaemons.py at the end, the test seems to hang. This spawning is just sad, so I limited it to Windows.
Tue, 14 Nov 2017 22:53:52 -0500 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com> [Tue, 14 Nov 2017 22:53:52 -0500] rev 35161
test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Tue, 14 Nov 2017 22:35:42 -0500 hghave: add a check for lfs-test-server
Matt Harbison <matt_harbison@yahoo.com> [Tue, 14 Nov 2017 22:35:42 -0500] rev 35160
hghave: add a check for lfs-test-server This is consistent with how the other tests require a feature.
Tue, 21 Nov 2017 20:28:57 +0800 hgweb: show changeset age in more places (gitweb and monoblue)
Anton Shestakov <av6@dwimlabs.net> [Tue, 21 Nov 2017 20:28:57 +0800] rev 35159
hgweb: show changeset age in more places (gitweb and monoblue) mercurial.js has a process_dates() function that calculates relative age for a given date, it works for all elements with "age" css class. If those elements also have "date" css class, the original text is preserved and age is added at the end. This patch adds these two css classes in some pages in gitweb and monoblue that weren't already using this feature.
Sun, 19 Nov 2017 05:34:50 +0100 obsolete: drop usage of changectx in '_computecontentdivergentset'
Boris Feld <boris.feld@octobus.net> [Sun, 19 Nov 2017 05:34:50 +0100] rev 35158
obsolete: drop usage of changectx in '_computecontentdivergentset' Changectx are expensive and not needed there. The use of `repo.set` denote old code that predate the introduction of `repo.revs` that we now use. On my mercurial repository 495 draft: before: 0.054239 second after: 0.046935 second On a mercurial repository with 115973 draft: before: 0.564548 second after: 0.130534 second
Sun, 19 Nov 2017 05:23:12 +0100 obsolete: drop usage of changectx in '_computephasedivergentset'
Boris Feld <boris.feld@octobus.net> [Sun, 19 Nov 2017 05:23:12 +0100] rev 35157
obsolete: drop usage of changectx in '_computephasedivergentset' Changectx are expensive and not needed there. The use of `repo.set` denote old code that predate the introduction of `repo.revs` that we now use. On my mercurial repository 495 draft: before: 0.010275 second after: 0.008832 second On a mercurial repository with 115973 draft: before: 0.899255 second after: 0.397131 second
Sat, 25 Nov 2017 16:01:27 +0800 hgweb: remove unused Graph() properties
Anton Shestakov <av6@dwimlabs.net> [Sat, 25 Nov 2017 16:01:27 +0800] rev 35156
hgweb: remove unused Graph() properties Both of these were introduced in 0dba955c2636, but were already unused.
Sat, 25 Nov 2017 15:42:24 +0800 gitweb: remove unused css classes
Anton Shestakov <av6@dwimlabs.net> [Sat, 25 Nov 2017 15:42:24 +0800] rev 35155
gitweb: remove unused css classes Looks like they were unused since the very introduction of gitweb theme in 385b8872b8e3.
Sat, 25 Nov 2017 15:23:07 +0800 monoblue: also highlight target line on annotate and comparison pages
Anton Shestakov <av6@dwimlabs.net> [Sat, 25 Nov 2017 15:23:07 +0800] rev 35154
monoblue: also highlight target line on annotate and comparison pages Clicking on a line link on pages that show any kind of file contents (including diffs) should highlight that line, and in monoblue it works when there's a <pre> element (e.g. diff), but pages that use <table> element (annotate and compare) need this css class. It matches and highlights linked (":target") table rows. This line is pretty much copied from gitweb theme.
Sat, 25 Nov 2017 15:01:47 +0800 paper: remove css hack that made .branchname look like .branchhead
Anton Shestakov <av6@dwimlabs.net> [Sat, 25 Nov 2017 15:01:47 +0800] rev 35153
paper: remove css hack that made .branchname look like .branchhead There's a visual difference in hgweb between one changeset that is the tip of its branch and another that simply belongs to that branch. But paper theme ignored this difference on changeset page and used to always use "branchname" css class, be that changeset the tip of its branch or not. That has been recently fixed, so this piece of css is not needed anymore.
Sun, 26 Nov 2017 13:29:18 +0800 hgweb: rename the main attribute of instabilities
Anton Shestakov <av6@dwimlabs.net> [Sun, 26 Nov 2017 13:29:18 +0800] rev 35152
hgweb: rename the main attribute of instabilities Let's make "instabilities" list contain items with "instability" key as opposed to "name" key. This way it's more explicit and more consistent with the log command-line template.
Thu, 23 Nov 2017 14:13:14 -0800 hbisect: use a defaultdict to avoid large allocations for a large changelogs
David Soria Parra <davidsp@fb.com> [Thu, 23 Nov 2017 14:13:14 -0800] rev 35151
hbisect: use a defaultdict to avoid large allocations for a large changelogs We can avoid a SPACE(len(changelog)) allocation by using a defaultdict. Test Plan: python run-tests.py test-bisect* Differential Revision: https://phab.mercurial-scm.org/D1499
Thu, 23 Nov 2017 14:12:55 -0800 hbisect: use a revset for ancestor calculation
David Soria Parra <davidsp@fb.com> [Thu, 23 Nov 2017 14:12:55 -0800] rev 35150
hbisect: use a revset for ancestor calculation Since we have revsets we can be more concise in doing the ancestor calulcation. Significant commits are all descendent of the topmost good commits. Test Plan: python run-tests.py test-bisect* Differential Revision: https://phab.mercurial-scm.org/D1498
Thu, 23 Nov 2017 14:11:27 -0800 hbisect: pass repo into hbisect.bisect
David Soria Parra <davidsp@fb.com> [Thu, 23 Nov 2017 14:11:27 -0800] rev 35149
hbisect: pass repo into hbisect.bisect Pass repo into the bisect function to get more flexibility in what we can call. This will allow us to use revsets to rewrite parts of the ancestor and children calculation in later patches. Test Plan: python run-tests.py test-bisect* Differential Revision: https://phab.mercurial-scm.org/D1497
Wed, 22 Nov 2017 19:24:22 -0800 develwarn: do not emit warning if "config" is unspecified
Kyle Lippincott <spectral@google.com> [Wed, 22 Nov 2017 19:24:22 -0800] rev 35148
develwarn: do not emit warning if "config" is unspecified Previously, if the develwarn call site did not specify the category of warning, and devel.all-warnings was False, it would emit the warning. If it was intended that this emit a warning if config is unspecified, I would have expected a comment, so I assumed this was unintentional and am changing the behavior. Differential Revision: https://phab.mercurial-scm.org/D1494
Sat, 28 Oct 2017 19:03:23 +0530 histedit: add support to output nodechanges using formatter
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 28 Oct 2017 19:03:23 +0530] rev 35147
histedit: add support to output nodechanges using formatter The JSON output of nodechanges will help in automation and to improve editor integrations such as for Nuclide. Differential Revision: https://phab.mercurial-scm.org/D1348
Sat, 28 Oct 2017 17:50:25 +0530 rebase: use fm.formatlist() and fm.formatdict() to support user template
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 28 Oct 2017 17:50:25 +0530] rev 35146
rebase: use fm.formatlist() and fm.formatdict() to support user template Thanks to Yuya for suggesting this in D1173. Differential Revision: https://phab.mercurial-scm.org/D1293
Thu, 09 Nov 2017 20:06:30 +0530 tests: add test for rebase template showing wrong behavior
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 09 Nov 2017 20:06:30 +0530] rev 35145
tests: add test for rebase template showing wrong behavior The output for template "{nodechanges % '{key}:{value}'}" does not contain the output for value. Differential Revision: https://phab.mercurial-scm.org/D1462
Fri, 17 Nov 2017 22:52:40 +0000 remove: print message for each file in verbose mode only while using `-A` (BC)
pavanpc@fb.com [Fri, 17 Nov 2017 22:52:40 +0000] rev 35144
remove: print message for each file in verbose mode only while using `-A` (BC) hg rm -A option prints the message of every file in the repo. This is not very user friendly for a big repository with thousands of files. So enabling this feature only when run in --verbose mode (hg rm -Av) Differential Revision: https://phab.mercurial-scm.org/D1336
Fri, 03 Nov 2017 17:19:56 -0400 localrepo: update comments around path auditors
Augie Fackler <augie@google.com> [Fri, 03 Nov 2017 17:19:56 -0400] rev 35143
localrepo: update comments around path auditors
Fri, 03 Nov 2017 17:07:29 -0400 localrepo: specify optional callback parameter to pathauditor as a keyword
Augie Fackler <augie@google.com> [Fri, 03 Nov 2017 17:07:29 -0400] rev 35142
localrepo: specify optional callback parameter to pathauditor as a keyword
Mon, 13 Nov 2017 22:20:12 -0800 bundle2: avoid unbound read when seeking
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 13 Nov 2017 22:20:12 -0800] rev 35141
bundle2: avoid unbound read when seeking Currently, seekableunbundlepart.seek() will perform a read() during seek operations. This will allocate a buffer to hold the raw data over the seek distance. This can lead to very large allocations and cause performance to suffer. We change the code to perform read(32768) in a loop to avoid potentially large allocations. `hg perfbundleread` on an uncompressed Firefox bundle reveals a performance impact: ! bundle2 iterparts() ! wall 2.992605 comb 2.990000 user 2.260000 sys 0.730000 (best of 4) ! bundle2 iterparts() seekable ! wall 3.863810 comb 3.860000 user 3.000000 sys 0.860000 (best of 3) ! bundle2 part seek() ! wall 6.213387 comb 6.200000 user 3.350000 sys 2.850000 (best of 3) ! wall 3.820347 comb 3.810000 user 2.980000 sys 0.830000 (best of 3) Since seekable bundle parts are (only) used by bundlerepo, this /may/ speed up initial loading of bundle-based repos. But any improvement will likely only be noticed on very large bundles. Differential Revision: https://phab.mercurial-scm.org/D1394
Mon, 13 Nov 2017 21:54:46 -0800 bundle2: inline struct operations
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 13 Nov 2017 21:54:46 -0800] rev 35140
bundle2: inline struct operations Before, we were calling struct.unpack() (via an alias) on every loop iteration. I'm not sure what Python does under the hood, but it would have to look at the struct format and determine what to do. This commit establishes a struct.Struct instance and reuses it for struct reading. We can see the impact from running `hg perfbundleread` on a Firefox bundle: ! read(8k) ! wall 0.679730 comb 0.680000 user 0.140000 sys 0.540000 (best of 15) ! read(16k) ! wall 0.577228 comb 0.570000 user 0.080000 sys 0.490000 (best of 17) ! read(32k) ! wall 0.516060 comb 0.520000 user 0.040000 sys 0.480000 (best of 20) ! read(128k) ! wall 0.496378 comb 0.490000 user 0.010000 sys 0.480000 (best of 20) ! bundle2 iterparts() ! wall 3.056811 comb 3.050000 user 2.340000 sys 0.710000 (best of 4) ! wall 2.992605 comb 2.990000 user 2.260000 sys 0.730000 (best of 4) ! bundle2 iterparts() seekable ! wall 4.007676 comb 4.000000 user 3.170000 sys 0.830000 (best of 3) ! wall 3.863810 comb 3.860000 user 3.000000 sys 0.860000 (best of 3) ! bundle2 part seek() ! wall 6.267110 comb 6.250000 user 3.480000 sys 2.770000 (best of 3) ! wall 6.213387 comb 6.200000 user 3.350000 sys 2.850000 (best of 3) ! bundle2 part read(8k) ! wall 3.404164 comb 3.400000 user 2.650000 sys 0.750000 (best of 3) ! wall 3.241099 comb 3.250000 user 2.560000 sys 0.690000 (best of 3) ! bundle2 part read(16k) ! wall 3.197972 comb 3.200000 user 2.490000 sys 0.710000 (best of 4) ! wall 3.003930 comb 3.000000 user 2.270000 sys 0.730000 (best of 4) ! bundle2 part read(32k) ! wall 3.060557 comb 3.060000 user 2.340000 sys 0.720000 (best of 4) ! wall 2.904695 comb 2.900000 user 2.160000 sys 0.740000 (best of 4) ! bundle2 part read(128k) ! wall 2.952209 comb 2.950000 user 2.230000 sys 0.720000 (best of 4) ! wall 2.776140 comb 2.780000 user 2.070000 sys 0.710000 (best of 4) Profiling now says most remaining time is spent in util.chunkbuffer. I already heavily optimized that data structure several releases ago. So we'll likely get little more performance out of bundle2 reading while still retaining util.chunkbuffer(). Differential Revision: https://phab.mercurial-scm.org/D1393
Mon, 13 Nov 2017 21:48:35 -0800 bundle2: inline changegroup.readexactly()
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 13 Nov 2017 21:48:35 -0800] rev 35139
bundle2: inline changegroup.readexactly() Profiling reveals this loop is pretty tight. Literally any function call elimination can make a big difference. This commit inlines the relatively trivial changegroup.readexactly() method inside the loop. The results with `hg perfbundleread` on a bundle of the Firefox repo speak for themselves: ! read(8k) ! wall 0.679730 comb 0.680000 user 0.140000 sys 0.540000 (best of 15) ! read(16k) ! wall 0.577228 comb 0.570000 user 0.080000 sys 0.490000 (best of 17) ! read(32k) ! wall 0.516060 comb 0.520000 user 0.040000 sys 0.480000 (best of 20) ! read(128k) ! wall 0.496378 comb 0.490000 user 0.010000 sys 0.480000 (best of 20) ! bundle2 iterparts() ! wall 3.460903 comb 3.460000 user 2.760000 sys 0.700000 (best of 3) ! wall 3.056811 comb 3.050000 user 2.340000 sys 0.710000 (best of 4) ! bundle2 iterparts() seekable ! wall 4.312722 comb 4.310000 user 3.480000 sys 0.830000 (best of 3) ! wall 4.007676 comb 4.000000 user 3.170000 sys 0.830000 (best of 3) ! bundle2 part seek() ! wall 6.754764 comb 6.740000 user 3.970000 sys 2.770000 (best of 3) ! wall 6.267110 comb 6.250000 user 3.480000 sys 2.770000 (best of 3) ! bundle2 part read(8k) ! wall 3.668004 comb 3.660000 user 2.960000 sys 0.700000 (best of 3) ! wall 3.404164 comb 3.400000 user 2.650000 sys 0.750000 (best of 3) ! bundle2 part read(16k) ! wall 3.489196 comb 3.480000 user 2.750000 sys 0.730000 (best of 3) ! wall 3.197972 comb 3.200000 user 2.490000 sys 0.710000 (best of 4) ! bundle2 part read(32k) ! wall 3.388569 comb 3.380000 user 2.640000 sys 0.740000 (best of 3) ! wall 3.060557 comb 3.060000 user 2.340000 sys 0.720000 (best of 4) ! bundle2 part read(128k) ! wall 3.276415 comb 3.270000 user 2.560000 sys 0.710000 (best of 4) ! wall 2.952209 comb 2.950000 user 2.230000 sys 0.720000 (best of 4) Differential Revision: https://phab.mercurial-scm.org/D1392
Mon, 13 Nov 2017 22:05:54 -0800 bundle2: inline debug logging
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 13 Nov 2017 22:05:54 -0800] rev 35138
bundle2: inline debug logging Profiling revealed that repeated calls to indebug() were consuming a fair amount of CPU during bundle2 reading, with most of the time spent in ui.configbool(). Inlining indebug() and avoiding extra attribute lookups speeds things up substantially. Using `hg perfbundleread` with a Firefox bundle: ! read(8k) ! wall 0.679730 comb 0.680000 user 0.140000 sys 0.540000 (best of 15) ! read(16k) ! wall 0.577228 comb 0.570000 user 0.080000 sys 0.490000 (best of 17) ! read(32k) ! wall 0.516060 comb 0.520000 user 0.040000 sys 0.480000 (best of 20) ! read(128k) ! wall 0.496378 comb 0.490000 user 0.010000 sys 0.480000 (best of 20) ! bundle2 iterparts() ! wall 6.983756 comb 6.980000 user 6.220000 sys 0.760000 (best of 3) ! wall 3.460903 comb 3.460000 user 2.760000 sys 0.700000 (best of 3) ! bundle2 iterparts() seekable ! wall 8.132131 comb 8.110000 user 7.160000 sys 0.950000 (best of 3) ! wall 4.312722 comb 4.310000 user 3.480000 sys 0.830000 (best of 3) ! bundle2 part seek() ! wall 10.860942 comb 10.840000 user 7.790000 sys 3.050000 (best of 3) ! wall 6.754764 comb 6.740000 user 3.970000 sys 2.770000 (best of 3) ! bundle2 part read(8k) ! wall 7.258035 comb 7.260000 user 6.470000 sys 0.790000 (best of 3) ! wall 3.668004 comb 3.660000 user 2.960000 sys 0.700000 (best of 3) ! bundle2 part read(16k) ! wall 7.099891 comb 7.080000 user 6.310000 sys 0.770000 (best of 3) ! wall 3.489196 comb 3.480000 user 2.750000 sys 0.730000 (best of 3) ! bundle2 part read(32k) ! wall 6.964685 comb 6.950000 user 6.130000 sys 0.820000 (best of 3) ! wall 3.388569 comb 3.380000 user 2.640000 sys 0.740000 (best of 3) ! bundle2 part read(128k) ! wall 6.852867 comb 6.850000 user 6.060000 sys 0.790000 (best of 3) ! wall 3.276415 comb 3.270000 user 2.560000 sys 0.710000 (best of 4) Differential Revision: https://phab.mercurial-scm.org/D1391
Mon, 13 Nov 2017 21:10:37 -0800 bundle2: don't use seekable bundle2 parts by default (issue5691)
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 13 Nov 2017 21:10:37 -0800] rev 35137
bundle2: don't use seekable bundle2 parts by default (issue5691) The last commit removed the last use of the bundle2 part seek() API in the generic bundle2 part iteration code. This means we can now switch to using unseekable bundle2 parts by default and have the special consumers that actually need the behavior request it. This commit changes unbundle20.iterparts() to expose non-seekable unbundlepart instances by default. If seekable parts are needed, callers can pass "seekable=True." The bundlerepo class needs seekable parts, so it does this. The interrupt handler is also changed to use a regular unbundlepart. So, by default, all consumers except bundlerepo will see unseekable parts. Because the behavior of the iterparts() benchmark changed, we add a variation to test seekable parts vs unseekable parts. And because parts no longer have seek() unless "seekable=True," we update the "part seek" benchmark. Speaking of benchmarks, this change has the following impact to `hg perfbundleread` on an uncompressed bundle of the Firefox repo (6,070,036,163 bytes): ! read(8k) ! wall 0.722709 comb 0.720000 user 0.150000 sys 0.570000 (best of 14) ! read(16k) ! wall 0.602208 comb 0.590000 user 0.080000 sys 0.510000 (best of 17) ! read(32k) ! wall 0.554018 comb 0.560000 user 0.050000 sys 0.510000 (best of 18) ! read(128k) ! wall 0.520086 comb 0.530000 user 0.020000 sys 0.510000 (best of 20) ! bundle2 forwardchunks() ! wall 2.996329 comb 3.000000 user 2.300000 sys 0.700000 (best of 4) ! bundle2 iterparts() ! wall 8.070791 comb 8.060000 user 7.180000 sys 0.880000 (best of 3) ! wall 6.983756 comb 6.980000 user 6.220000 sys 0.760000 (best of 3) ! bundle2 iterparts() seekable ! wall 8.132131 comb 8.110000 user 7.160000 sys 0.950000 (best of 3) ! bundle2 part seek() ! wall 10.370142 comb 10.350000 user 7.430000 sys 2.920000 (best of 3) ! wall 10.860942 comb 10.840000 user 7.790000 sys 3.050000 (best of 3) ! bundle2 part read(8k) ! wall 8.599892 comb 8.580000 user 7.720000 sys 0.860000 (best of 3) ! wall 7.258035 comb 7.260000 user 6.470000 sys 0.790000 (best of 3) ! bundle2 part read(16k) ! wall 8.265361 comb 8.250000 user 7.360000 sys 0.890000 (best of 3) ! wall 7.099891 comb 7.080000 user 6.310000 sys 0.770000 (best of 3) ! bundle2 part read(32k) ! wall 8.290308 comb 8.280000 user 7.330000 sys 0.950000 (best of 3) ! wall 6.964685 comb 6.950000 user 6.130000 sys 0.820000 (best of 3) ! bundle2 part read(128k) ! wall 8.204900 comb 8.150000 user 7.210000 sys 0.940000 (best of 3) ! wall 6.852867 comb 6.850000 user 6.060000 sys 0.790000 (best of 3) The significant speedup is due to not incurring the overhead to track payload offset data. Of course, this overhead is proportional to bundle2 part size. So a multiple gigabyte changegroup part is on the extreme side of the spectrum for real-world impact. In addition to the CPU efficiency wins, not tracking offset data also means not using memory to hold that data. Using a bundle based on the example BSD repository in issue 5691, this change has a drastic impact to memory usage during `hg unbundle` (`hg clone` would behave similarly). Before, memory usage incrementally increased for the duration of bundle processing. In other words, as we advanced through the changegroup and bundle2 part, we kept allocating more memory to hold offset data. After this change, we still increase memory during changegroup application. But the rate of increase is significantly slower. (A bulk of the remaining gradual increase appears to be the storing of revlog sizes in the transaction object to facilitate rollback.) The RSS at the end of filelog application is as follows: Before: ~752 MB After: ~567 MB So, we were storing ~185 MB of offset data that we never even used. Talk about wasteful! .. api:: bundle2 parts are no longer seekable by default. .. perf:: bundle2 read I/O throughput significantly increased. .. perf:: Significant memory use reductions when reading from bundle2 bundles. On the BSD repository, peak RSS during changegroup application decreased by ~185 MB from ~752 MB to ~567 MB. Differential Revision: https://phab.mercurial-scm.org/D1390
Mon, 13 Nov 2017 20:12:00 -0800 bundle2: only seek to beginning of part in bundlerepo
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 13 Nov 2017 20:12:00 -0800] rev 35136
bundle2: only seek to beginning of part in bundlerepo For reasons still not yet fully understood by me, bundlerepo requires its changegroup bundle2 part to be seeked to beginning after part iteration. As far as I can tell, it is the only bundle2 part consumer that relies on this behavior. This seeking was performed in the generic iterparts() API. Again, I don't fully understand why it was here and not in bundlerepo. Probably historical reasons. What I do know is that all other bundle2 part consumers don't need this special behavior (assuming the tests are comprehensive). So, we move the code from bundle2's iterparts() to bundlerepo's consumption of iterparts(). Differential Revision: https://phab.mercurial-scm.org/D1389
Mon, 13 Nov 2017 20:03:02 -0800 bundle2: implement consume() API on unbundlepart
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 13 Nov 2017 20:03:02 -0800] rev 35135
bundle2: implement consume() API on unbundlepart We want bundle parts to not be seekable by default. That means eliminating the generic seek() method. A common pattern in bundle2.py is to seek to the end of the part data. This is mainly used by the part iteration code to ensure the underlying stream is advanced to the next bundle part. In this commit, we establish a dedicated API for consuming a bundle2 part data. We switch users of seek() to it. The old implementation of seek(0, os.SEEK_END) would effectively call self.read(). The new implementation calls self.read(32768) in a loop. The old implementation would therefore assemble a buffer to hold all remaining data being seeked over. For seeking over large bundle parts, this would involve a large allocation and a lot of overhead to collect intermediate data! This overhead can be seen in the results for `hg perfbundleread`: ! bundle2 iterparts() ! wall 10.891305 comb 10.820000 user 7.990000 sys 2.830000 (best of 3) ! wall 8.070791 comb 8.060000 user 7.180000 sys 0.880000 (best of 3) ! bundle2 part seek() ! wall 12.991478 comb 10.390000 user 7.720000 sys 2.670000 (best of 3) ! wall 10.370142 comb 10.350000 user 7.430000 sys 2.920000 (best of 3) Of course, skipping over large payload data isn't likely very common. So I doubt the performance wins will be observed in the wild. Differential Revision: https://phab.mercurial-scm.org/D1388
Sun, 12 Nov 2017 19:46:15 -0800 bundle2: implement generic part payload decoder
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 12 Nov 2017 19:46:15 -0800] rev 35134
bundle2: implement generic part payload decoder The previous commit extracted _payloadchunks() to a new derived class. There was still a reference to this method in unbundlepart, making unbundlepart unusable on its own. This commit implements a generic version of a bundle2 part payload decoder, without offset tracking. seekableunbundlepart._payloadchunks() has been refactored to consume it, adding offset tracking like before. We also implement unbundlepart._payloadchunks(), which is a thin wrapper for it. Since we never instantiate unbundlepart directly, this new method is not used. This will be changed in subsequent commits. The new implementation also inlines some simple code from unpackermixin and adds some local variable to prevent extra function calls and attribute lookups. `hg perfbundleread` on an uncompressed Firefox bundle seems to show a minor win: ! bundle2 iterparts() ! wall 12.593258 comb 12.250000 user 8.870000 sys 3.380000 (best of 3) ! wall 10.891305 comb 10.820000 user 7.990000 sys 2.830000 (best of 3) ! bundle2 part seek() ! wall 13.173163 comb 11.100000 user 8.390000 sys 2.710000 (best of 3) ! wall 12.991478 comb 10.390000 user 7.720000 sys 2.670000 (best of 3) ! bundle2 part read(8k) ! wall 9.483612 comb 9.480000 user 8.420000 sys 1.060000 (best of 3) ! wall 8.599892 comb 8.580000 user 7.720000 sys 0.860000 (best of 3) ! bundle2 part read(16k) ! wall 9.159815 comb 9.150000 user 8.220000 sys 0.930000 (best of 3) ! wall 8.265361 comb 8.250000 user 7.360000 sys 0.890000 (best of 3) ! bundle2 part read(32k) ! wall 9.141308 comb 9.130000 user 8.220000 sys 0.910000 (best of 3) ! wall 8.290308 comb 8.280000 user 7.330000 sys 0.950000 (best of 3) ! bundle2 part read(128k) ! wall 8.880587 comb 8.850000 user 7.960000 sys 0.890000 (best of 3) ! wall 8.204900 comb 8.150000 user 7.210000 sys 0.940000 (best of 3) Function call overhead in Python strikes again! Of course, bundle2 decoding CPU overhead is likely small compared to decompression and changegroup application. But every little bit helps. Differential Revision: https://phab.mercurial-scm.org/D1387
Mon, 13 Nov 2017 19:22:11 -0800 bundle2: extract logic for seeking bundle2 part into own class
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 13 Nov 2017 19:22:11 -0800] rev 35133
bundle2: extract logic for seeking bundle2 part into own class Currently, unbundlepart classes support bi-directional seeking. Most consumers of unbundlepart only ever seek forward - typically as part of moving to the end of the bundle part so they can move on to the next one. But regardless of the actual usage of the part, instances maintain an index mapping offsets within the underlying raw payload to offsets within the decoded payload. Maintaining the mapping of offset data can be expensive in terms of memory use. Furthermore, many bundle2 consumers don't have access to an underlying seekable stream. This includes all compressed bundles. So maintaining offset data when the underlying stream can't be seeked anyway is wasteful. And since many bundle2 streams can't be seeked, it seems like a bad idea to expose a seek API in bundle2 parts by default. If you provide them, people will attempt to use them. Seekable bundle2 parts should be the exception, not the rule. This commit starts the process dividing unbundlepart into 2 classes: a base class that supports linear, one-time reads and a child class that supports bi-directional seeking. In this first commit, we split various methods and attributes out into a new "seekableunbundlepart" class. Previous instantiators of "unbundlepart" now instantiate "seekableunbundlepart." This preserves backwards compatibility. The coupling between the classes is still tight: "unbundlepart" cannot be used on its own. This will be addressed in subsequent commits. Differential Revision: https://phab.mercurial-scm.org/D1386
Mon, 13 Nov 2017 19:20:34 -0800 perf: add command to benchmark bundle reading
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 13 Nov 2017 19:20:34 -0800] rev 35132
perf: add command to benchmark bundle reading Upcoming commits will be refactoring bundle2 I/O code. This commit establishes a `hg perfbundleread` command that measures how long it takes to read a bundle using various mechanisms. As a baseline, here's output from an uncompressed bundle1 bundle of my Firefox repo (7,098,622,890 bytes): ! read(8k) ! wall 0.763481 comb 0.760000 user 0.160000 sys 0.600000 (best of 6) ! read(16k) ! wall 0.644512 comb 0.640000 user 0.110000 sys 0.530000 (best of 16) ! read(32k) ! wall 0.581172 comb 0.590000 user 0.060000 sys 0.530000 (best of 18) ! read(128k) ! wall 0.535183 comb 0.530000 user 0.010000 sys 0.520000 (best of 19) ! cg1 deltaiter() ! wall 0.873500 comb 0.880000 user 0.840000 sys 0.040000 (best of 12) ! cg1 getchunks() ! wall 6.283797 comb 6.270000 user 5.570000 sys 0.700000 (best of 3) ! cg1 read(8k) ! wall 1.097173 comb 1.100000 user 0.400000 sys 0.700000 (best of 10) ! cg1 read(16k) ! wall 0.810750 comb 0.800000 user 0.200000 sys 0.600000 (best of 13) ! cg1 read(32k) ! wall 0.671215 comb 0.670000 user 0.110000 sys 0.560000 (best of 15) ! cg1 read(128k) ! wall 0.597857 comb 0.600000 user 0.020000 sys 0.580000 (best of 15) And from an uncompressed bundle2 bundle (6,070,036,163 bytes): ! read(8k) ! wall 0.676997 comb 0.680000 user 0.160000 sys 0.520000 (best of 15) ! read(16k) ! wall 0.592706 comb 0.590000 user 0.080000 sys 0.510000 (best of 17) ! read(32k) ! wall 0.529395 comb 0.530000 user 0.050000 sys 0.480000 (best of 16) ! read(128k) ! wall 0.491270 comb 0.490000 user 0.010000 sys 0.480000 (best of 19) ! bundle2 forwardchunks() ! wall 2.997131 comb 2.990000 user 2.270000 sys 0.720000 (best of 4) ! bundle2 iterparts() ! wall 12.247197 comb 10.670000 user 8.170000 sys 2.500000 (best of 3) ! bundle2 part seek() ! wall 11.761675 comb 10.500000 user 8.240000 sys 2.260000 (best of 3) ! bundle2 part read(8k) ! wall 9.116163 comb 9.110000 user 8.240000 sys 0.870000 (best of 3) ! bundle2 part read(16k) ! wall 8.984362 comb 8.970000 user 8.110000 sys 0.860000 (best of 3) ! bundle2 part read(32k) ! wall 8.758364 comb 8.740000 user 7.860000 sys 0.880000 (best of 3) ! bundle2 part read(128k) ! wall 8.749040 comb 8.730000 user 7.830000 sys 0.900000 (best of 3) We already see some interesting data. Notably that bundle2 has significant overhead compared to bundle1. This matters for e.g. stream clone bundles, which can be applied at >1Gbps. Differential Revision: https://phab.mercurial-scm.org/D1385
Mon, 20 Nov 2017 01:40:26 -0800 sshpeer: add a configurable hint for the ssh error message
Zuzanna Mroczek <zuza@fb.com> [Mon, 20 Nov 2017 01:40:26 -0800] rev 35131
sshpeer: add a configurable hint for the ssh error message Adding a possibility to configure error hint to be shown in the case of problems with SSH. Example of such hint can be "Please see http://company/internalwiki/ssh.html". Test Plan: - Ran hg pull with broken link and verified the output has no hint by default: ``` pulling from ssh://brokenrepository.com//repo remote: ssh: Could not resolve hostname brokenrepository.com: Name or service not known abort: no suitable response from remote hg! ``` - Run hg pull --config ui.ssherrorhint="Please see http://company/internalwiki/ssh.html": ``` pulling from ssh://brokenrepository.com//repo remote: ssh: Could not resolve hostname brokenrepository.com: Name or service not known abort: no suitable response from remote hg! (Please see http://company/internalwiki/ssh.html) ``` Differential Revision: https://phab.mercurial-scm.org/D1431
Thu, 16 Nov 2017 15:01:21 -0800 docs: add args/returns docs for some cmdutil, context, and registrar functions
rlevasseur@google.com [Thu, 16 Nov 2017 15:01:21 -0800] rev 35130
docs: add args/returns docs for some cmdutil, context, and registrar functions When writing my first extension, I found it hard to figure out these functions. I figured documenting their inputs/outputs would help future authors who are new to the codebase. Differential Revision: https://phab.mercurial-scm.org/D1440
Tue, 21 Nov 2017 04:37:51 +0530 commands: add value for cmdtype argument for read only commands
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 21 Nov 2017 04:37:51 +0530] rev 35129
commands: add value for cmdtype argument for read only commands In the previous release we added an argument `cmdtype` to registrar.command() which is a enum and tells whether the command is read only, recoverable write or unrecoverable write command. This patch add the value of cmdtype argument for commands which are read only. Differential Revision: https://phab.mercurial-scm.org/D1468
Wed, 15 Nov 2017 21:07:30 -0800 error: add InMemoryMergeConflictsError
Phil Cohen <phillco@fb.com> [Wed, 15 Nov 2017 21:07:30 -0800] rev 35128
error: add InMemoryMergeConflictsError We'll raise this exception in the merge code, and in-memory users like rebase can catch it and retry without IMM. Differential Revision: https://phab.mercurial-scm.org/D1210
Mon, 20 Nov 2017 18:05:15 -0500 lfs: generate a large file by using `python` instead of yes | head
Augie Fackler <augie@google.com> [Mon, 20 Nov 2017 18:05:15 -0500] rev 35127
lfs: generate a large file by using `python` instead of yes | head yes(1) on some systems (like gcc112) feels compelled to inform you of broken pipes, such as those triggered by head(1). This works around the problem portably.
Mon, 20 Nov 2017 18:00:02 -0500 setup: add hgext.lfs to list of Python packages
Augie Fackler <augie@google.com> [Mon, 20 Nov 2017 18:00:02 -0500] rev 35126
setup: add hgext.lfs to list of Python packages This is needed for lfs to get installed. Probably could stand to go into an earlier patch, but I just want to get this stuff pushed.
Sat, 18 Nov 2017 12:54:06 -0500 test-lfs: add tests demonstrating the interaction with largefiles
Matt Harbison <matt_harbison@yahoo.com> [Sat, 18 Nov 2017 12:54:06 -0500] rev 35125
test-lfs: add tests demonstrating the interaction with largefiles Obviously the original series needs to be accepted first, but there are concerns about how well these extensions will play together before proceeding. It looks like the answer is surprisingly well. There are some merge surprises (largefiles seems to combine the choice of "keep tracking as a large/normal file" with taking the content of the large/normal file) and some existing diff weirdness (largefiles diffs the standins, not the large file). Converting the repo to normal files seemlessly transitions to lfs on the fly. I didn't test going the other way, because I'm not sure why anyone would want to do that. I flagged the lack of a repo requirement after converting, because some of the unsubmitted changes I have add a requirement on commit, but this somehow misses the convert case. I flagged an issue where devel-warnings are emitted on convert, which is a separate issue.
Tue, 14 Nov 2017 01:09:48 -0500 test-lfs: cast the flags printed to an int
Matt Harbison <matt_harbison@yahoo.com> [Tue, 14 Nov 2017 01:09:48 -0500] rev 35124
test-lfs: cast the flags printed to an int On Windows, the flag values in the subsequent tests were printing with a 'L' suffix.
Tue, 14 Nov 2017 01:03:22 -0500 lfs: register config options
Matt Harbison <matt_harbison@yahoo.com> [Tue, 14 Nov 2017 01:03:22 -0500] rev 35123
lfs: register config options I'm not sure at what point we can get rid of the deprecated options, but for the sake of making progress, they are registered too.
Tue, 14 Nov 2017 00:14:52 -0500 lfs: quiesce check-module-import warnings
Matt Harbison <matt_harbison@yahoo.com> [Tue, 14 Nov 2017 00:14:52 -0500] rev 35122
lfs: quiesce check-module-import warnings Specifically, 'symbol import follows non-symbol import: mercurial.i18n'
Tue, 14 Nov 2017 00:06:23 -0500 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com> [Tue, 14 Nov 2017 00:06:23 -0500] rev 35121
lfs: import the Facebook git-lfs client extension The purpose of this is the same as the built-in largefiles extension- to handle huge files outside of the normal storage system, generally to keep the amount of data cloned to a lower amount. There are several benefits of implementing the git-lfs protocol, instead of using the largefiles extension: - Bitbucket and Github support (and probably wider support in 3rd party hosting sites in general). [1][2] - The number of hg internals monkey patched are several orders of magnitude lower, so it will be easier to reason about and maintain. Future commands will likely just work, without requiring various wrappers. - The "standin" files are only written to the filelog, not the disk. That should avoid weird edge cases where the largefile and standin files get out of sync. [3] It also avoids the occasional printing of the "hidden" standin file in various messages. - Filesets like size() will work, even if the file isn't present. (It always says 41 bytes for largefiles, whether present or not.) The only place that I see where largefiles comes out on top is that it works with `hg serve` for simple sharing, without external infrastructure. Getting lfs-test-server working was a hassle, and took awhile to figure out. Maybe we can do something to make it work in the future. Long term, I expect that this will be highly preferred over largefiles. But if we are to recommend this to largefile users, there are some UI issues to bikeshed. Until they are resolved, I've marked this experimental, and am not putting a pointer to this in the largefiles help. The (non exhaustive) list of issues I've seen so far are: - It isn't sufficient to just enable the largefiles extension- you have to explicitly add a file with --large before it will pay attention to the configured sizes and patterns on future adds. The justification being that once you use it, you're stuck with it. I've seen people confused by this, and haven't liked it myself. But it's also saved me a few times. Should we do something like have a specific enabling config setting that must be set in the local repo config, so that enabling this extension in the user or system hgrc doesn't silently start storing lfs files? - The largefiles extension adds a repo requirement when the first largefile is committed, so that the extension must always be enabled in the future. This extension is not doing that, and since I only enabled it locally to avoid infecting other repos, I got a cryptic error about missing flag processors when I cloned. Is there no repo requirement due to shallow/narrow clone considerations (or other future advanced things)? - In the (small amount of) reading I've done about the git implementation, it seems that the files and sizes are stored in a tracked .gitattributes file. I think a tracked file for this would be extremely useful for consistency across developers, but this kind of touches on the tracked hgrc file proposal a few months back. - The git client can specify file patterns, not just sizes. - The largefiles extension has a cache directory in the local repo, but also a system wide one. We should probably implement a system wide cache too, so that multiple clones don't have to refetch the files from the server. - Jun mentioned other missing features, like SSH authentication, gc, etc. The code corresponds to c0492b73c7ef in hg-experimental. [4] The only tweaks are to load the extension in the tests with 'lfs=' instead of 'lfs=$TESTDIR/../hgext3rd/lfs', change the import in the *.py test to hgext (from hgext3rd), add the 'testedwith' declaration, and mark it experimental for now. The infinite-push, p4fastimport, and remotefilelog tests were left behind. The devel-warnings for unregistered config options are not corrected yet, nor are the import check warnings. [1] https://www.mercurial-scm.org/pipermail/mercurial/2017-November/050699.html [2] https://bitbucket.org/site/master/issues/3843/largefiles-support-bb-3903 [3] https://bz.mercurial-scm.org/show_bug.cgi?id=5738 [4] https://bitbucket.org/facebook/hg-experimental
Sat, 18 Nov 2017 16:12:00 +0900 run-tests: outputdir also has to be changed if $TESTDIR is not $PWD
Matthieu Laneuville <matthieu.laneuville@octobus.net> [Sat, 18 Nov 2017 16:12:00 +0900] rev 35120
run-tests: outputdir also has to be changed if $TESTDIR is not $PWD Following a18eef03d879, running run-tests.py from outside tests/ would lead to the creation of .testtimes and test-*.t.err in $PWD instead of $TESTDIR. This patch fixes that and updates the relevant test.
Mon, 20 Nov 2017 21:59:00 +0800 hgweb: use webutil.commonentry() for nodes (but not for jsdata yet) in /graph
Anton Shestakov <av6@dwimlabs.net> [Mon, 20 Nov 2017 21:59:00 +0800] rev 35119
hgweb: use webutil.commonentry() for nodes (but not for jsdata yet) in /graph This makes graphdata() simpler by using existing code that gets common changeset properties for showing in hgweb. graphdata() is a nested function in graph() that prepares entries for /graph view, but there are two different lists of changesets prepared: "jsdata" for JavaScript-rendered graph and "nodes" for everything else. For "jsdata", properties "node", "user", "age" and "desc" are passed through various template filters because we don't have these filters in JavaScript, so the data has to be prepared server-side. But now that commonentry() is used for producing "nodes" list (and it doesn't apply any filters), these filters need to be added to the appropriate templates (only raw at this moment, everything else either doesn't implement graph or uses JavaScript). This is a bit of refactoring that will hopefully simplify future patches. The end result is to have /graph that only renders the actual graph with nodes and vertices in JavaScript, and the rest is done server-side. This way server-side code can focus on showing a list of changesets, which is easy because we already have /log, /shortlog, etc, and JavaScript code can be simplified, making it easier to add obsolescence graph and other features.
Mon, 20 Nov 2017 21:47:11 +0800 hgweb: check changeset's original branch in graphdata()
Anton Shestakov <av6@dwimlabs.net> [Mon, 20 Nov 2017 21:47:11 +0800] rev 35118
hgweb: check changeset's original branch in graphdata() This piece of code checks if a changeset is the tip of its branch, but as can be seen above in the context, "branch" was prepared for being displayed in hgweb by making it unicode and passing it through url.escape. It's better to use the original ctx.branch().
Sun, 19 Nov 2017 14:02:50 +0800 hgweb: show instabilities of a commit
Anton Shestakov <av6@dwimlabs.net> [Sun, 19 Nov 2017 14:02:50 +0800] rev 35117
hgweb: show instabilities of a commit In paper, coal, gitweb and monoblue a new "tag" (or multiple, if there are many instabilities) is added to the same line that has phase, branch, etc of a changeset; in gitweb and monoblue this element has a light red background, in paper and coal the element is black and underlined. In spartan theme instabilities are shown on a separate line. While test-obsolete.t uses first(phasedivergent()) revset to pick a changeset to test, that particular changeset is also an orphan, so two different instability tags are displayed.
Sun, 19 Nov 2017 13:18:54 +0800 context: add instabilities() method to basefilectx
Anton Shestakov <av6@dwimlabs.net> [Sun, 19 Nov 2017 13:18:54 +0800] rev 35116
context: add instabilities() method to basefilectx This method is now used in webutils.commonentry(), which adds common data items (commit hash, author, date, etc) for rendering changesets in hgweb. Usually, commonentry() is given a changectx as ctx; but in views related to files (e.g. file view, diff, annotate) it's replaced by a filectx, so the latter also needs to have instabilities() method.
Sun, 19 Nov 2017 04:11:21 +0100 run-test: drop 'execfile' usage for 'common-pattern.py' file
Boris Feld <boris.feld@octobus.net> [Sun, 19 Nov 2017 04:11:21 +0100] rev 35115
run-test: drop 'execfile' usage for 'common-pattern.py' file This is required for Python 3.
Sun, 19 Nov 2017 04:10:55 +0100 run-test: use byte for 'common-pattern.py' path
Boris Feld <boris.feld@octobus.net> [Sun, 19 Nov 2017 04:10:55 +0100] rev 35114
run-test: use byte for 'common-pattern.py' path This is required for Python 3.
Mon, 20 Nov 2017 14:30:54 -0500 templates: reword 'back to filelog' link anchor text
Jordi Gutiérrez Hermoso <jordigh@octave.org> [Mon, 20 Nov 2017 14:30:54 -0500] rev 35113
templates: reword 'back to filelog' link anchor text This anchor text is problematic in two ways: first, the "back to" part assumes that you got to the page showing it via the filelog. This is not necessarily true, as there are other ways to get to that view besides the filelog view, such as for example following the history of lines from a file. Second, it uses "filelog" jargon, which refers to how each file has its own revlog. This is internal jargon that has no business being exposed to the end user. I just reworded this template to improve understanding.
Sat, 18 Nov 2017 12:04:08 +0800 hgweb: show obsolescence status of a commit
Anton Shestakov <av6@dwimlabs.net> [Sat, 18 Nov 2017 12:04:08 +0800] rev 35112
hgweb: show obsolescence status of a commit As with phases, spartan theme shows a simple "obsolete: yes" on its own line (this allows replacing "yes" with something more useful in future, like output of obsfate* template functions). Everywhere else a new "tag" is added to the same line that has phase, branch, etc of a changeset; in gitweb and monoblue the element has gray background, in paper and coal the element is gray with a dashed underline.
Sat, 18 Nov 2017 11:58:57 +0800 context: add obsolete() method to basefilectx
Anton Shestakov <av6@dwimlabs.net> [Sat, 18 Nov 2017 11:58:57 +0800] rev 35111
context: add obsolete() method to basefilectx This method is now used in webutils.commonentry(), which adds common data items (commit hash, author, date, etc) for rendering changesets in hgweb. Usually, commonentry() is given a changectx as ctx; but in views related to files (e.g. file view, diff, annotate) it's replaced by a filectx, so the latter also needs to have obsolete() method.
(0) -30000 -10000 -3000 -1000 -300 -100 -96 +96 +100 +300 +1000 +3000 +10000 tip