Sun, 17 Jul 2016 15:13:51 -0700 bundle2: store changeset count when creating file bundles
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 17 Jul 2016 15:13:51 -0700] rev 29593
bundle2: store changeset count when creating file bundles The bundle2 changegroup part has an advisory param saying how many changesets are in the part. Before this patch, we were setting this part when generating bundle2 parts via the wire protocol but not when generating local bundle2 files. A side effect of not setting the changeset count part is that progress bars don't work when applying changesets. As the tests show, this impacted clone bundles, shelve, backup bundles, `hg unbundle`, and anything touching bundle2 files. This patch adds a backdoor to allow us to pass state from changegroup generation into the unbundler. We store the number of changesets in the changegroup in this state and use it to populate the aforementioned advisory part parameter when generating the bundle2 bundle. I concede that I'm not thrilled by how state is being passed in changegroup.py (it feels a bit hacky). I would love to overhaul the rather confusing set of functions in changegroup.py with something that passes rich objects around instead of e.g. low-level generators. However, given the code freeze for 3.9 is imminent, I'd rather not undertake this endeavor right now. This feels like the easiest way to get the parameter added to the changegroup part.
Sun, 17 Jul 2016 15:10:30 -0700 util: implement a deterministic __repr__ on sortdict
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 17 Jul 2016 15:10:30 -0700] rev 29592
util: implement a deterministic __repr__ on sortdict `hg debugbundle` is calling repr() on bundle2 part params, which are now util.sortdict instances. Unfortunately, repr() doesn't appear to be deterministic for util.sortdict. So, we implement one. We include the type name because that's the common convention for __repr__ implementations. Having the type name in `hg debugbundle` is a bit ugly. But it's a debug command and I don't care enough to fix it.
Sun, 17 Jul 2016 14:51:00 -0700 bundle2: use a sorted dict for holding parameters
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 17 Jul 2016 14:51:00 -0700] rev 29591
bundle2: use a sorted dict for holding parameters An upcoming change that introduces a 2nd part parameter to a part reveals that `hg debugbundle` isn't deterministic because parameters are stored on n plain, unsorted dict. While we could change that command to sort before output, I think the more important underlying issue is that bundle2 reading is taking an ordered data structure and converting it to an unordered one. Plugging in util.sortdict() fixes that problem while preserving API compatibility. This patch also appears to shine light on the fact that we don't have tests verifying parts with multiple parameters roundtrip correctly. That would be a good thing to test (and fuzz)... someday.
Fri, 15 Jul 2016 13:41:34 -0700 wireproto: extract repo filtering to standalone function
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 15 Jul 2016 13:41:34 -0700] rev 29590
wireproto: extract repo filtering to standalone function As part of teaching Mozilla's replication extension to better handle repositories with obsolescence data, I encountered a few scenarios where I wanted built-in wire protocol commands from replication clients to operate on unfiltered repositories so they could have access to obsolete changesets. While the undocumented "web.view" config option provides a mechanism to choose what filter/view hgweb operates on, this doesn't apply to wire protocol commands because wireproto.dispatch() is always operating on the "served" repo. This patch extracts the line for obtaining the repo that wireproto commands operate on to its own function so extensions can monkeypatch it to e.g. return an unfiltered repo. I stopped short of exposing a config option because I view the use case for changing this as a niche feature, best left to the domain of extensions.
Thu, 14 Jul 2016 19:16:46 -0700 url: add distribution and version to user-agent request header (BC)
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 14 Jul 2016 19:16:46 -0700] rev 29589
url: add distribution and version to user-agent request header (BC) As a server operator, I've always wanted to know what Mercurial version clients are running so I can track version adoption and make informed decisions about which versions of Mercurial to support in extensions. Unfortunately, there is no easy way to discern this today: the best you can do is look for high-level feature usage (e.g. bundle2) or sniff capabilities from bundle2 commands. And these things aren't changed frequently enough to tell you anything that interesting. Nearly every piece of software talking HTTP sends its version in the user agent. This includes web browsers, curl, and even Git. This patch adds the distribution name and version to the user-agent HTTP request header. We choose "Mercurial" for the distribution name because that seems appropriate. The version string comes from __version__. The value is inside parenthesis for a few reasons: * The version *may* contain spaces * Alternate forms like "Mercurial/<version>" imply structure and since the user agent should not be used by servers for protocol or feature negotiation/detection, we don't want to even give the illusion that the value should be parsed. A free form field is the most hostile to parsing. Flagging the patch as BC so it shows up in release notes. This change should be backwards compatible. But I wouldn't be surprised if a server somewhere is filtering on the exact old user agent string. So I want to make noise about this change.
Sat, 16 Jul 2016 14:48:58 +0900 commandserver: use SOMAXCONN as queue size of pending connections
Yuya Nishihara <yuya@tcha.org> [Sat, 16 Jul 2016 14:48:58 +0900] rev 29588
commandserver: use SOMAXCONN as queue size of pending connections The old value 5 was arbitrary chosen. Since there's no practical reason to limit the backlog, this patch simply uses SOMAXCONN as a value large enough.
Sat, 16 Jul 2016 14:46:31 +0900 commandserver: rename _serveworker() to _runworker()
Yuya Nishihara <yuya@tcha.org> [Sat, 16 Jul 2016 14:46:31 +0900] rev 29587
commandserver: rename _serveworker() to _runworker() "run" sounds more natural as the function does never listen for new connection.
Sun, 22 May 2016 13:53:32 +0900 commandserver: separate initialization and cleanup of forked process
Yuya Nishihara <yuya@tcha.org> [Sun, 22 May 2016 13:53:32 +0900] rev 29586
commandserver: separate initialization and cleanup of forked process Separated _initworkerprocess() and _serverequest() can be reused when implementing a prefork service.
Sat, 21 May 2016 18:14:13 +0900 commandserver: unindent superfluous "if True" blocks
Yuya Nishihara <yuya@tcha.org> [Sat, 21 May 2016 18:14:13 +0900] rev 29585
commandserver: unindent superfluous "if True" blocks
Sun, 17 Jul 2016 19:48:04 +0530 pycompat: make pycompat demandimport friendly
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 17 Jul 2016 19:48:04 +0530] rev 29584
pycompat: make pycompat demandimport friendly pycompat.py includes hack to import modules whose names are changed in Python 3. We use try-except to load module according to the version of python. But this method forces us to import the modules to raise an ImportError and hence making it demandimport unfriendly. This patch changes the try-except blocks to a single if-else block. To avoid test-check-pyflakes.t complain about unused imports, pycompat.py is excluded from the test.
Mon, 18 Jul 2016 08:55:30 +0100 run-tests: make --local set --with-chg if --chg is used
Jun Wu <quark@fb.com> [Mon, 18 Jul 2016 08:55:30 +0100] rev 29583
run-tests: make --local set --with-chg if --chg is used --local should work with chg as well.
Mon, 18 Jul 2016 08:45:46 +0100 run-tests: allow --local to set multiple attributes
Jun Wu <quark@fb.com> [Mon, 18 Jul 2016 08:45:46 +0100] rev 29582
run-tests: allow --local to set multiple attributes This is to make the next patch easier to review. It does not change logic.
Sun, 17 Jul 2016 23:05:59 +0100 chg: add pgid to hgclient struct
Jun Wu <quark@fb.com> [Sun, 17 Jul 2016 23:05:59 +0100] rev 29581
chg: add pgid to hgclient struct The previous patch makes the server tell the client its pgid. This patch stores it in hgclient_t and adds a function to get it.
Sun, 17 Jul 2016 22:56:05 +0100 commandserver: send pgid in hello message
Jun Wu <quark@fb.com> [Sun, 17 Jul 2016 22:56:05 +0100] rev 29580
commandserver: send pgid in hello message See the next patches for why we need it.
Sun, 17 Jul 2016 11:28:01 -0700 tests: update test certificate generation instructions
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 17 Jul 2016 11:28:01 -0700] rev 29579
tests: update test certificate generation instructions Suggestions from Anton Shestakov and Julien Cristau to use -subj and faketime, respectively.
Sun, 17 Jul 2016 11:03:08 -0700 sslutil: move comment about protocol constants
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 17 Jul 2016 11:03:08 -0700] rev 29578
sslutil: move comment about protocol constants protocolsettings() is the appropriate place for this comment.
Sun, 17 Jul 2016 10:59:32 -0700 sslutil: support defining cipher list
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 17 Jul 2016 10:59:32 -0700] rev 29577
sslutil: support defining cipher list Python 2.7 supports specifying a custom cipher list to TLS sockets. Advanced users may wish to specify a custom cipher list to increase security. Or in some cases they may wish to prefer weaker ciphers in order to increase performance (e.g. when doing stream clones of very large repositories). This patch introduces a [hostsecurity] config option for defining the cipher list. The help documentation states that it is for advanced users only. Honestly, I'm a bit on the fence about providing this because it is a footgun and can be used to decrease security. However, there are legitimate use cases for it, so I think support should be provided.
Sun, 17 Jul 2016 10:50:51 -0700 hghave: add test for Python 2.7+
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 17 Jul 2016 10:50:51 -0700] rev 29576
hghave: add test for Python 2.7+ Setting ciphers in the ssl module requires Python 2.7. Surprisingly, we didn't have a test for running on Python 2.7.
Sat, 16 Jul 2016 15:06:19 +0800 spartan: make different blocks of annotated lines have different colors
Anton Shestakov <av6@dwimlabs.net> [Sat, 16 Jul 2016 15:06:19 +0800] rev 29575
spartan: make different blocks of annotated lines have different colors
Sat, 16 Jul 2016 15:06:04 +0800 monoblue: make different blocks of annotated lines have different colors
Anton Shestakov <av6@dwimlabs.net> [Sat, 16 Jul 2016 15:06:04 +0800] rev 29574
monoblue: make different blocks of annotated lines have different colors
Sat, 16 Jul 2016 15:00:36 +0800 gitweb: make different blocks of annotated lines have different colors
Anton Shestakov <av6@dwimlabs.net> [Sat, 16 Jul 2016 15:00:36 +0800] rev 29573
gitweb: make different blocks of annotated lines have different colors
Sat, 16 Jul 2016 14:49:07 +0800 paper: make different blocks of annotated lines have different colors
Anton Shestakov <av6@dwimlabs.net> [Sat, 16 Jul 2016 14:49:07 +0800] rev 29572
paper: make different blocks of annotated lines have different colors
Fri, 20 May 2016 09:47:35 +0900 tests: check importing modules in perf.py for historical portability
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Fri, 20 May 2016 09:47:35 +0900] rev 29571
tests: check importing modules in perf.py for historical portability To check importing modules in perf.py for historical portability, this patch lists up files by "hg files" both for "1.2" and tip, and builds up "module whitelist" check from those files. This patch uses "1.2" as earlier side version of "module whitelist", because "mercurial.error" module is a blocker for loading perf.py with Mercurial earlier than 1.2, and just importing "mercurial.error" separately isn't enough.
Fri, 20 May 2016 09:47:35 +0900 tests: introduce check-perf-code.py to add extra checks on perf.py
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Fri, 20 May 2016 09:47:35 +0900] rev 29570
tests: introduce check-perf-code.py to add extra checks on perf.py This patch introduces tests/check-perf-code.py as a preparation for adding extra checks on contrib/perf.py in subsequent patches (mainly, for historical portability). At this change, check-perf-code.py doesn't add any extra check, and is equal to check-code.py. This makes subsequent patch focus only on adding an extra check on perf.py check-perf-code.py. check-perf-code.py adds extra checks on perf.py by wrapping contrib/check-code.py, because "filtering" by check-code.py (e.g. normalize characters in string literal or comment line) is useful to simplify regexp for check, and avoid false positive matching.
Fri, 20 May 2016 09:47:35 +0900 check-code: move fixing up regexp into main procedure
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Fri, 20 May 2016 09:47:35 +0900] rev 29569
check-code: move fixing up regexp into main procedure This patch makes an extra check pattern to be prepared by "_preparepats()" as similarly as existing patterns, if it is added to "checks" array before invocation of "main()" in check-code.py. This is a part of preparation for adding check-code.py extra checks by another python script in subsequent patch. This is also useful for SkeletonExtensionPlan. https://www.mercurial-scm.org/wiki/SkeletonExtensionPlan
Fri, 20 May 2016 09:47:35 +0900 check-code: factor out boot procedure into main
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Fri, 20 May 2016 09:47:35 +0900] rev 29568
check-code: factor out boot procedure into main This is a part of preparation for adding check-code.py extra checks by another python script in subsequent patch. This is also useful for SkeletonExtensionPlan. https://www.mercurial-scm.org/wiki/SkeletonExtensionPlan
Fri, 20 May 2016 09:47:35 +0900 perf: import newer modules separately for earlier Mercurial
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Fri, 20 May 2016 09:47:35 +0900] rev 29567
perf: import newer modules separately for earlier Mercurial demandimport of early Mercurial loads an imported module immediately, if a module is imported absolutely by "from a import b" style. Recent perf.py satisfies this condition, because it does: - have "from __future__ import absolute_import" line - use "from a import b" style for modules in "mercurial" package Before this patch, importing modules below prevents perf.py from being loaded by earlier Mercurial, because these aren't available in such Mercurial, even though there are some code paths for Mercurial earlier than 1.9. - branchmap 2.5 (or bcee63733aad) - repoview 2.5 (or 3a6ddacb7198) - obsolete 2.3 (or ad0d6c2b3279) - scmutil 1.9 (or 8b252e826c68) For example, setting "_prereadsize" attribute in perfindex() and perfnodelookup() is effective only with Mercurial earlier than 1.8 (or 61c9bc3da402). After this patch, "mercurial.error" is the only blocker in "from mercurial import" statement for loading perf.py with Mercurial earlier than 1.2. This patch ignores it, because just importing it separately isn't enough.
Wed, 13 Jul 2016 23:38:29 +0530 py3: conditionalize BaseHTTPServer, SimpleHTTPServer and CGIHTTPServer import
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 13 Jul 2016 23:38:29 +0530] rev 29566
py3: conditionalize BaseHTTPServer, SimpleHTTPServer and CGIHTTPServer import The BaseHTTPServer, SimpleHTTPServer and CGIHTTPServer has been merged into http.server in python 3. All of them has been merged as util.httpserver to use in both python 2 and 3. This patch adds a regex to check-code to warn against the use of BaseHTTPServer. Moreover this patch also includes updates to lower part of test-check-py3-compat.t which used to remain unchanged.
Fri, 15 Jul 2016 23:00:31 +0530 py3: re-implement the BaseHTTPServer.test() function
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 15 Jul 2016 23:00:31 +0530] rev 29565
py3: re-implement the BaseHTTPServer.test() function The function is changed in python 3. So the latest version of function is re-implemented. One can look at https://hg.python.org/cpython/file/3.5/Lib/http/server.py#l1184 and https://hg.python.org/cpython/file/2.7/Lib/BaseHTTPServer.py#l590 to see the change
Fri, 15 Jul 2016 12:39:36 -0400 test-http: use sed instead of fixed-with cut for reading access.log
Augie Fackler <augie@google.com> [Fri, 15 Jul 2016 12:39:36 -0400] rev 29564
test-http: use sed instead of fixed-with cut for reading access.log Some systems (like FreeBSD jails) use something other than 127.0.0.1 for localhost, and it's not safe to assume it'll always be the same width. Using sed with a replacement like this sidesteps the problem.
(0) -10000 -3000 -1000 -300 -100 -50 -30 +30 +50 +100 +300 +1000 +3000 +10000 tip