Sun, 11 Feb 2018 17:07:09 +0530 py3: replace file() with open() in test-mactext.t
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:07:09 +0530] rev 36061
py3: replace file() with open() in test-mactext.t file() is not present in Python 3. This patch also adds a b'' prefix to make sure we write bytes in Python 3. Differential Revision: https://phab.mercurial-scm.org/D2122
Sun, 11 Feb 2018 17:06:04 +0530 py3: replace file() with open() in test-mq-missingfiles.t
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:06:04 +0530] rev 36060
py3: replace file() with open() in test-mq-missingfiles.t file() is not present in Python 3. Differential Revision: https://phab.mercurial-scm.org/D2121
Sun, 11 Feb 2018 17:04:21 +0530 py3: replace file() with open() in test-mq-qimport.t
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:04:21 +0530] rev 36059
py3: replace file() with open() in test-mq-qimport.t file() is not present in Python 3. Differential Revision: https://phab.mercurial-scm.org/D2120
Sun, 11 Feb 2018 17:03:50 +0530 py3: replace file() with open() in test-patch-offset.t
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:03:50 +0530] rev 36058
py3: replace file() with open() in test-patch-offset.t file() is not present in Python 3. Differential Revision: https://phab.mercurial-scm.org/D2119
Sun, 11 Feb 2018 17:03:17 +0530 py3: replace file() with open() in test-relink.t
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:03:17 +0530] rev 36057
py3: replace file() with open() in test-relink.t file() is not present in Python 3. This patch also adds a b'' prefix to make sure we write bytes in Python 3. Differential Revision: https://phab.mercurial-scm.org/D2118
Sun, 11 Feb 2018 17:02:14 +0530 py3: replace file() with open() in test-subrepo-missing.t
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:02:14 +0530] rev 36056
py3: replace file() with open() in test-subrepo-missing.t file() is not present in Python 3. This patch also adds a b'' prefix to make sure we write bytes in Python 3. Differential Revision: https://phab.mercurial-scm.org/D2117
Sun, 11 Feb 2018 17:01:25 +0530 py3: replace file() with open() in test-tag.t
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:01:25 +0530] rev 36055
py3: replace file() with open() in test-tag.t file() is not present in Python 3. Differential Revision: https://phab.mercurial-scm.org/D2116
Sun, 11 Feb 2018 17:00:21 +0530 py3: replace file() with open() in test-transplant.t
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:00:21 +0530] rev 36054
py3: replace file() with open() in test-transplant.t file() is not present in Python 3. This patch also adds a b'' prefix to make sure we write bytes in Python 3. Differential Revision: https://phab.mercurial-scm.org/D2115
Sun, 11 Feb 2018 16:59:35 +0530 py3: replace file() with open() in test-walk.t
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 16:59:35 +0530] rev 36053
py3: replace file() with open() in test-walk.t file() is not present in Python 3. This patch also adds a b'' prefix to make sure we write bytes in Python 3. Differential Revision: https://phab.mercurial-scm.org/D2114
Sun, 11 Feb 2018 16:58:22 +0530 py3: replace file() with open() in test-win32text.t
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 16:58:22 +0530] rev 36052
py3: replace file() with open() in test-win32text.t This patch also adds b'' prefix to make sure we write bytes on Python 3. Differential Revision: https://phab.mercurial-scm.org/D2113
Sun, 11 Feb 2018 16:56:47 +0530 py3: replace file() with open() in test-convert-p4-filetypes.t
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 16:56:47 +0530] rev 36051
py3: replace file() with open() in test-convert-p4-filetypes.t file() is not present in Python 3. While I was here, I added b'' prefix to make sure we write things correctly in Python 3. Differential Revision: https://phab.mercurial-scm.org/D2112
Sun, 11 Feb 2018 17:30:42 +0530 py3: replace file() with open() in test-convert-mtn.t
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:30:42 +0530] rev 36050
py3: replace file() with open() in test-convert-mtn.t While I was here, I added b'' prefixes to make sure we write things correctly in bytes mode on Python 3. Differential Revision: https://phab.mercurial-scm.org/D2111
Sun, 11 Feb 2018 17:30:21 +0530 py3: replace file() with open() in test-clone.t
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:30:21 +0530] rev 36049
py3: replace file() with open() in test-clone.t While I was here, I made sure we write things correctly in bytes mode. Differential Revision: https://phab.mercurial-scm.org/D2110
Tue, 06 Feb 2018 22:55:02 +0900 merge: cut import cycle at merge -> extensions
Yuya Nishihara <yuya@tcha.org> [Tue, 06 Feb 2018 22:55:02 +0900] rev 36048
merge: cut import cycle at merge -> extensions This seems less bad because checking fsmonitor looks like a temporary hack, and cmdutil -> mergemod should be a valid dependency.
Tue, 06 Feb 2018 22:36:38 +0900 subrepo: split non-core functions to new module
Yuya Nishihara <yuya@tcha.org> [Tue, 06 Feb 2018 22:36:38 +0900] rev 36047
subrepo: split non-core functions to new module Resolves import cycle caused by subrepo -> cmdutil. Still we have another cycle, cmdutil -> context -> subrepo, but where I think importing context is wrong. Perhaps we'll need repo.makememctx().
Wed, 07 Feb 2018 23:22:53 +0900 diff: remove fp.write() wrapper which drops label argument
Yuya Nishihara <yuya@tcha.org> [Wed, 07 Feb 2018 23:22:53 +0900] rev 36046
diff: remove fp.write() wrapper which drops label argument It's no longer needed since we've split labeled write() from file-like write().
Sun, 21 Jan 2018 15:54:18 +0900 log: pack filematcher and hunksfilter into changesetdiffer object
Yuya Nishihara <yuya@tcha.org> [Sun, 21 Jan 2018 15:54:18 +0900] rev 36045
log: pack filematcher and hunksfilter into changesetdiffer object This is just a way of getting rid of clumsy makefilematcher/makehunksfilter arguments. There might be a better abstraction, but I don't think this is bad. This makes filematcher and hunksfilter available by default, but that should be fine.
Sun, 21 Jan 2018 15:50:24 +0900 log: drop dead code to concatenate --line-range patterns and pats
Yuya Nishihara <yuya@tcha.org> [Sun, 21 Jan 2018 15:50:24 +0900] rev 36044
log: drop dead code to concatenate --line-range patterns and pats It's disabled since 2e45bbd3db7b, and the current implementation is unlikely to be reused.
Sun, 21 Jan 2018 15:34:37 +0900 logcmdutil: create hunksfilter and filematcher even if no diff option given
Yuya Nishihara <yuya@tcha.org> [Sun, 21 Jan 2018 15:34:37 +0900] rev 36043
logcmdutil: create hunksfilter and filematcher even if no diff option given It's okay since 5fe6f946f111, "log: allow matchfn to be non-null even if both --patch/--stat are off."
Sun, 21 Jan 2018 14:37:04 +0900 logcmdutil: unindent diff generator of changesetprinter
Yuya Nishihara <yuya@tcha.org> [Sun, 21 Jan 2018 14:37:04 +0900] rev 36042
logcmdutil: unindent diff generator of changesetprinter Prepares for the next few patches which will make matchfn and hunksfilterfn always available.
Sun, 21 Jan 2018 14:07:52 +0900 logcmdutil: hold makefilematcher/makehunksfilter() by changesetpriner (API)
Yuya Nishihara <yuya@tcha.org> [Sun, 21 Jan 2018 14:07:52 +0900] rev 36041
logcmdutil: hold makefilematcher/makehunksfilter() by changesetpriner (API) This merges self.matchfn and self.show(matchfn) into self._makefilematcher, and does the same for hunksfilter. Because changesetprinter seems to have too many optional arguments, makefilematcher() and makehunksfilter() will be packed into one object by later patch.
Sun, 21 Jan 2018 13:40:31 +0900 log: pass ctx to makefilematcher() and makehunksfilter() functions
Yuya Nishihara <yuya@tcha.org> [Sun, 21 Jan 2018 13:40:31 +0900] rev 36040
log: pass ctx to makefilematcher() and makehunksfilter() functions This isn't important, but seems more consistent as changesetprinter.show() takes a ctx, not a revision number.
Sat, 27 Jan 2018 19:02:33 -0500 lfs: teach the 'lfs()' fileset to handle removed files
Matt Harbison <matt_harbison@yahoo.com> [Sat, 27 Jan 2018 19:02:33 -0500] rev 36039
lfs: teach the 'lfs()' fileset to handle removed files The callstatus setting is required to notice the removal of 'lfs.test' in rev 6 in the tests, even though this isn't directly calling mctx.status(). However, it's not needed to get the results in the tests for `hg status`, so I'm probably missing something.
Sat, 27 Jan 2018 19:22:15 -0500 lfs: teach '{lfs_files}' to handle removed files
Matt Harbison <matt_harbison@yahoo.com> [Sat, 27 Jan 2018 19:22:15 -0500] rev 36038
lfs: teach '{lfs_files}' to handle removed files
Sat, 27 Jan 2018 18:56:24 -0500 lfs: allow a pointer to be extracted from a context that removes the file
Matt Harbison <matt_harbison@yahoo.com> [Sat, 27 Jan 2018 18:56:24 -0500] rev 36037
lfs: allow a pointer to be extracted from a context that removes the file This is needed to let 'set:lfs()' and '{lfs_files}' work normally on removed files. Yuya suggested returning a null pointer for removed files, instead of the pointer from the parent. The first attempt at this was to return None for a non LFS file, and a (pointer, ctx) tuple to hold the pointer and context (or parent pointer and context for a removed file). But this complicated the callers, even the ones that didn't care about removed files. Instead, let's use {} to represent a removed pointer. This has the added convenience of being a useful representation in the template language, and only affects the callers that care about removed files (and only slightly). Since pointers are explicitly serialized with a call to a member function, there is no danger of writing these to disk.
Sat, 10 Feb 2018 19:33:19 +0100 rebase: make "successors" a set in _computeobsoletenotrebased()
Denis Laxalde <denis@laxalde.org> [Sat, 10 Feb 2018 19:33:19 +0100] rev 36036
rebase: make "successors" a set in _computeobsoletenotrebased() There's no apparent reason for this variable to be a list and this avoids converting it to a set when needed.
Sat, 10 Feb 2018 21:14:41 +0900 merge with stable
Yuya Nishihara <yuya@tcha.org> [Sat, 10 Feb 2018 21:14:41 +0900] rev 36035
merge with stable
Fri, 09 Feb 2018 22:49:20 +0100 rebase: do not consider extincts for divergence detection (issue5782)
Denis Laxalde <denis@laxalde.org> [Fri, 09 Feb 2018 22:49:20 +0100] rev 36034
rebase: do not consider extincts for divergence detection (issue5782) Extinct obsolete changesets cannot cause divergence upon rebase. We compute these obsoletes without a non-obsolete successor (extincts) in _computeobsoletenotrebased() and then filter them out from the set of obsolete revisions to rebase before getting into _checkobsrebase() to check for divergence candidates.
Fri, 09 Feb 2018 21:45:16 +0100 rebase: eliminate node from successors early in _computeobsoletenotrebased()
Denis Laxalde <denis@laxalde.org> [Fri, 09 Feb 2018 21:45:16 +0100] rev 36033
rebase: eliminate node from successors early in _computeobsoletenotrebased()
Wed, 07 Feb 2018 12:06:13 +0100 rebase: add a test case for issue5782
Denis Laxalde <denis.laxalde@logilab.fr> [Wed, 07 Feb 2018 12:06:13 +0100] rev 36032
rebase: add a test case for issue5782 Issue 5782 reports that rebase incorrectly aborts when trying to rebase an extinct revision (an obsolete revision with only obsolete successor). We add a test to demonstrate this: the first "hg rebase" command aborts with the divergence warning while, when allowing divergence, the rebase completes and does not actually produce any divergence.
Fri, 09 Feb 2018 13:18:17 +0100 test: glob the temporary directory out of temporary file path
Boris Feld <boris.feld@octobus.net> [Fri, 09 Feb 2018 13:18:17 +0100] rev 36031
test: glob the temporary directory out of temporary file path The temporary directory used by python might be outside of '/tmp/' (eg: /dev/shm/) so we glob that part out.
Fri, 09 Feb 2018 12:48:12 +0100 tests: raise a better error when patterns are wrongly formatted
Boris Feld <boris.feld@octobus.net> [Fri, 09 Feb 2018 12:48:12 +0100] rev 36030
tests: raise a better error when patterns are wrongly formatted It is fairly easy to make mistakes when merging conflict in the pattern file. A common mistake is to forget adding an extra trailing comma changing the length of the tuple. We now detect such error and raise a better error message that helps to find it.
Sat, 27 Jan 2018 17:58:19 -0500 lfs: add a fileset for detecting lfs files
Matt Harbison <matt_harbison@yahoo.com> [Sat, 27 Jan 2018 17:58:19 -0500] rev 36029
lfs: add a fileset for detecting lfs files This currently has the same limitation as {lfs_files}, namely it doesn't report removed files. We may want a dedicated 'lfs()' revset for efficiency, but combining this with the 'contains()' revset should be equivalent for now. Combining with 'set:added()' or 'set:modified()' inside 'files()' should be equivalent to a hypothetical lfs_adds() and lfs_modifies(). I wonder if there's a way to tweak the filesets to evaluate lazily, to close the efficiency gap. It would also be interesting to come up with a template filter for '{files}' that looked at the pattern to 'files()', and filtered appropriately. While passing a fileset as the pattern to `hg log` does filter '{files}', the set is evaluated against the working directory, so there's no way to list all non-lfs files above a certain size in all revisions, for example.
Wed, 07 Feb 2018 23:42:48 -0500 tests: stabilize ssh tests on Windows
Matt Harbison <matt_harbison@yahoo.com> [Wed, 07 Feb 2018 23:42:48 -0500] rev 36028
tests: stabilize ssh tests on Windows This seems like a somewhat common type of failure (double vs single quote), so I'm interested in ideas about how to avoid this. I doubt that we should automatically fall back from single quote to double quote, like with '/' vs '\'.
Thu, 01 Feb 2018 08:54:48 -0800 wireprotoserver: rename abstractserverproto and improve docstring
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 01 Feb 2018 08:54:48 -0800] rev 36027
wireprotoserver: rename abstractserverproto and improve docstring The docstring isn't completely accurate for the current state of the world. But it does describe the direction future patches will be taking things. Differential Revision: https://phab.mercurial-scm.org/D2065
Thu, 01 Feb 2018 16:11:54 -0800 wireprotoserver: document and improve the httplib workaround
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 01 Feb 2018 16:11:54 -0800] rev 36026
wireprotoserver: document and improve the httplib workaround This workaround dates all the way back to a42d27bc809d in 2008. The code is esoteric enough to warrant an inline explanation. So I've added one. At the time the code was written, the only wire protocol command that accepted an HTTP request body was "unbundle." In the years since, we've grown the ability to accept command arguments via HTTP POST requests. So, the code has been changed to apply the httplib workaround to all HTTP POST requests. While staring at this code, I realized that the HTTP response body in case of error is always the same. And, it appears to mimic the behavior of a failed call to the "unbundle" command. Since we can hit this code path on theoretically any protocol request (since self.check_perm accepts custom auth checking functions which may raise), I'm having a hard time believing that clients react well to an "unbundle" response payload on any wire protocol command. I wouldn't be surprised if our test coverage for this feature only covers HTTP POST calls to "unbundle." In other words, the experimental support for sending arguments via HTTP POST request bodies may result in badness on the client. Something to investigate another time perhaps... Differential Revision: https://phab.mercurial-scm.org/D2064
Wed, 31 Jan 2018 17:34:45 -0800 wireprotoserver: move error response handling out of hgweb
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 31 Jan 2018 17:34:45 -0800] rev 36025
wireprotoserver: move error response handling out of hgweb The exception handler for ErrorResponse has more to do with the wire protocol than the generic HTTP server. Move the code so it lives alongside other wire protocol code. Differential Revision: https://phab.mercurial-scm.org/D2021
Wed, 31 Jan 2018 16:43:46 -0800 hgweb: move call to protocol handler outside of try..except
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 31 Jan 2018 16:43:46 -0800] rev 36024
hgweb: move call to protocol handler outside of try..except The protocol handler doesn't raise ErrorResponse. So it doesn't need to be in this `try..except ErrorResponse` block. Differential Revision: https://phab.mercurial-scm.org/D2020
Wed, 31 Jan 2018 16:21:43 -0800 wireprotoserver: move protocol parsing and dispatch out of hgweb
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 31 Jan 2018 16:21:43 -0800] rev 36023
wireprotoserver: move protocol parsing and dispatch out of hgweb Previously, hgweb_mod had code for detecting if the request was for the wire protocol. It would then (eventually) call wireprotoserver.callhttp() to dispatch the request handling. Detection of wire protocol requests is not trivial. There's currently a big gotcha in the handling of the "cmd" request parameter, for example. Furthermore, in the near future we will have a second HTTP protocol handler. Its mechanism for calling commands will be a bit different. And we don't want the low-level logic for detecting protocol commands to live in hgweb. We establish a new function in wireprotoserver for detecting an HTTP protocol request and for giving the caller an easy-to-use mechanism for dispatching requests to it. Some wire protocol specific functionality still lives in hgweb. This will be addressed in subsequent commits. Differential Revision: https://phab.mercurial-scm.org/D2019
Thu, 01 Feb 2018 18:48:52 -0800 largefiles: register wire protocol commands with modern APIs
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 01 Feb 2018 18:48:52 -0800] rev 36022
largefiles: register wire protocol commands with modern APIs The wireproto.wireprotocommand decorator is the preferred mechanism for registering wire protocol commands. In addition, wireproto.commands is no longer a 2-tuple and use of that 2-tuple API should be considered deprecated. This commit ports largefiles to use wireproto.wireprotocommand() and ports to the "commandentry" API. As part of this, the definition of the "lheads" wire protocol command is moved to the proper stanza. We stop short of actually using wireprotocommand as a decorator in order to minimize churn. We should ideally move wire protocol commands to the registrar mechanism. But that's for another changeset. Differential Revision: https://phab.mercurial-scm.org/D2018
Tue, 30 Jan 2018 18:41:44 -0800 wireproto: function for testing if wire protocol command is available
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 30 Jan 2018 18:41:44 -0800] rev 36021
wireproto: function for testing if wire protocol command is available Currently, we perform simple membership testing for whether a wire command is available. In the future, not all wire protocol commands will be available on all transports. For example, a legacy transport may not support newer commands. In preparation of this, teach the protocol handlers to call into a function to determine if a wire protocol command is available. That function currently does membership testing like before, so behavior should be identical. In the case of the HTTP server, behavior is a bit wonkier. "cmd" is used by both the wire protocol and hgweb. We do want the protocol handler to handle requests for all commands that look like wire protocol commands, even if they aren't available. Otherwise, the fallback to hgweb would only confuse automated clients and make it easier for hgweb to accidentally implement a "cmd" that is identical to wire protocol commands (since they aren't centrally registered). Differential Revision: https://phab.mercurial-scm.org/D1999
Wed, 31 Jan 2018 14:05:11 -0800 wireproto: define and use types for wire protocol commands
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 31 Jan 2018 14:05:11 -0800] rev 36020
wireproto: define and use types for wire protocol commands Wire protocol commands have historically been declared as 2-tuples in wireproto.commands. There are some additional features I'd like to implement that require going beyond 2-tuples. But because the 2-tuple API (both destructuring assignment and direct assignment into the dict) is used throughout the code base and in 3rd party extensions, we can't do a trivial type change. This commit creates a new "commandentry" type to represent declared wire protocol commands. It implements __getitem__ and __iter__ so it can quack like a 2-tuple. The @wireprotocommand decorator now creates "commandentry" instances. We also create a "commanddict" type to represent the dictionary of declared wire protocol commands. It inherits from "dict" but provides a custom __setitem__ to coerce passed 2-tuples to "commandentry" instances. wireproto.commands is now an instance of this type. Various callers in core rely on the new functionality. And tests pass. So I'm reasonably confident things will "just work" in 3rd party extensions as well. Differential Revision: https://phab.mercurial-scm.org/D1998
Tue, 30 Jan 2018 15:21:59 -0800 wireproto: improve docstring for @wireprotocommand
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 30 Jan 2018 15:21:59 -0800] rev 36019
wireproto: improve docstring for @wireprotocommand I'm about to add more arguments and want them to be documented. Plus, good documentation is nice to have. Differential Revision: https://phab.mercurial-scm.org/D1997
Wed, 31 Jan 2018 10:06:39 -0800 wireproto: remove unnecessary exception trapping
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 31 Jan 2018 10:06:39 -0800] rev 36018
wireproto: remove unnecessary exception trapping The `try..except error.Abort` was added in 8474be4412ca back in 2012. The intent was to ensure a failing pushkey hook didn't crash the server. Since that changeset, repo.pushkey() and the hooks mechanism is now much more robust about trapping errors itself. As such, we no longer need this try..except block. So it has been removed. Differential Revision: https://phab.mercurial-scm.org/D1996
Tue, 06 Feb 2018 11:31:25 -0800 sshpeer: implement peer for version 2 of wire protocol
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 06 Feb 2018 11:31:25 -0800] rev 36017
sshpeer: implement peer for version 2 of wire protocol Since the protocol is now negotiated before we construct a peer instance, we can return the negotiated protocol from the handshake function and instantiate an appropriate peer class for the protocol. Version 2 of the SSH protocol is currently identical to version 1 post handshake. So our sshv2peer class just inherits from sshv1peer for the time being. This will obviously change over time. Differential Revision: https://phab.mercurial-scm.org/D2063
Tue, 06 Feb 2018 10:57:56 -0800 sshpeer: rename sshpeer class to sshv1peer (API)
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 06 Feb 2018 10:57:56 -0800] rev 36016
sshpeer: rename sshpeer class to sshv1peer (API) With the introduction of version 2 of the SSH wire protocol, we will need a new peer class to speak that protocol because it will be too difficult to shoehorn a single class to speak two protocols. We rename sshpeer.sshpeer to sshpeer.sshv1peer to reflect the fact that there will be multiple versions of the peer depending on the negotiated protocol. .. api:: sshpeer.sshpeer renamed to sshpeer.sshv1peer. Differential Revision: https://phab.mercurial-scm.org/D2062
Tue, 06 Feb 2018 11:08:36 -0800 sshpeer: initial definition and implementation of new SSH protocol
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 06 Feb 2018 11:08:36 -0800] rev 36015
sshpeer: initial definition and implementation of new SSH protocol The existing SSH protocol has several design flaws. Future commits will elaborate on these flaws as new features are introduced to combat these flaws. For now, hopefully you can take me for my word that a ground up rewrite of the SSH protocol is needed. This commit lays the foundation for a new SSH protocol by defining a mechanism to upgrade the SSH transport channel away from the default (version 1) protocol to something modern (which we'll call "version 2" for now). This upgrade process is detailed in the internals documentation for the wire protocol. The gist of it is the client sends a request line preceding the "hello" command/line which basically says "I'm requesting an upgrade: here's what I support." If the server recognizes that line, it processes the upgrade request and the transport channel is switched to use the new version of the protocol. If not, it sends an empty response, which is how all Mercurial SSH servers from the beginning of time reacted to unknown commands. The upgrade request is effectively ignored and the client continues to use the existing version of the protocol as if nothing happened. The new version of the SSH protocol is completely identical to version 1 aside from the upgrade dance and the bytes that follow. The immediate bytes that follow the protocol switch are defined to be a length framed "capabilities: " line containing the remote's advertised capabilities. In reality, this looks very similar to what the "hello" response would look like. But it will evolve quickly. The methodology by which the protocol will evolve is important. I'm not going to introduce the new protocol all at once. That would likely lead to endless bike shedding and forward progress would stall. Instead, I intend to tricle out new features and diversions from the existing protocol in small, incremental changes. To support the gradual evolution of the protocol, the on-the-wire advertised protocol name contains an "exp" to denote "experimental" and a 4 digit field to capture the sub-version of the protocol. Whenever we make a BC change to the wire protocol, we can increment this version and lock out all older clients because it will appear as a completely different protocol version. This means we can incur as many breaking changes as we want. We don't have to commit to supporting any one feature or idea for a long period of time. We can even evolve the handshake mechanism, because that is defined as being an implementation detail of the negotiated protocol version! Hopefully this lowers the barrier to accepting changes to the protocol and for experimenting with "radical" ideas during its development. In core, sshpeer received most of the attention. We haven't even implemented the server bits for the new protocol in core yet. Instead, we add very primitive support to our test server, mainly just to exercise the added code paths in sshpeer. Differential Revision: https://phab.mercurial-scm.org/D2061 # no-check-commit because of required foo_bar naming
Tue, 06 Feb 2018 10:51:15 -0800 internals: refactor wire protocol documentation
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 06 Feb 2018 10:51:15 -0800] rev 36014
internals: refactor wire protocol documentation Upcoming work will introduce a new version of the HTTP and SSH transports. The differences will be significant enough to consider them new transports. So, we now attach a version number to each transport. In addition, having the handshake documented after the transport and in a single shared section made it harder to follow the flow of the connection. The handshake documentation is now moved to the protocol section it describes. We now have a generic section about the purpose of the handshake, which was rewritten significantly. Differential Revision: https://phab.mercurial-scm.org/D2060
Mon, 05 Feb 2018 18:04:40 +0100 revlog: rename 'self.checkinlinesize' into '_enforceinlinesize'
Boris Feld <boris.feld@octobus.net> [Mon, 05 Feb 2018 18:04:40 +0100] rev 36013
revlog: rename 'self.checkinlinesize' into '_enforceinlinesize' The name change has two motivations: 1) The function has no external caller, so we move it to protected space. 2) the function does more than checking it also split the data if we have more data than 'inline' supports.
Mon, 05 Feb 2018 17:57:29 +0100 revlog: add a _datareadfp context manager for data access needs
Boris Feld <boris.feld@octobus.net> [Mon, 05 Feb 2018 17:57:29 +0100] rev 36012
revlog: add a _datareadfp context manager for data access needs The helper handles: 1) is there a file handle already open that we shall just reuse, 2) is the revlog inlined or not. Using a context manager for all read access will help setting up file pointer caching in later changesets.
Mon, 05 Feb 2018 17:35:14 +0100 revlog: use context manager for data file lifetime in checksize
Boris Feld <boris.feld@octobus.net> [Mon, 05 Feb 2018 17:35:14 +0100] rev 36011
revlog: use context manager for data file lifetime in checksize This is clearer, safer and more modern.
Mon, 05 Feb 2018 17:34:57 +0100 revlog: use context manager for index file lifetime in checkinlinesize
Boris Feld <boris.feld@octobus.net> [Mon, 05 Feb 2018 17:34:57 +0100] rev 36010
revlog: use context manager for index file lifetime in checkinlinesize This is clearer, safer and more modern.
Mon, 05 Feb 2018 17:34:47 +0100 revlog: use context manager for data file lifetime in checkinlinesize
Boris Feld <boris.feld@octobus.net> [Mon, 05 Feb 2018 17:34:47 +0100] rev 36009
revlog: use context manager for data file lifetime in checkinlinesize This is clearer, safer and more modern.
Mon, 05 Feb 2018 17:34:19 +0100 revlog: use context manager for index file life time in __init__
Boris Feld <boris.feld@octobus.net> [Mon, 05 Feb 2018 17:34:19 +0100] rev 36008
revlog: use context manager for index file life time in __init__ This is clearer, safer and more modern.
Mon, 05 Feb 2018 17:22:13 +0100 revlog: move index file opening in a method
Boris Feld <boris.feld@octobus.net> [Mon, 05 Feb 2018 17:22:13 +0100] rev 36007
revlog: move index file opening in a method Having file operation centralized into a single spot help to factor common logic out (eg: special flag handling according to the mode). It is also the first step to simplify file handling during batch operation (eg: revlog cloning). However, that part does not seems to be a hotspot yet.
Mon, 05 Feb 2018 17:03:56 +0100 revlog: move datafile opening in a method
Boris Feld <boris.feld@octobus.net> [Mon, 05 Feb 2018 17:03:56 +0100] rev 36006
revlog: move datafile opening in a method Having file operation centralized into a single spot help to factor common logic out. It is also the first step to simplify file handling during batch operation (eg: revlog cloning). However, that part does not seems to be a hotspot yet.
Tue, 06 Feb 2018 12:25:11 +0100 parseindex: implement context manager method on the wrapper
Boris Feld <boris.feld@octobus.net> [Tue, 06 Feb 2018 12:25:11 +0100] rev 36005
parseindex: implement context manager method on the wrapper This is needed for incoming cleanups.
Tue, 06 Feb 2018 11:52:37 +0100 parseindex: also forward keyword argument in a debug wrapper
Boris Feld <boris.feld@octobus.net> [Tue, 06 Feb 2018 11:52:37 +0100] rev 36004
parseindex: also forward keyword argument in a debug wrapper Otherwise, it gets in the way of a coming refactoring.
Tue, 06 Feb 2018 11:51:39 +0100 dumprevlog: handle being passed a mode parameter
Boris Feld <boris.feld@octobus.net> [Tue, 06 Feb 2018 11:51:39 +0100] rev 36003
dumprevlog: handle being passed a mode parameter This makes it closer to an actual file opener. Otherwise, it gets in the way of a coming refactoring.
Tue, 06 Feb 2018 11:08:41 +0100 changelog: add the missing 'closed' property on 'appender' object
Boris Feld <boris.feld@octobus.net> [Tue, 06 Feb 2018 11:08:41 +0100] rev 36002
changelog: add the missing 'closed' property on 'appender' object This mimic file object further.
(0) -30000 -10000 -3000 -1000 -300 -100 -60 +60 +100 +300 +1000 +3000 +10000 tip