Sat, 15 Oct 2016 14:06:46 +0900 hgweb: extract app factory
Yuya Nishihara <yuya@tcha.org> [Sat, 15 Oct 2016 14:06:46 +0900] rev 30517
hgweb: extract app factory I'll move createservice() to the server module, but createapp() seems good to remain in the hgweb module because of its dependency on hgweb/hgwebdir_mod.
Sat, 15 Oct 2016 13:57:17 +0900 server: move service table and factory from commandserver
Yuya Nishihara <yuya@tcha.org> [Sat, 15 Oct 2016 13:57:17 +0900] rev 30516
server: move service table and factory from commandserver This is necessary to solve future dependency cycle between commandserver.py and chgserver.py. 'cmd' prefix is added to table and function names to avoid conflicts with hgweb.
Sat, 15 Oct 2016 13:47:43 +0900 server: move cmdutil.service() to new module (API)
Yuya Nishihara <yuya@tcha.org> [Sat, 15 Oct 2016 13:47:43 +0900] rev 30515
server: move cmdutil.service() to new module (API) And call it runservice() because I'll soon add createservice(). The main reason I'm going to introduce the 'server' module is to solve future dependency cycle between chgserver.py and commandserver.py. The 'server' module sits at the same layer as the cmdutil. I believe it's generally good to get rid of things from the big cmdutil module.
Wed, 17 Aug 2016 20:41:05 -0700 debugcommands: move 'debugcomplete' in the new module
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 17 Aug 2016 20:41:05 -0700] rev 30514
debugcommands: move 'debugcomplete' in the new module
Wed, 17 Aug 2016 20:40:13 -0700 debugcommands: move 'debugcommands' in the new module
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 17 Aug 2016 20:40:13 -0700] rev 30513
debugcommands: move 'debugcommands' in the new module The commit message isn't an illusion. There is a "debugcommands" module and command.
Wed, 17 Aug 2016 20:38:29 -0700 debugcommands: move 'debugcheckstate' in the new module
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 17 Aug 2016 20:38:29 -0700] rev 30512
debugcommands: move 'debugcheckstate' in the new module
Wed, 17 Aug 2016 20:37:54 -0700 debugcommands: move debug{create,apply}streambundleclone to the new module
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 17 Aug 2016 20:37:54 -0700] rev 30511
debugcommands: move debug{create,apply}streambundleclone to the new module
Wed, 17 Aug 2016 21:07:22 -0700 debugcommands: move 'debugbundle' in the new module
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 17 Aug 2016 21:07:22 -0700] rev 30510
debugcommands: move 'debugbundle' in the new module
Tue, 22 Nov 2016 18:46:50 +0530 py3: add os.getcwdb() to have bytes path
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 22 Nov 2016 18:46:50 +0530] rev 30509
py3: add os.getcwdb() to have bytes path Following the behaviour of Python 3, os.getcwd() return unicodes. We need bytes version as path variables are bytes in UNIX. Python 3 has os.getcwdb() which returns current working directory in bytes. Like rest of the things there in pycompat, like osname, ossep, we need to rewrite every instance of os.getcwd to pycompat.getcwd to make them work correctly on Python 3.
Tue, 22 Nov 2016 18:13:02 -0800 help: clarify contents of revlog index
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 22 Nov 2016 18:13:02 -0800] rev 30508
help: clarify contents of revlog index The previous wording indicated that field at index 3 was the size of the decompressed chunk, not the size of the full revision text.
Tue, 22 Nov 2016 13:32:05 -0800 zstd: fix compilation with Solaris Studio
Danek Duvall <danek.duvall@oracle.com> [Tue, 22 Nov 2016 13:32:05 -0800] rev 30507
zstd: fix compilation with Solaris Studio Without these changes, Solaris Studio (12.4) gives us "syntax error: empty declaration" on these two lines.
Mon, 21 Nov 2016 21:36:46 -0500 cmdutil: turn forward of checkunresolved into a deprecation warning
Augie Fackler <augie@google.com> [Mon, 21 Nov 2016 21:36:46 -0500] rev 30506
cmdutil: turn forward of checkunresolved into a deprecation warning As with dirstateguard, I really doubt anyone outside core was using this, as my grep over the repositories I keep locally suggests nobody was using this. If others are comfortable with it, let's drop the forward entirely.
Mon, 21 Nov 2016 21:32:55 -0500 localrepo: refer to checkunresolved by its new name
Augie Fackler <augie@google.com> [Mon, 21 Nov 2016 21:32:55 -0500] rev 30505
localrepo: refer to checkunresolved by its new name
Mon, 21 Nov 2016 21:32:39 -0500 rebase: refer to checkunresolved by its new name
Augie Fackler <augie@google.com> [Mon, 21 Nov 2016 21:32:39 -0500] rev 30504
rebase: refer to checkunresolved by its new name
Mon, 21 Nov 2016 21:31:45 -0500 checkunresolved: move to new package to help avoid import cycles
Augie Fackler <augie@google.com> [Mon, 21 Nov 2016 21:31:45 -0500] rev 30503
checkunresolved: move to new package to help avoid import cycles This will allow localrepo to stop using cmdutil, which should avoid some future import cycles. There's room for an adventurous soul to delve deeper into merge.py and figure out how to disentangle more of it - it appears to be a nexus of cycle problems. Some of it might be able to move into this new mergeutil package.
Mon, 21 Nov 2016 21:16:54 -0500 cmdutil: mark dirstateguard as deprecated
Augie Fackler <augie@google.com> [Mon, 21 Nov 2016 21:16:54 -0500] rev 30502
cmdutil: mark dirstateguard as deprecated I sincerely doubt this is used in external code, as grepping the extensions I keep locally (including Facebook's hgexperimental and evolve) indicate nobody outside of core uses this. As such, I'd also welcome just dropping this name forward entirely.
Mon, 21 Nov 2016 21:06:34 -0500 localrepo: refer to dirstateguard by its new name
Augie Fackler <augie@google.com> [Mon, 21 Nov 2016 21:06:34 -0500] rev 30501
localrepo: refer to dirstateguard by its new name
Mon, 21 Nov 2016 21:06:22 -0500 commands: refer to dirstateguard by its new name
Augie Fackler <augie@google.com> [Mon, 21 Nov 2016 21:06:22 -0500] rev 30500
commands: refer to dirstateguard by its new name
Mon, 21 Nov 2016 21:27:12 -0500 rebase: refer to dirstateguard by its new name
Augie Fackler <augie@google.com> [Mon, 21 Nov 2016 21:27:12 -0500] rev 30499
rebase: refer to dirstateguard by its new name
Mon, 21 Nov 2016 21:05:52 -0500 mq: refer to dirstateguard by its new name
Augie Fackler <augie@google.com> [Mon, 21 Nov 2016 21:05:52 -0500] rev 30498
mq: refer to dirstateguard by its new name
Mon, 21 Nov 2016 21:29:32 -0500 dirstateguard: move to new module so I can break some layering violations
Augie Fackler <augie@google.com> [Mon, 21 Nov 2016 21:29:32 -0500] rev 30497
dirstateguard: move to new module so I can break some layering violations Recently in a review I noticed that localrepo almost has no reason to import cmdutil anymore. Also, cmdutil is a little on the enormous side, so breaking this class out strikes me as a win.
Mon, 21 Nov 2016 22:17:45 -0500 keepalive: discard legacy Python support for error handling
Augie Fackler <augie@google.com> [Mon, 21 Nov 2016 22:17:45 -0500] rev 30496
keepalive: discard legacy Python support for error handling We never changed the behavior defined by this attribute anyway, so just jettison all of this support.
Mon, 21 Nov 2016 21:52:19 -0500 mergemod: drop support for merge.update without a target
Augie Fackler <augie@google.com> [Mon, 21 Nov 2016 21:52:19 -0500] rev 30495
mergemod: drop support for merge.update without a target This was to be deleted after 3.9.
Mon, 21 Nov 2016 21:51:23 -0500 dispatch: stop supporting non-use of @command
Augie Fackler <augie@google.com> [Mon, 21 Nov 2016 21:51:23 -0500] rev 30494
dispatch: stop supporting non-use of @command We said we'd delete this after 3.8. It's time.
Mon, 21 Nov 2016 20:12:51 -0800 httppeer: document why super() isn't used
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 21 Nov 2016 20:12:51 -0800] rev 30493
httppeer: document why super() isn't used Adding a follow-up to document lack of super() per Augie's request.
Thu, 17 Nov 2016 00:59:41 -0800 exchange: add `_getbookmarks()` function
Stanislau Hlebik <stash@fb.com> [Thu, 17 Nov 2016 00:59:41 -0800] rev 30492
exchange: add `_getbookmarks()` function This function will be used to generate bookmarks bundle2 part. It is a separate function in order to make it easy to overwrite it in extensions. Passing `kwargs` to the function makes it easy to add new parameters in extensions.
Thu, 17 Nov 2016 00:59:41 -0800 bookmarks: use listbinbookmarks() in listbookmarks()
Stanislau Hlebik <stash@fb.com> [Thu, 17 Nov 2016 00:59:41 -0800] rev 30491
bookmarks: use listbinbookmarks() in listbookmarks()
Thu, 17 Nov 2016 00:59:41 -0800 bookmarks: introduce listbinbookmarks()
Stanislau Hlebik <stash@fb.com> [Thu, 17 Nov 2016 00:59:41 -0800] rev 30490
bookmarks: introduce listbinbookmarks() `bookmarks` bundle2 part will work with binary nodes. To avoid unnecessary conversions between binary and hex nodes let's add `listbinbookmarks()` that returns binary nodes. For now this function is a copy-paste of listbookmarks(). In the next patch this copy-paste will be removed.
Mon, 21 Nov 2016 16:22:26 -0800 ui: add configoverride context manager
Kostia Balytskyi <ikostia@fb.com> [Mon, 21 Nov 2016 16:22:26 -0800] rev 30489
ui: add configoverride context manager I feel like this idea might've been discussed before, so please feel free to point me to the right mailing list entry to read about why it should not be done. We have a common pattern of the following code: backup = ui.backupconfig(section, name) try: ui.setconfig(section, name, temporaryvalue, source) do_something() finally: ui.restoreconfig(backup) IMO, this looks better: with ui.configoverride({(section, name): temporaryvalue}, source): do_something() Especially this becomes more convenient when one has to backup multiple config values before doing something. In such case, adding a new value to backup requires codemod in three places.
Mon, 21 Nov 2016 18:17:02 -0500 archival: simplify code and drop message about Python 2.5
Augie Fackler <augie@google.com> [Mon, 21 Nov 2016 18:17:02 -0500] rev 30488
archival: simplify code and drop message about Python 2.5
Mon, 21 Nov 2016 17:52:32 -0500 bugzilla: stop mentioning Pythons older than 2.6
Augie Fackler <augie@google.com> [Mon, 21 Nov 2016 17:52:32 -0500] rev 30487
bugzilla: stop mentioning Pythons older than 2.6 We don't support those anyway.
Mon, 21 Nov 2016 17:51:39 -0500 tests: update sitecustomize to use uuid1() instead of randrange()
Augie Fackler <augie@google.com> [Mon, 21 Nov 2016 17:51:39 -0500] rev 30486
tests: update sitecustomize to use uuid1() instead of randrange() The comments mention that uuid would be better, so let's go ahead and make good on an old idea.
Mon, 21 Nov 2016 17:48:13 -0500 win32mbcs: drop code that was catering to Python 2.3 and earlier
Augie Fackler <augie@google.com> [Mon, 21 Nov 2016 17:48:13 -0500] rev 30485
win32mbcs: drop code that was catering to Python 2.3 and earlier
Mon, 21 Nov 2016 17:47:11 -0500 httppeer: drop an except block that says it happens only on Python 2.3
Augie Fackler <augie@google.com> [Mon, 21 Nov 2016 17:47:11 -0500] rev 30484
httppeer: drop an except block that says it happens only on Python 2.3
Fri, 21 Oct 2016 00:03:46 +0900 windows: do not replace sys.stdout by winstdout
Yuya Nishihara <yuya@tcha.org> [Fri, 21 Oct 2016 00:03:46 +0900] rev 30483
windows: do not replace sys.stdout by winstdout Now we use util.stdout everywhere.
Thu, 20 Oct 2016 23:53:36 +0900 py3: bulk replace sys.stdin/out/err by util's
Yuya Nishihara <yuya@tcha.org> [Thu, 20 Oct 2016 23:53:36 +0900] rev 30482
py3: bulk replace sys.stdin/out/err by util's Almost all sys.stdin/out/err in hgext/ and mercurial/ are replaced by util's. There are a few exceptions: - lsprof.py and statprof.py are untouched since they are a kind of vendor code and they never import mercurial modules right now. - ui._readline() needs to replace sys.stdin and stdout to pass them to raw_input(). We'll need another workaround here.
Thu, 20 Oct 2016 23:40:24 +0900 py3: provide bytes stdin/out/err through util module
Yuya Nishihara <yuya@tcha.org> [Thu, 20 Oct 2016 23:40:24 +0900] rev 30481
py3: provide bytes stdin/out/err through util module Since standard streams are TextIO on Python 3, we can't use sys.stdin/out/err directly. Fortunately we can get the underlying BytesIO via .buffer as long as the streams aren't replaced by e.g. StringIO. stdin/out/err are provided through util so we can wrap them by platform API.
Fri, 21 Oct 2016 00:09:38 +0900 util: rewrite pycompat imports to make pyflakes always happy
Yuya Nishihara <yuya@tcha.org> [Fri, 21 Oct 2016 00:09:38 +0900] rev 30480
util: rewrite pycompat imports to make pyflakes always happy I'll add more imports which would confuse pyflakes.
Thu, 20 Oct 2016 23:27:09 +0900 windows: do not replace sys.__stdout__
Yuya Nishihara <yuya@tcha.org> [Thu, 20 Oct 2016 23:27:09 +0900] rev 30479
windows: do not replace sys.__stdout__ Now we don't use sys.__stdout__ except for getting its fileno(), so we no longer have to wrap it by winstdout. This helps adding pycompat.stdin/out/err.
Mon, 21 Nov 2016 15:38:56 +0530 py3: update test-check-py3-compat.t output
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 21 Nov 2016 15:38:56 +0530] rev 30478
py3: update test-check-py3-compat.t output This part remains unchanged because it runs in Python 3 only.
Mon, 21 Nov 2016 15:35:22 +0530 py3: use pycompat.sysargv in dispatch.run()
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 21 Nov 2016 15:35:22 +0530] rev 30477
py3: use pycompat.sysargv in dispatch.run() Another one to have a bytes result from sys.argv in Python 3. This one is also a part of running `hg version` on Python 3.
Mon, 21 Nov 2016 15:26:47 +0530 py3: use pycompat.sysargv in scmposix.systemrcpath()
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 21 Nov 2016 15:26:47 +0530] rev 30476
py3: use pycompat.sysargv in scmposix.systemrcpath() sys.argv returns unicodes on Python 3. We have pycompat.sysargv which returns bytes encoded using os.fsencode(). After this patch scmposix.systemrcpath() returns bytes in Python 3 world. This change is also a part of making `hg version` run in Python 3.
Sun, 20 Nov 2016 13:50:45 -0800 wireproto: perform chunking and compression at protocol layer (API)
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 20 Nov 2016 13:50:45 -0800] rev 30475
wireproto: perform chunking and compression at protocol layer (API) Currently, the "streamres" response type is populated with a generator of chunks with compression possibly already applied. This puts the onus on commands to perform chunking and compression. Architecturally, I think this is the wrong place to perform this work. I think commands should say "here is the data" and the protocol layer should take care of encoding the final bytes to put on the wire. Additionally, upcoming commits will improve wire protocol support for compression. Having a central place for performing compression in the protocol transport layer will be easier than having to deal with compression at the commands layer. This commit refactors the "streamres" response type to accept either a generator or an object with "read." Additionally, the type now accepts a flag indicating whether the response is a "version 1 compressible" response. This basically identifies all commands currently performing compression. I could have used a special type for this, but a flag works just as well. The argument name foreshadows the introduction of wire protocol changes, hence the "v1." The code for chunking and compressing has been moved to the output generation function for each protocol transport. Some code has been inlined, resulting in the deletion of now unused methods.
Sun, 20 Nov 2016 13:55:53 -0800 httppeer: use compression engine API for decompressing responses
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 20 Nov 2016 13:55:53 -0800] rev 30474
httppeer: use compression engine API for decompressing responses In preparation for supporting multiple compression formats on the wire protocol, we need all users of the wire protocol to use compression engine APIs. This commit ports the HTTP wire protocol client to use the compression engine API. The code for handling the HTTPException is a bit hacky. Essentially, HTTPException could be thrown by any read() from the socket. However, as part of porting the API, we no longer have a generator wrapping the socket and we don't have a single place where we can trap the exception. We solve this by introducing a proxy class that intercepts read() and converts the exception appropriately. In the future, we could introduce a new compression engine API that supports emitting a generator of decompressed chunks. This would eliminate the need for the proxy class. As I said when I introduced the decompressorreader() API, I'm not fond of it and would support transitioning to something better. This can be done as a follow-up, preferably once all the code is using the compression engine API and we have a better idea of the API needs of all the consumers.
Sat, 19 Nov 2016 18:31:40 -0800 httppeer: do decompression inside _callstream
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 19 Nov 2016 18:31:40 -0800] rev 30473
httppeer: do decompression inside _callstream The current HTTP transport protocol only compresses certain command responses and requires calls to that command to call "_callcompressable," which zlib decompresses the response transparently. Upcoming changes will enable *any* response to be compressed with varying compression formats. In order to handle this better, this commit moves the decompression bits to the main function performing the HTTP request. We introduce an underscore-prefixed argument to denote this behavior so it doesn't conflict with a named argument to a command.
Sat, 19 Nov 2016 17:11:12 -0800 keepalive: reorder header precedence
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 19 Nov 2016 17:11:12 -0800] rev 30472
keepalive: reorder header precedence There are 3 sources of headers used by this function: * The default headers defined by the URL opener * Headers that are copied on redirects * Headers that aren't copied on redirects Previously, we applied the default headers from the URL opener last. This feels wrong to me as those headers are the most low level and something built on top of the URL opener may wish to override them. So, this commit changes the order to apply them with the least precedence. While I was here, I removed a Python version test that is no longer necessary.
Sat, 19 Nov 2016 10:54:21 -0800 debuginstall: print compression engine support
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 19 Nov 2016 10:54:21 -0800] rev 30471
debuginstall: print compression engine support Since compression engines may be provided by extensions and since not all registered compression engines may be available to use, it seems useful to provide a mechanism to see the state of known compression engines. This commit teaches `hg debuginstall` to print info on known and available compression engines.
Sun, 20 Nov 2016 16:56:21 -0800 bdiff: don't check border condition in loop
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 20 Nov 2016 16:56:21 -0800] rev 30470
bdiff: don't check border condition in loop This is pretty much a copy of d500ddae7494, just to a different loop. The condition `p == plast` (`plast == a + len - 1`) was only true on the final iteration of the loop. So it was wasteful to check for it on every iteration. We decrease the iteration count by 1 and add an explicit check for `p == plast` after the loop. Again, we see modest wins. From the mozilla-unified repository: $ perfbdiff -m 3041e4d59df2 ! wall 0.035502 comb 0.040000 user 0.040000 sys 0.000000 (best of 100) ! wall 0.030480 comb 0.030000 user 0.030000 sys 0.000000 (best of 100) $ perfbdiff 0e9928989e9c --alldata --count 100 ! wall 4.097394 comb 4.100000 user 4.100000 sys 0.000000 (best of 3) ! wall 3.597798 comb 3.600000 user 3.600000 sys 0.000000 (best of 3) The 2nd example throws a total of ~3.3GB of data at bdiff. This change increases the throughput from ~811 MB/s to ~924 MB/s.
Sat, 19 Nov 2016 15:41:37 -0800 conflicts: make spacing consistent in conflict markers
Kostia Balytskyi <ikostia@fb.com> [Sat, 19 Nov 2016 15:41:37 -0800] rev 30469
conflicts: make spacing consistent in conflict markers The way default marker template was defined before this patch, the spacing before dash in conflict markes was dependent on whether changeset is a tip one or not. This is a relevant part of template: '{ifeq(tags, "tip", "", "{tags} "}' If revision is a tip revision with no other tags, this would resolve to an empty string, but for revisions which are not tip and don't have any other tags, this would resolve to a single space string. In the end this causes weirdnesses like the ones you can see in the affected tests. This is a not a big deal, but double spacing may be visually less pleasant. Please note that test changes where commit hashes change are the result of marking files as resolved without removing markers.
Thu, 10 Nov 2016 09:21:41 -0800 rebase: move bookmark update to before rebase clearing
Durham Goode <durham@fb.com> [Thu, 10 Nov 2016 09:21:41 -0800] rev 30468
rebase: move bookmark update to before rebase clearing Bookmark fixing should probably happen before the rebase starts to clean up, so let's move it before clearrebased. This will also help a future patch where we want to add more clear logic to the existing clear section.
Fri, 28 Oct 2016 17:44:28 +0200 setup: include a dummy $PATH in the custom environment used by build.py
Gábor Stefanik <gabor.stefanik@nng.com> [Fri, 28 Oct 2016 17:44:28 +0200] rev 30467
setup: include a dummy $PATH in the custom environment used by build.py This is required for building with pypiwin32, the pip-installable replacement for pywin32.
Fri, 11 Nov 2016 07:01:27 -0800 shelve: move unshelve-finishing logic to a separate function
Kostia Balytskyi <ikostia@fb.com> [Fri, 11 Nov 2016 07:01:27 -0800] rev 30466
shelve: move unshelve-finishing logic to a separate function Finishing unshelve involves two steps now: - stripping a changelog - aborting a transaction Obs-based shelve will not require these things, so isolating this logic into a separate function where the normal/obs-shelve branching is going to be implemented seems to be like a nice idea. Behavior-wise this change moves 'unshelvecleanup' from being between changelog stripping and transaction abortion to being after them. I don't think this has any negative effects.
Thu, 10 Nov 2016 11:02:39 -0800 shelve: move file-forgetting logic to a separate function
Kostia Balytskyi <ikostia@fb.com> [Thu, 10 Nov 2016 11:02:39 -0800] rev 30465
shelve: move file-forgetting logic to a separate function This is just a readability improvement.
Thu, 10 Nov 2016 10:57:10 -0800 shelve: move rebasing logic to a separate function
Kostia Balytskyi <ikostia@fb.com> [Thu, 10 Nov 2016 10:57:10 -0800] rev 30464
shelve: move rebasing logic to a separate function Rebasing restored shelved commit onto the right destination is done differently in traditional and obs-based unshelve: - for traditional, we just rebase it - for obs-based, we need to check whether a successor of the restored commit already exists in the destination (this might happen when unshelving twice on the same destination) This is the reason why this piece of logic should be in its own function: to not have excessive complexity in the main function.
Thu, 10 Nov 2016 10:51:06 -0800 shelve: move commit restoration logic to a separate function
Kostia Balytskyi <ikostia@fb.com> [Thu, 10 Nov 2016 10:51:06 -0800] rev 30463
shelve: move commit restoration logic to a separate function
Sun, 13 Nov 2016 03:35:52 -0800 shelve: move temporary commit creation to a separate function
Kostia Balytskyi <ikostia@fb.com> [Sun, 13 Nov 2016 03:35:52 -0800] rev 30462
shelve: move temporary commit creation to a separate function Committing working copy changes before rebasing a shelved commit on top of them is an independent piece of behavior, which fits into its own function. Similar to the previous series, this and a couple of following patches are for unshelve refactoring.
Thu, 17 Nov 2016 20:30:00 -0800 commands: print chunk type in debugrevlog
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 17 Nov 2016 20:30:00 -0800] rev 30461
commands: print chunk type in debugrevlog Each data entry ("chunk") in a revlog has a type based on the first byte of the data. This type indicates how to interpret the data. This seems like a useful thing to be able to query through a debug command. So let's add that to `hg debugrevlog`. This does make `hg debugrevlog` slightly slower, as it has to read more than just the index. However, even on the mozilla-unified manifest (which is ~200MB spread over ~350K revisions), this takes <400ms.
Thu, 17 Nov 2016 20:17:51 -0800 perf: add command for measuring revlog chunk operations
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 17 Nov 2016 20:17:51 -0800] rev 30460
perf: add command for measuring revlog chunk operations Upcoming commits will teach revlogs to leverage the new compression engine API so that new compression formats can more easily be leveraged in revlogs. We want to be sure this refactoring doesn't regress performance. So this commit introduces "perfrevchunks" to explicitly test performance of reading, decompressing, and recompressing revlog chunks. Here is output when run on the mozilla-unified repo: $ hg perfrevlogchunks -c ! read ! wall 0.346603 comb 0.350000 user 0.340000 sys 0.010000 (best of 28) ! read w/ reused fd ! wall 0.337707 comb 0.340000 user 0.320000 sys 0.020000 (best of 30) ! read batch ! wall 0.013206 comb 0.020000 user 0.000000 sys 0.020000 (best of 221) ! read batch w/ reused fd ! wall 0.013259 comb 0.030000 user 0.010000 sys 0.020000 (best of 222) ! chunk ! wall 1.909939 comb 1.910000 user 1.900000 sys 0.010000 (best of 6) ! chunk batch ! wall 1.750677 comb 1.760000 user 1.740000 sys 0.020000 (best of 6) ! compress ! wall 5.668004 comb 5.670000 user 5.670000 sys 0.000000 (best of 3) $ hg perfrevlogchunks -m ! read ! wall 0.365834 comb 0.370000 user 0.350000 sys 0.020000 (best of 26) ! read w/ reused fd ! wall 0.350160 comb 0.350000 user 0.320000 sys 0.030000 (best of 28) ! read batch ! wall 0.024777 comb 0.020000 user 0.000000 sys 0.020000 (best of 119) ! read batch w/ reused fd ! wall 0.024895 comb 0.030000 user 0.000000 sys 0.030000 (best of 118) ! chunk ! wall 2.514061 comb 2.520000 user 2.480000 sys 0.040000 (best of 4) ! chunk batch ! wall 2.380788 comb 2.380000 user 2.360000 sys 0.020000 (best of 5) ! compress ! wall 9.815297 comb 9.820000 user 9.820000 sys 0.000000 (best of 3) We already see some interesting data, such as how much slower non-batched chunk reading is and that zlib compression appears to be >2x slower than decompression. I didn't have the data when I wrote this commit message, but I ran this on Mozilla's NFS-based Mercurial server and the time for reading with a reused file descriptor was faster. So I think it is worth testing both with and without file descriptor reuse so we can make informed decisions about recycling file descriptors.
Thu, 17 Nov 2016 20:09:10 -0800 setup: add flag to build_ext to control building zstd
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 17 Nov 2016 20:09:10 -0800] rev 30459
setup: add flag to build_ext to control building zstd Downstream packagers will inevitably want to disable building the vendored python-zstandard Python package. Rather than force them to patch setup.py, let's give them a knob to use. distutils Command classes support defining custom options. It requires setting certain class attributes (yes, class attributes: instance attributes don't work because the class type is consulted before it is instantiated). We already have a custom child class of build_ext, so we set these class attributes, implement some scaffolding, and override build_extensions to filter the Extension instance for the zstd extension if the `--no-zstd` argument is specified. Example usage: $ python setup.py build_ext --no-zstd
Wed, 09 Nov 2016 16:01:34 +0000 drawdag: update test repos by drawing the changelog DAG in ASCII
Jun Wu <quark@fb.com> [Wed, 09 Nov 2016 16:01:34 +0000] rev 30458
drawdag: update test repos by drawing the changelog DAG in ASCII Currently, we have "debugbuilddag" which is a powerful tool to build test cases but not intuitive. We may end up running "hg log" in the test to make the test more readable. This patch adds a "drawdag" extension with a "debugdrawdag" command for similar testing purpose. Unlike the cryptic "debugbuilddag" command, it reads an ASCII graph that is intuitive to human, so the test case can be more readable. Unlike "debugbuilddag", "drawdag" does not require an empty repo. So it can be used to add new changesets to an existing repo. Since the "drawdag" logic is not that trivial and only makes sense for testing purpose, the extension is added to the "tests" directory, to make the core logic clean. If we find it useful (for example, to demonstrate cases and help user understand some cases) and want to ship it by default in the future, we can move it to a ship-by-default "debugdrawdag" at that time.
(0) -30000 -10000 -3000 -1000 -300 -100 -60 +60 +100 +300 +1000 +3000 +10000 tip