Patchwork bundle2: explicitly use network byte order

login
register
mail settings
Submitter David Soria Parra
Date March 31, 2014, 9:24 p.m.
Message ID <19fcef51b60e985d0348.1396301071@dev544.prn1.facebook.com>
Download mbox | patch
Permalink /patch/4164/
State Rejected
Headers show

Comments

David Soria Parra - March 31, 2014, 9:24 p.m.
# HG changeset patch
# User David Soria Parra <davidsp@fb.com>
# Date 1396300921 25200
#      Mon Mar 31 14:22:01 2014 -0700
# Node ID 19fcef51b60e985d0348da592ea63c94b3f1ccce
# Parent  f6fe185a37954b86d57a8d02d88e255b35238b54
bundle2: explicitly use network byte order
Pierre-Yves David - April 1, 2014, 6:54 a.m.
On 03/31/2014 02:24 PM, David Soria Parra wrote:
> # HG changeset patch
> # User David Soria Parra <davidsp@fb.com>
> # Date 1396300921 25200
> #      Mon Mar 31 14:22:01 2014 -0700
> # Node ID 19fcef51b60e985d0348da592ea63c94b3f1ccce
> # Parent  f6fe185a37954b86d57a8d02d88e255b35238b54
> bundle2: explicitly use network byte order

meh,

The doc says:

   The form '!' is available for those poor souls who claim they can’t
   remember whether network byte order is big-endian or little-endian.

I believe every one is able to remind that the sane network order is big 
endian.
Matt Mackall - April 2, 2014, 12:07 a.m.
On Mon, 2014-03-31 at 23:54 -0700, Pierre-Yves David wrote:
> On 03/31/2014 02:24 PM, David Soria Parra wrote:
> > # HG changeset patch
> > # User David Soria Parra <davidsp@fb.com>
> > # Date 1396300921 25200
> > #      Mon Mar 31 14:22:01 2014 -0700
> > # Node ID 19fcef51b60e985d0348da592ea63c94b3f1ccce
> > # Parent  f6fe185a37954b86d57a8d02d88e255b35238b54
> > bundle2: explicitly use network byte order
> 
> meh,
> 
> The doc says:
> 
>    The form '!' is available for those poor souls who claim they can’t
>    remember whether network byte order is big-endian or little-endian.
> 
> I believe every one is able to remind that the sane network order is big 
> endian.

We currently use ">" everywhere else. I'm inclined to leave it.

Patch

diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -106,9 +106,9 @@ 
 
 _magicstring = 'HG20'
 
-_fstreamparamsize = '>H'
-_fpartheadersize = '>H'
-_fparttypesize = '>B'
+_fstreamparamsize = '!H'
+_fpartheadersize = '!H'
+_fparttypesize = '!B'
 
 class bundle20(object):
     """represent an outgoing bundle2 container