1
  6   ˆl–Ü4ý( ©¤ýÔâ�ràq�)‹Fÿ�þB g#uöÞ}¸ãþÂƒh¹ÁÀ¿      00000041
  .   ˆ{‹„„-i[D<†ªoZƒ›Ù«Ã‚p_‘I|¥‰ÓMdœv ©ƒ†ü+=ÃÂ Y    ‹      Õ–M�Ó0†ïû+ŒÜÚéÇÂa7	ZšJTtÛª[„B‘»�ÕÄö¤¥üzœ&¨Ý¥ ±H¹ØãñkÏ<¶ãØ{N‹O³!y·¸“Ù‡·ãÑ€ÐÀÇþ  \„UÇu»ÓN(¡	b~°ÛíÚ»~[›5,æ�`–^ƒE#clsä4¸òJ_pE¼D0îjâ¡ÄT#ÅÅ7¢Wt�VráÆí-p±•±°¥�"¥¹8ˆóÂIŠeÝÃ�Ü
c!7Úé­6¥ ¹Þ	ãAÃE…:¬·Ô|_fÓ}æÈ.À’-	”¦	<LÈ–¥r­|Š:§�'³5±&ö)ÈX+Ë”©M{-W”°}úy4˜~q:À¤xŒ$F¬|úfàOn§~Hƒ	Ë„ì¼æÞiîh0fI¦¹\IÁ/Š*ñƒü~yÂ°Ò„ÂÆFæ(µ:JÁ!ž¢Æ:µ9s¬¯AbNU•„ÿn5Xüh1fwóádŽæÕ’ðrŠcvÿvi0cF($¡4"Fmö5hõ¥ZÚüög“ÔF®¤!-rVùì…Ú(½S§øniÏ‚3»W1Õi’O²êuz¯[Ýn«×!�Î�+É¡û¼ßÿÏôÔ¶°¹P<â"eû(³ŽæŒ·�pN�F§4¨�"äYôUÛÈ[d"J
ï£ÂíÑ¥žBšB¡t,FwDÉßgóÑJû´Òn0šPå–±jGƒ‘,2,NÎ`Õn2Pu™þä>ö7°°l}Âuh>?Î¾· ~‰zpx{P½Ç ôËÃþò    7   ˆl–Ü4ý( ©¤ýÔâ�rà…p)‹Fÿ‘äÇò 8à	+å‘¦ÿŸÆƒh¹ÅÄÃ      0000002e
     	ˆÁÀÅ524¿ÄÃ     	‹      Õ•QoÚ0Çßû)<?ì.�–©ÔñÔ¤¡Q@”iš¦irbC¬&6²Œ}ú9$V•­Ó6­{òùò÷Ýý.‰�<‹Ç½ÙûI½žÝÑäí«á ‡pà]»ÏâêÁy3ú#ŒpæÜ²°Ùlš›vS›Ì¦�¹"?ëŒL]“;Žé)}ô‘L0îWDœt¹ ÅÅg¤çôÊYÉ…?·µÀÅZ¦Â–¶¢Ðf[/íKPš‹ Þ†`WI%$PEõy NDÍ·eþð�çò!w ,Ù¥,MC‰ËÐšår¡"ìôS"‹²&�0ÈT+IÎÔ]s!ç±ÜEøÃ 7þèuà²ò4%eFÌ#ü²�®ÆQŒéˆ‚ {Xsã5×˜™u¨Ð\Î¥à'Å·•øV~90®4±°©‘K'µ:HÁ#£¦:·KæY/<AfŽU•„ÿ¬,ý®“ëi4‹Óª%¼q¨îwÞ¦f„r(–F¤Î;k¬*Çs•ØåÕ~‹ê¢�\dS„èAå/�ÎuÎ…9f=E¹çÂtoWz¯´VÐê4Â°^¢ðE7è ô4Œ\³c¨­§Â°RwJoÔ1„ÿ ñ‰­|(£ñ�æàzV+DA§Û
NbùõÍ?Àº‡ô¿â¬ÄÚÿÖ˜Vëßxäõõ` °Aªø™áöe    C   ˆl–äY>”JeJe@†à¸Û*bÑ¿�þ\fQ,Ü¡p¬ˆ$‘¦�üÿÇ„m¼çÆ_ŠI|¥�+Wé3ž¯ÆÅ ?÷     # store.py - repository store handling for Mercurial
#
# Copyright 2008 Olivia Mackall <olivia@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.


import functools
import os
import re
import stat

from .i18n import _
from .pycompat import getattr
from .node import hex
from . import (
    changelog,
    error,
    manifest,
    policy,
    pycompat,
    util,
    vfs as vfsmod,
)
from .utils import hashutil

parsers = policy.importmod('parsers')
# how much bytes should be read from fncache in one read
# It is done to prevent loading large fncache files into memory
fncache_chunksize = 10 ** 6


def _matchtrackedpath(path, matcher):
    """parses a fncache entry and returns whether the entry is tracking a path
    matched by matcher or not.

    If matcher is None, returns True"""

    if matcher is None:
        return True
    path = decodedir(path)
    if path.startswith(b'data/'):
        return matcher(path[len(b'data/') : -len(b'.i')])
    elif path.startswith(b'meta/'):
        return matcher.visitdir(path[len(b'meta/') : -len(b'/00manifest.i')])

    raise error.ProgrammingError(b"cannot decode path %s" % path)


# This avoids a collision between a file named foo and a dir named
# foo.i or foo.d
def _encodedir(path):
    """
    >>> _encodedir(b'data/foo.i')
    'data/foo.i'
    >>> _encodedir(b'data/foo.i/bla.i')
    'data/foo.i.hg/bla.i'
    >>> _encodedir(b'data/foo.i.hg/bla.i')
    'data/foo.i.hg.hg/bla.i'
    >>> _encodedir(b'data/foo.i\\ndata/foo.i/bla.i\\ndata/foo.i.hg/bla.i\\n')
    'data/foo.i\\ndata/foo.i.hg/bla.i\\ndata/foo.i.hg.hg/bla.i\\n'
    """
    return (
        path.replace(b".hg/", b".hg.hg/")
        .replace(b".i/", b".i.hg/")
        .replace(b".d/", b".d.hg/")
    )


encodedir = getattr(parsers, 'encodedir', _encodedir)


def decodedir(path):
    """
    >>> decodedir(b'data/foo.i')
    'data/foo.i'
    >>> decodedir(b'data/foo.i.hg/bla.i')
    'data/foo.i/bla.i'
    >>> decodedir(b'data/foo.i.hg.hg/bla.i')
    'data/foo.i.hg/bla.i'
    """
    if b".hg/" not in path:
        return path
    return (
        path.replace(b".d.hg/", b".d/")
        .replace(b".i.hg/", b".i/")
        .replace(b".hg.hg/", b".hg/")
    )


def _reserved():
    """characters that are problematic for filesystems

    * ascii escapes (0..31)
    * ascii hi (126..255)
    * windows specials

    these characters will be escaped by encodefunctions
    """
    winreserved = [ord(x) for x in u'\\:*?"<>|']
    for x in range(32):
        yield x
    for x in range(126, 256):
   