mercurial/manifest.py
changeset 6389 0231f763ebc8
parent 6212 e75aab656f46
child 6743 86e8187b721a
equal deleted inserted replaced
6388:1e4ddc9ac9f7 6389:0231f763ebc8
     6 # of the GNU General Public License, incorporated herein by reference.
     6 # of the GNU General Public License, incorporated herein by reference.
     7 
     7 
     8 from node import bin, hex, nullid
     8 from node import bin, hex, nullid
     9 from revlog import revlog, RevlogError
     9 from revlog import revlog, RevlogError
    10 from i18n import _
    10 from i18n import _
    11 import array, struct, mdiff
    11 import array, struct, mdiff, parsers
    12 
    12 
    13 class manifestdict(dict):
    13 class manifestdict(dict):
    14     def __init__(self, mapping=None, flags=None):
    14     def __init__(self, mapping=None, flags=None):
    15         if mapping is None: mapping = {}
    15         if mapping is None: mapping = {}
    16         if flags is None: flags = {}
    16         if flags is None: flags = {}
    37         self.listcache = None
    37         self.listcache = None
    38         revlog.__init__(self, opener, "00manifest.i")
    38         revlog.__init__(self, opener, "00manifest.i")
    39 
    39 
    40     def parse(self, lines):
    40     def parse(self, lines):
    41         mfdict = manifestdict()
    41         mfdict = manifestdict()
    42         fdict = mfdict._flags
    42         parsers.parse_manifest(mfdict, mfdict._flags, lines)
    43         for l in lines.splitlines():
       
    44             f, n = l.split('\0')
       
    45             if len(n) > 40:
       
    46                 fdict[f] = n[40:]
       
    47                 mfdict[f] = bin(n[:40])
       
    48             else:
       
    49                 mfdict[f] = bin(n)
       
    50         return mfdict
    43         return mfdict
    51 
    44 
    52     def readdelta(self, node):
    45     def readdelta(self, node):
    53         return self.parse(mdiff.patchtext(self.delta(node)))
    46         return self.parse(mdiff.patchtext(self.delta(node)))
    54 
    47