[20 PATCHES] Wire protocol unification

Matt Mackall mpm at selenic.com
Wed Jul 23 11:28:28 CDT 2008


On Wed, 2008-07-23 at 15:25 +0000, Dirkjan Ochtman wrote:
> So, I decided that it would be a good idea to try and unify the ssh wire
> protocol and the http wire protocol. Currently, these are defined separately in
> mercurial/sshserver.py and mercurial/hgweb/protocol.py, but they are very, very
> similar. I thought that it would be good to try and unify as much common code as
> possible in one protocol.py file, and I have pretty much succeeded in doing so.
> At the moment, I have one fairly bogus test failing, which I need to check.
> 
> In the meantime, these patches are moving a lot of code around, and while the
> test suite provides some guarantee that everything still works, it seems the
> coverage for these bits isn't all that good, so that I wouldn't mind having some
> others look at the patches. 20 may seem a lot, but most of them should be fairly
> simple, and some are fairly small. So let me know if you can review, and when.
> 
> The repo is here: http://hg.xavamedia.nl/mercurial/proto/
> Or, clone the mq: http://hg.xavamedia.nl/mercurial/proto.mq/

Some thoughts:

__all__ can be "a string that gets".split() 
the req.clength thing is quite weird
why are we importing from hgweb?
import changegroup as changegroup_, please
we've got ui.push for I/O redirection (death to cStringIO)
five layers of try: in a single function has got to be some sort of
record

I'm not sure how I feel about using __all__ like that. Is there any
reason not to use something like commands?

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial-devel mailing list