\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c @@sddlmZmZddlZddlZddlZddlZddlmZddl m Z m Z m Z m Z mZddlmZdEZdFZejZdZdZdZdZdeddZddddeddedded ZddZdZdZdZdZ de!fdYZ"d e"fd!YZ#d"e"fd#YZ$d$e"fd%YZ%d&e"fd'YZ&d(e!fd)YZ'd*e"fd+YZ(d,e"fd-YZ)d.e"fd/YZ*d0Z+d1e"fd2YZ,d3e"fd4YZ-d5e"fd6YZ.d7e"fd8YZ/dd9Z0d:Z1d;Z2d<Z3d=Z4d>Z5d?Z6d@Z7dAZ8dBZ9dCZ:da;edDZ<dS(Gi(tabsolute_importtprint_functionNi(t_(tencodingterrortpathutiltpycompattutil(t stringutiltretglobtpathtrelglobtrelpathtrelretlistfilet listfile0tsettincludet subincludet rootfilesincC@s9tjj|}y |jSWntk r4|jSXdS(sZcompile the regexp with the best available regexp engine and return a matcher functionN(RR tcompilet test_matchtAttributeErrortmatch(tregextm((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyt _rematcher"s   c C@sg}g}x|D]\}} } |dkr|dkrLtjdn|j|j| d||rxZ|jD]L} |j| j| d|} t||| | d|} |j| qxWqqn|j|| | fqW||fS(sFReturns the kindpats list with the 'set' patterns expanded to matchersRs"fileset expression with no contexttbadfnN(tNoneRtProgrammingErrortappendt matchfilesettsubstatetsubtprefixdirmatcher(troottcwdtkindpatstctxt listsubreposRtmatcherstothertkindtpattsourcetsubpathtsmtpm((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyt _expandsets,s  c C@sg}g}x|D]\}}}|dkrtjtj|}tj|}tj||}tj|} | dgd|gf} tj||| } | r| d7} n|j| | fq|j|||fqW||fS(s_Returns the list of subinclude matcher args and the kindpats without the subincludes in it.Rts include:%st/(RtdirnameRtnormpathtpconverttjoint canonpathR( R&R$t relmatchersR*R+R,R-t sourcerootR tnewroott matcherargstprefix((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyt_expandsubincludeBs  cC@s:x3|D]+\}}}|dks.|dkrtSqWtS(sR"Checks whether the kindspats match everything, as e.g. 'relpath:.' does. R2R R (R R (tFalsetTrue(R&R+R,R-((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyt_kindpatsalwaysmatchZsc C@sg}t|||d|d|d|\}}|rd||||d|d|} |j| n|rz|j|n|st||d|St|dkr|dSt|S(NR'R(Rii(R1Rtextendt nevermatchertlent unionmatcher( t matcherclsR$R%R&R'R(RR)tfmsR((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyt_buildkindpatsmatchercs c  @st} | rQ|r$tjdn|jjjfd} n|rot|||| }n|r| |||||| }t|rt||| dt }qt t |||d|d| d| }nt||| }|rM| |d|||| }t t |||d|d| dd}t||}n|r| |d|||| }t t |||d|d| dd}t||}n|S( sHbuild an object to match a set of file patterns arguments: root - the canonical root of the tree you're matching against cwd - the current working directory, if relevant patterns - patterns to find include - patterns to include (unless they are excluded) exclude - patterns to exclude (even if they are included) default - if a pattern in patterns has no explicit type, assume this one exact - patterns are actually filenames (include/exclude still apply) warn - optional function used for printing warnings badfn - optional bad() callback for this matcher instead of the default icasefs - make a matcher for wdir on case insensitive filesystems, which normalizes the given patterns to the case in the filesystem a pattern is one of: 'glob:' - a glob relative to cwd 're:' - a regular expression 'path:' - a path relative to repository root, which is matched recursively 'rootfilesin:' - a path relative to repository root, which is matched non-recursively (will not match subdirectories) 'relglob:' - an unrooted glob (*.c matches C files in all dirs) 'relpath:' - a path relative to cwd 'relre:' - a regexp that needn't match the start of a name 'set:' - a fileset expression 'include:' - a file of patterns to read and include 'subinclude:' - a file of patterns to match against files under the same directory '' - a pattern of the specified default type s3a case-insensitive exact matcher doesn't make sensec @st||||||}g}x|D]w\}} } |dkr| } | } | | kr| kr|j|| | fqn|j|| | fq(W|S(NR R(R R(t _donormalizeR( tpatternstdefaultR$R%tauditortwarntkpR&R+tpatsR-tp(tdirstatet dsnormalize(s5/usr/lib64/python2.7/site-packages/mercurial/match.pyt normalizes  trelativeuipathR'R(RR N(RIRRtrepoRQRSt exactmatcherRAt alwaysmatcherR@RHtpatternmatchertincludematcherRtintersectmatcherstdifferencematcher(R$R%RJRtexcludeRKtexactRLR'R(RMRticasefsRSRR&timtem((RQRRs5/usr/lib64/python2.7/site-packages/mercurial/match.pyRts8"    cC@st|||d|S(NR(RV(R$R%tfilesR((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyR]scC@s t||S(N(RW(R$R%((s5/usr/lib64/python2.7/site-packages/mercurial/match.pytalwaysscC@s t||S(N(RC(R$R%((s5/usr/lib64/python2.7/site-packages/mercurial/match.pytneverscC@stj|}||_|S(sWMake a copy of the given matcher, replacing its bad method with the given one. (tcopytbad(RRR((s5/usr/lib64/python2.7/site-packages/mercurial/match.pytbadmatchs cC@s}g}xpg|D]}t||^qD]L\}} |tkr\tj||| |} n|d krztj| } n|dkrZy\tj| } |dkr| jd} n | j} g| D]} | r| ^q} Wn*t k rt j t d| nXxBt | |||||D]%\} }} |j| || fq+Wq)n|dkr_y|tjj|tj| }t||}xHt ||||||D]+\} }} |j| || p| fqWWq)t j k r}t j d | |d fq)tk rX}|rY|t d | tj|jfqYq)Xq)n|j|| d fq)W|S(sConvert 'kind:pat' from the patterns list to tuples with kind and normalized and rooted patterns and with listfiles expanded.R R RRRssunable to read file list (%s)Rs%s: %sis*skipping unreadable pattern file '%s': %s R2(R R R(RR(t _patsplittcwdrelativepatternkindsRR8RR5treadfiletsplitt splitlinestEnvironmentErrorRtAbortRRIRtosR R7t localpathtreadpatternfiletIOErrorRt forcebytestrtstrerror(RJRKR$R%RLRMR&RPR+R,RatftkR-tfullpatht includepatstinst((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRIsF/     #   $  !t basematchercB@seZdedZdZdZdZdZdZ dZ dZ dZ e dZdZe d Zd Zd Zd Zd ZdZdZdZdZRS(cC@s7||_||_|dk r*||_n||_dS(N(t_roott_cwdRRet_relativeuipath(tselfR$R%RRT((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyt__init__s     cC@s |j|S(N(tmatchfn(R}tfn((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyt__call__ scc@sx|jD] }|Vq WdS(N(t_files(R}Rt((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyt__iter__ scC@sdS(soCallback from dirstate.walk for each explicit file that can't be found/accessed, with an error message.N((R}Rttmsg((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRescC@s|S(sUConvert a repo path back to path that is relative to the root of the matcher.((R}Rt((s5/usr/lib64/python2.7/site-packages/mercurial/match.pytabsscC@stj|j|j|S(sBConvert repo path back to path that is relative to cwd of matcher.(RtpathtoRzR{(R}Rt((s5/usr/lib64/python2.7/site-packages/mercurial/match.pytrel#scC@s%|jr|j|p$|j|S(sConvert repo path to a display path. If patterns or -I/-X were used to create this matcher, the display path will be relative to cwd. Otherwise it is relative to the root of the repo.(R|RR(R}Rt((s5/usr/lib64/python2.7/site-packages/mercurial/match.pytuipath'scC@sgS(N((R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyR-scC@s|jS(sExplicitly listed files or patterns or roots: if no patterns or .always(): empty list, if exact: list exact files, if not .anypats(): list all files and dirs, else: optimal roots(R(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRa1scC@s t|jS(N(RR(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyt_fileset9scC@s ||jkS(s!Returns True if f is in .files().(R(R}Rt((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyR]=scC@stS(N(R?(R}Rt((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRAscC@stS(sDecides whether a directory should be visited based on whether it has potential matches in it or one of its subdirectories. This is based on the match's primary, included, and excluded patterns. Returns the string 'all' if the given directory and all subdirectories should be visited. Otherwise returns True or False indicating whether the given directory should be visited. (R@(R}tdir((s5/usr/lib64/python2.7/site-packages/mercurial/match.pytvisitdirDs cC@sdS(s^Decides whether a directory should be visited based on whether it has potential matches in it or one of its subdirectories, and potentially lists which subdirectories of that directory should be visited. This is based on the match's primary, included, and excluded patterns. This function is very similar to 'visitdir', and the following mapping can be applied: visitdir | visitchildrenlist ----------+------------------- False | set() 'all' | 'all' True | 'this' OR non-empty set of subdirs -or files- to visit Example: Assume matchers ['path:foo/bar', 'rootfilesin:qux'], we would return the following values (assuming the implementation of visitchildrenset is capable of recognizing this; some implementations are not). '.' -> {'foo', 'qux'} 'baz' -> set() 'foo' -> {'bar'} # Ideally this would be 'all', but since the prefix nature of matchers # is applied to the entire matcher, we have to downgrade this to # 'this' due to the non-prefix 'rootfilesin'-kind matcher being mixed # in. 'foo/bar' -> 'this' 'qux' -> 'this' Important: Most matchers do not know if they're representing files or directories. They see ['path:dir/f'] and don't know whether 'f' is a file or a directory, so visitchildrenset('dir') for most matchers will return {'f'}, but if the matcher knows it's a file (like exactmatcher does), it may return 'this'. Do not rely on the return being a set indicating that there are no files in this dir to investigate (or equivalently that if there are files to investigate in 'dir' that it will always return 'this'). tthis((R}R((s5/usr/lib64/python2.7/site-packages/mercurial/match.pytvisitchildrensetOs)cC@stS(scMatcher will match everything and .files() will be empty -- optimization might be possible.(R?(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRbzscC@stS(scMatcher will match exactly the list of files in .files() -- optimization might be possible.(R?(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pytisexactscC@stS(s_Matcher will match the paths in .files() recursively -- optimization might be possible.(R?(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyR=scC@s%|j o$|j o$|j S(s`None of .always(), .isexact(), and .prefix() is true -- optimizations will be difficult.(RbRR=(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pytanypatssN(t__name__t __module__RR@R~RRRet explicitdirt traversedirRRRt propertycacheRRaRR]RRRRbRR=R(((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRys(          +   RWcB@sJeZdZdedZdZdZdZdZ dZ RS(sMatches everything.cC@s&tt|j|||d|dS(NRT(tsuperRWR~(R}R$R%RRT((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyR~scC@stS(N(R@(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRbscC@stS(N(R@(R}Rt((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRscC@sdS(Ntall((R}R((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRscC@sdS(NR((R}R((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRscC@sdS(Ns((R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyt__repr__sN( RRt__doc__RR?R~RbRRRR(((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRWs    RCcB@sGeZdZddZdZdZdZdZdZ RS(sMatches nothing.cC@s tt|j|||dS(N(RRCR~(R}R$R%R((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyR~scC@stS(N(R@(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRscC@stS(N(R@(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyR=scC@stS(N(R?(R}R((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRscC@stS(N(R(R}R((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRscC@sdS(Ns((R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRsN( RRRRR~RR=RRR(((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRCs     tpredicatematchercB@s/eZdZdddZejdZRS(s/A matcher adapter for a simple boolean functioncC@s2tt|j|||||_||_dS(N(RRR~Rt _predrepr(R}R$R%tpredfntpredreprR((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyR~s cC@s,tj|jp!tj|j}d|S(Ns(Rt buildreprRRtbytereprR(R}ts((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRsN(RRRRR~Rt strmethodR(((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRsRXcB@sSeZeddZedZdZdZdZ e j dZ RS(cC@s_tt|j|||t||_t||_t|d||\|_|_dS(Nt$( RRXR~t_explicitfilesRt_prefixt _buildmatcht_patsR(R}R$R%R&R(R((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyR~s  cC@sttj|jdhBS(Nt.(RRtdirsR(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyt_dirssc@sljr|jkrdSdjkpk|jkpk|jkpktfdtj|DS(NRRc3@s|]}|jkVqdS(N(R(t.0t parentdir(R}(s5/usr/lib64/python2.7/site-packages/mercurial/match.pys s(RRRtanyRtfinddirs(R}R((R}s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRscC@sB|j|}|tkrdS|s,tS|dks>tdS(NRR(RR@RtAssertionError(R}Rtret((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRs cC@s|jS(N(R(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyR=scC@sdtj|jS(Ns(RtbytestrR(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRsN( RRR?RR~RRRRR=RRR(((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRXs  t _dirchildrencB@s5eZddZdZedZdZRS(cC@s@i|_|pg|_|j}x|D]}||q(WdS(N(Rt _onlyincludetaddpath(R}tpathst onlyincludeRRt((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyR~s    cC@st|dkrdS|j}tj}xK||D]=\}}||jkrPq/n|j|tj|q/WdS(NR(RRt_findsplitdirsRt setdefaultRtadd(R}R Rt findsplitdirstdtb((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRs   cc@svt|}|jd}xE|dkrb|| ||d|!fV|}|jdd|}qWd|| fVdS(NR3iiiR(RDtrfind(R toldpostpos((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRs cC@s|jj|tS(N(RtgetR(R}R ((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRsN(RRRR~Rt staticmethodRR(((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRs  RYcB@sJeZeddZdZedZdZe j dZ RS(c C@stt|j|||t|d||\|_|_t||_t|\}}}t||_ t||_ t||_ dS(Ns(?:/|$)( RRYR~RRRRt_rootsdirsandparentsRt_rootsRt_parents( R}R$R%R&R(RtrootsRtparents((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyR~s c@s{jr|jkrdSdjkpz|jkpz|jkpz|jkpztfdtj|DS(NRRc3@s|]}|jkVqdS(N(R(RR(R}(s5/usr/lib64/python2.7/site-packages/mercurial/match.pys 3s(RRRRRRR(R}R((R}s5/usr/lib64/python2.7/site-packages/mercurial/match.pyR,scC@s+ttj|j|j|jd|jS(NR(Rt itertoolstchainRRR(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyt_allparentschildren6sc@sjr|jkrdSdjksn|jksn|jksntfdtj|DrrdS|jkrjj|pt St S(NRRc3@s|]}|jkVqdS(N(R(RR(R}(s5/usr/lib64/python2.7/site-packages/mercurial/match.pys JsR( RRRRRRRRRR(R}R((R}s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRBscC@sdtj|jS(Ns(RRR(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRRsN( RRR?RR~RRRRRRR(((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRYs   RVcB@s_eZdZddZejZedZ dZ dZ dZ e jdZRS(slMatches the input files exactly. They are interpreted as paths, not patterns (so no kind-prefixes). cC@sJtt|j|||t|tr7||_nt||_dS(N(RRVR~t isinstancetlistR(R}R$R%RaR((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyR~[s cC@sttj|jdhBS(NR(RRRR(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRescC@s ||jkS(N(R(R}R((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRisc@s|j s||jkr tS|j|jdhB}|dkrl|dtfd|D}nd|D}|st|S(NRR3c3@s.|]$}|jr|tVqdS(N(t startswithRD(Rtc(R(s5/usr/lib64/python2.7/site-packages/mercurial/match.pys sscS@s"h|]}d|kr|qS(R3((RR((s5/usr/lib64/python2.7/site-packages/mercurial/match.pys zs (RRRR(R}Rt candidatesR((Rs5/usr/lib64/python2.7/site-packages/mercurial/match.pyRls   cC@stS(N(R@(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRscC@s d|jS(Ns(R(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRsN(RRRRR~RyR]RRRRRRRRR(((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRVVs     R[cB@s\eZdZdZdZedZdZdZdZ e j dZ RS(sComposes two matchers by matching if the first matches and the second does not. The second matcher's non-matching-attributes (root, cwd, bad, explicitdir, traversedir) are ignored. cC@sYtt|j|j|j||_||_|j|_|j|_|j |_ dS(N( RR[R~RzR{t_m1t_m2ReRR(R}tm1tm2((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyR~s     cC@s|j|o|j| S(N(RR(R}Rt((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRscC@sE|jr8g|jjD]}||r|^qS|jjS(N(RRRa(R}Rt((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRs ,cC@s2|jj|dkrtSt|jj|S(NR(RRR?tboolR(R}R((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRscC@sU|jj|}|dkr%tS|jj|}|sA|S|dkrQdS|S(NRR(RR(RRRR(R}Rtm2_settm1_set((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRs  cC@s |jjS(N(RR(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRscC@sd|j|jfS(Ns (RR(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRs( RRRR~RRRRRRRRR(((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyR[s     cC@s|dks|dkr"|p!|S|jrtj|}|j|_|j|_|j|_|j|_|j|_|j|jO_|S|jrtj|}|j|jO_|St ||S(sComposes two matchers by matching if both of them match. The second matcher's non-matching-attributes (root, cwd, bad, explicitdir, traversedir) are ignored. N( RRbRdReRRRRR|tintersectionmatcher(RRR((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRZs         RcB@s_eZdZedZdZdZdZdZdZ e j dZ RS(cC@sYtt|j|j|j||_||_|j|_|j|_|j |_ dS(N( RRR~RzR{RRReRR(R}RR((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyR~s     cC@s~|jrd|j|j}}|js;||}}ng|jD]}||rH|^qHS|jj|jjS(N(RRRRa(R}RRRt((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRs   )cC@s|j|o|j|S(N(RR(R}Rt((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRscC@sJ|jj|}|dkr.|jj|St|oF|jj|S(NR(RRRR(R}Rtvisit1((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRs cC@s|jj|}|stS|jj|}|s>tS|dkrN|S|dkr^|S|dksv|dkrzdSt|trt|tst|j|S(NRR(RRRRRRt intersection(R}RRR((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRs  $cC@s|jjo|jjS(N(RRbR(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRbscC@s|jjp|jjS(N(RRR(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRscC@sd|j|jfS(Ns"(RR(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRs( RRR~RRRRRRbRRRR(((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRs      t subdirmatchercB@szeZdZdZdZdZdZdZdZdZ dZ d Z d Z e jd ZRS( sAdapt a matcher to work on a subdirectory only. The paths are remapped to remove/insert the path as needed: >>> from . import pycompat >>> m1 = match(b'root', b'', [b'a.txt', b'sub/b.txt']) >>> m2 = subdirmatcher(b'sub', m1) >>> bool(m2(b'a.txt')) False >>> bool(m2(b'b.txt')) True >>> bool(m2.matchfn(b'a.txt')) False >>> bool(m2.matchfn(b'b.txt')) True >>> m2.files() ['b.txt'] >>> m2.exact(b'b.txt') True >>> util.pconvert(m2.rel(b'b.txt')) 'sub/b.txt' >>> def bad(f, msg): ... print(pycompat.sysstr(b"%s: %s" % (f, msg))) >>> m1.bad = bad >>> m2.bad(b'x.txt', b'No such file') sub/x.txt: No such file >>> m2.abs(b'c.txt') 'sub/c.txt' c@stt|j|j|j|_||_|j|_g|j D]-}|j drJ|t d^qJ|_ |j rt fd|j D|_ndS(NR3ic3@s|]}|kVqdS(N((RRt(R (s5/usr/lib64/python2.7/site-packages/mercurial/match.pys Js(RRR~RzR{t_patht_matcherRbt_alwaysRRRDR=R(R}R tmatcherRt((R s5/usr/lib64/python2.7/site-packages/mercurial/match.pyR~>s  0 cC@s"|jj|jd||dS(NR3(RReR(R}RtR((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyReLscC@s|jj|jd|S(NR3(RRR(R}Rt((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyROscC@s|jj|jd|S(NR3(RRR(R}Rt((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRRscC@s|jj|jd|S(NR3(RRR(R}Rt((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRUscC@s|jj|jd|S(NR3(RRR(R}Rt((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRXscC@s9|dkr|j}n|jd|}|jj|S(NRR3(RRR(R}R((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyR_s  cC@s9|dkr|j}n|jd|}|jj|S(NRR3(RRR(R}R((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRfs  cC@s|jS(N(R(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRbmscC@s|jjo|j S(N(RR=R(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyR=pscC@sd|j|jfS(Ns#(RR(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRss(RRRR~ReRRRRRRRbR=RRR(((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRs          R#cB@sweZdZd dZedZdZedZdZ dZ dZ dZ e jd ZRS( s7Adapt a matcher to work on a parent directory. The matcher's non-matching-attributes (root, cwd, bad, explicitdir, traversedir) are ignored. The prefix path should usually be the relative path from the root of this matcher to the root of the wrapped matcher. >>> m1 = match(util.localpath(b'root/d/e'), b'f', [b'../a.txt', b'b.txt']) >>> m2 = prefixdirmatcher(b'root', b'd/e/f', b'd/e', m1) >>> bool(m2(b'a.txt'),) False >>> bool(m2(b'd/e/a.txt')) True >>> bool(m2(b'd/e/b.txt')) False >>> m2.files() ['d/e/a.txt', 'd/e/f/b.txt'] >>> m2.exact(b'd/e/a.txt') True >>> m2.visitdir(b'd') True >>> m2.visitdir(b'd/e') True >>> m2.visitdir(b'd/e/f') True >>> m2.visitdir(b'd/e/g') False >>> m2.visitdir(b'd/ef') False cC@sWtt|j||||s4tjdn||_|d|_||_dS(Nsprefix path must not be emptyR3(RR#R~RRRt _pathprefixR(R}R$R%R RR((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyR~s   cC@s$g|jjD]}|j|^q S(N(RRR(R}Rt((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRscC@s3|j|jstS|jj|t|jS(N(RRR?RRRD(R}Rt((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRscC@sttj|jdhBS(NR(RRRR(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyt _pathdirsscC@s[||jkr|jjdS|j|jrN|jj|t|jS||jkS(NR(RRRRRRDR(R}R((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRs cC@sh||jkr|jjdS|j|jrN|jj|t|jS||jkradStS(NRR(RRRRRRDRR(R}R((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRscC@s |jjS(N(RR(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRscC@s |jjS(N(RR=(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyR=scC@sdtj|j|jfS(Ns&(RRRR(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRsN(RRRRR~RRRRRRRR=RRR(((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyR#xs     REcB@sDeZdZdZdZdZdZejdZ RS(sA matcher that is the union of several matchers. The non-matching-attributes (root, cwd, bad, explicitdir, traversedir) are taken from the first matcher. cC@sN|d}tt|j|j|j|j|_|j|_||_dS(Ni(RRER~RzR{RRt _matchers(R}R)R((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyR~s    cC@s(x!|jD]}||r tSq WtS(N(RR@R?(R}RtR((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRs cC@sGt}x:|jD]/}|j|}|dkr5|S||O}qW|S(NR(R?RR(R}RtrRtv((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRs cC@st}t}x~|jD]s}|j|}|s:qn|dkrJ|S|s\|dkrht}qnt|ts}t|j|}qW|rdS|S(NRR(RR?RRR@RRtunion(R}RRRRR((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRs   cC@s d|jS(Ns(R(R}((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRs( RRRR~RRRRRR(((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyREs    cC@st||dS(s8If pattern is 'kind:pat' with a known kind, return kind.i(Rg(tpatternRK((s5/usr/lib64/python2.7/site-packages/mercurial/match.pytpatkindscC@sGd|kr=|jdd\}}|tkr=||fSn||fS(sPSplit a string into the optional pattern kind prefix and the actual pattern.t:i(Rjtallpatternkinds(RRKR+R,((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRgs    c @sdtd}d}tjj}fd}xkrd!}d7|dkr|||7}qC|dkr|dkrd7|dkrd7|d7}q|d 7}q|d 7}qC|d kr|d 7}qC|d kr}|krI||d!dkrI|d7}nx1|kr|||d!dkr||d7}qLW|kr|d7}q|!jdd}|d|dd!dkrd|d}n |dd!dkrd|}nd||f}qC|dkr3|d7}|d7}qC|dkr\|r\|d7}|d8}qC|dkr{|r{|d7}qC|dkr|}|rd7|||7}q|||7}qC|||7}qCW|S(s Convert an extended glob string to a regexp string. >>> from . import pycompat >>> def bprint(s): ... print(pycompat.sysstr(s)) >>> bprint(_globre(br'?')) . >>> bprint(_globre(br'*')) [^/]* >>> bprint(_globre(br'**')) .* >>> bprint(_globre(br'**/a')) (?:.*/)?a >>> bprint(_globre(br'a/**/b')) a/(?:.*/)?b >>> bprint(_globre(br'[a*?!^][^b][!c]')) [a*?!^][\^b][^c] >>> bprint(_globre(br'{a,b}')) (?:a|b) >>> bprint(_globre(br'.\*\?')) \.\*\? iR2c@skod!S(Ni(((titnR,(s5/usr/lib64/python2.7/site-packages/mercurial/match.pytpeek%sis*?[{},\t*R3s(?:.*/)?s.*s[^/]*t?Rt[s!]t]s\[s\s\\t!t^s%s[%s]t{s(?:t}t)t,t|(RDRRtreescapetreplace( R,trestgrouptescapeRRtjtstuffRP((RRR,s5/usr/lib64/python2.7/site-packages/mercurial/match.pyt_globre sf            # &             cC@s|s dS|dkr|S|dkrJ|dkr6dStjj|dS|dkr|dkrkd}ntjj|d}|d S|d krd t||S|d kr|jd r|Sd|S|dkrt||Stjd||fdS(sxConvert a (normalized) pattern of any kind into a regular expression. globsuffix is appended to the regexp of globs.R2R R R Rs(?:/|$)RR3s[^/]+$R s(?:|.*/)RRs.*R snot a regex pattern: %s:%sN(R R (RRRRRRR(R+R,t globsuffixtescaped((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyt_regex[s,         c@sgt||\}rIifd}j|nd}|rtd|Drd|Dfd}dtjtt}j|qt||\}}j|ntdkr|dfS|fd fSd S( slReturn regexp string and a matcher function for kindpats. globsuffix is appended to the regexp of globs.c@s{xtD]l\}}|j|rj|}|dkrVt|}||scS@sh|]\}}}|qS(((RRuRPR((s5/usr/lib64/python2.7/site-packages/mercurial/match.pys s c@s8|jd}|dkr(|| }nd}|kS(NR3iR(R(RtRR(R(s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRs   srootfilesin: %siic@stfdDS(Nc3@s|]}|VqdS(N((RR(Rt(s5/usr/lib64/python2.7/site-packages/mercurial/match.pys s(R(Rt(t matchfuncs(Rts5/usr/lib64/python2.7/site-packages/mercurial/match.pytsN( R>RRRtpprintRtsortedt_buildregexmatchRD(R&RR(R$RRR((RRRRs5/usr/lib64/python2.7/site-packages/mercurial/match.pyRxs$ c @syjddjg|D]!\}}}t|||^q}t|dkrYtn|t|fSWn=tk rt|}|dkrnt||d |\}t||d|\}|fdfStjk rx|D]\}}}ytdt|||Wqtjk r|rjtjt d|||fqtjt d||fqXqWtjt dnXd S( sjBuild a match function from a list of kinds and kindpats, return regexp string and a matcher function.s(?:%s)Ri Nic@s|p|S(N((R(taR(s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRss%s: invalid pattern (%s): %ssinvalid pattern (%s): %ssinvalid patternN( R7RRDt OverflowErrorRRR RRmR( R&RRuRPRRtltregexatregexb((RRs5/usr/lib64/python2.7/site-packages/mercurial/match.pyRs. /    'cC@s g}g}x|D]\}}}|dkrg}xX|jdD]G}d|kszd|kszd|kszd|kr~Pn|j|qDW|jdj|pdq|d kr|j|pdq|d kr|j|pdq|jdqW||fS( s1Returns roots and directories corresponding to each pattern. This calculates the roots and directories exactly matching the patterns and returns a tuple of (roots, dirs) for each. It does not return other directories which may also need to be considered, like the parent directories. R R3RRRRRR R R(R R (R(RjRR7(R&RRR+R,R-R$RP((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyt_patternrootsanddirss  0  cC@st|\}}|S(sFReturns root directories to match recursively from the given patterns.(R (R&RR((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRscC@s^t|\}}g}|jtj||jtj||jd|||fS(sReturns roots and exact directories from patterns. `roots` are directories to match recursively, `dirs` should be matched non-recursively, and `parents` are the implicitly required directories to walk to items in either roots or dirs. Returns a tuple of (roots, dirs, parents). >>> _rootsdirsandparents( ... [(b'glob', b'g/h/*', b''), (b'glob', b'g/h', b''), ... (b'glob', b'g*', b'')]) (['g/h', 'g/h', '.'], [], ['g', '.']) >>> _rootsdirsandparents( ... [(b'rootfilesin', b'g/h', b''), (b'rootfilesin', b'', b'')]) ([], ['g/h', '.'], ['g', '.']) >>> _rootsdirsandparents( ... [(b'relpath', b'r', b''), (b'path', b'p/p', b''), ... (b'path', b'', b'')]) (['r', 'p/p', '.'], [], ['p', '.']) >>> _rootsdirsandparents( ... [(b'relglob', b'rg*', b''), (b're', b're/', b''), ... (b'relre', b'rr', b'')]) (['.', '.', '.'], [], ['.']) R(R RBRRR(R&RRRP((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRs  cC@s3g|D]}|ddkr|^q}t|S(sReturns the potential explicit filenames from the patterns. >>> _explicitfiles([(b'path', b'foo/bar', b'')]) ['foo/bar'] >>> _explicitfiles([(b'rootfilesin', b'foo/bar', b'')]) [] iR(R(R(R&RNtfilable((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyR s )cC@s.x'|D]\}}}|dkrtSqWtS(s:Whether all the patterns match a prefix (i.e. recursively)R R (R R (R?R@(R&R+R,R-((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRs c C@sidd6dd6dd6dd6dd6}d}g}t|d}xttj|d d D]\}}d |krtstjjd antj|} | r|| jd  }n|j d d }n|j }|sq`n|j drU|dj } y|| }Wq`t k rN|rO|td|| fqOq`Xq`n|} xt|jD]f\} } |j | r| } |t| }Pqh|j | drh| } |t| d }PqhqhW|r|j| |||fq`|j| |q`W|j|S(sparse a pattern file, returning a list of patterns. These patterns should be given to compile() to be validated and converted into a match function. trailing white space is dropped. the escape character is backslash. comments start with #. empty lines are skipped. lines can be of the following formats: syntax: regexp # defaults following lines to non-rooted regexps syntax: glob # defaults following lines to non-rooted globs re:pattern # non-rooted regular expression glob:pattern # non-rooted glob pattern # pattern of the current default type if sourceinfo is set, returns a list of tuples: (pattern, lineno, originalline). This is useful to debug ignore patterns. srelre:R tregexpsrelglob:R RRtrbtstartit#s((?:^|[^\\])(?:\\\\)*)#.*s\#ssyntax:is!%s: ignoring invalid syntax '%s' R(topent enumerateRtiterfilet _commentreR RtsearchtendRtrstripRtstriptKeyErrorRt iteritemsRDRtclose( tfilepathRMt sourceinfotsyntaxestsyntaxRJtfptlinenotlineRRt linesyntaxtrels((s5/usr/lib64/python2.7/site-packages/mercurial/match.pyRp sP(     ( R R R R R RRRRRRR(R R (=t __future__RRRdRRnR ti18nRR2RRRRRtutilsRRRhRRR1R>RARR?RHRR]RbRcRfRItobjectRyRWRCRRXRRYRVR[RZRRR#RERRgRRRRR RRRRRRp(((s5/usr/lib64/python2.7/site-packages/mercurial/match.pytsj    (     R     )*%;1B =YQ4  Q  +    )