mercurial/pure/parsers.py
changeset 28861 86db5cb55d46
parent 27339 6ab8c6511a6a
child 29133 255274719dc1
equal deleted inserted replaced
28860:50d11dd8ac02 28861:86db5cb55d46
     5 # This software may be used and distributed according to the terms of the
     5 # This software may be used and distributed according to the terms of the
     6 # GNU General Public License version 2 or any later version.
     6 # GNU General Public License version 2 or any later version.
     7 
     7 
     8 from __future__ import absolute_import
     8 from __future__ import absolute_import
     9 
     9 
    10 import cStringIO
       
    11 import struct
    10 import struct
    12 import zlib
    11 import zlib
    13 
    12 
    14 from .node import nullid
    13 from .node import nullid
       
    14 from . import pycompat
       
    15 stringio = pycompat.stringio
    15 
    16 
    16 _pack = struct.pack
    17 _pack = struct.pack
    17 _unpack = struct.unpack
    18 _unpack = struct.unpack
    18 _compress = zlib.compress
    19 _compress = zlib.compress
    19 _decompress = zlib.decompress
    20 _decompress = zlib.decompress
    88         dmap[f] = e[:4]
    89         dmap[f] = e[:4]
    89     return parents
    90     return parents
    90 
    91 
    91 def pack_dirstate(dmap, copymap, pl, now):
    92 def pack_dirstate(dmap, copymap, pl, now):
    92     now = int(now)
    93     now = int(now)
    93     cs = cStringIO.StringIO()
    94     cs = stringio()
    94     write = cs.write
    95     write = cs.write
    95     write("".join(pl))
    96     write("".join(pl))
    96     for f, e in dmap.iteritems():
    97     for f, e in dmap.iteritems():
    97         if e[0] == 'n' and e[3] == now:
    98         if e[0] == 'n' and e[3] == now:
    98             # The file was last modified "simultaneously" with the current
    99             # The file was last modified "simultaneously" with the current