^c$ddlZddlmZmZmZddlmZejrddlmZ nddlm Z e j Z e j Z e j Z dZd dZd Zd Zd Zd ZdS)N)encodingpycompatutil) resourceutil) scmwindows)scmposixctj|tjr?tjjt fdtjDSgS)z@path could be a file or a directory. return a list of file pathsc3`K|](\}}|d|V)dS).rcN)endswith).0fkjoinps 2/usr/lib/python3/dist-packages/mercurial/rcutil.py z _expandrcpath.."sV  1aajj6H6H DAJJ      )r expandpathospathisdirrsortedlistdir)rrrs @@r _expandrcpathrs A w}}Q w|     #'<??       3Jrc| tj}gd}g}|D]-\}}}||vr |||||d|zf.|S)zReturn [(section, name, value, source)] config items. The config items are extracted from environment variables specified by env, used to override systemrc, but not userrc. If env is not provided, encoding.environ will be used. N))sEDITORuieditor)sVISUALrr)sPAGERpagerr s$%s)renvironappend)env checklistresultenvnamesection confignames r envrcitemsr)(s{ {I F(1MM$* #    w CL&7:JKLLLL Mrc\tjd}dt|DS)z#return rc resource IDs in defaultrcmercurial.defaultrccjg|]0}tjd||d,d|f1S)r+r )r is_resourcer rrs r z(default_rc_resources..BsW     #$:A > >  JJv     #   r)rcontentsr)rsrcss rdefault_rc_resourcesr3?s:  !"8 9 9E     rcdtf}dtjvre|g}tjdtjD]1}|s|dt|D2ndtD}d}||t| |||t|S)aRreturn an ordered [(type, obj)] about where to load configs. respect $HGRCPATH. if $HGRCPATH is empty, only .hg/hgrc of current repo is used. if $HGRCPATH is not set, the platform default will be used. if a directory is provided, *.rc files under it will be used. type could be either 'path', 'items' or 'resource'. If type is 'path', obj is a string, and is the config file path. if type is 'items', obj is a list of (section, name, value, source) that should fill the config directly. If type is 'resource', obj is a tuple of (package name, resource name). sitemssHGRCPATHc3K|]}d|fV dS)pathNrrs rrzrccomponents..`s& H H!'1 H H H H H Hrcg|]}d|fS)sresourcer7r.s rr0z rccomponents..bsJJJa+q)JJJrcd|DS)NcPg|]#}dtj|f$S)r6)rrnormpathr8s rr0z2rccomponents....ds:# # # /0Wbg&&q)) *# # # rr7)pathss rzrccomponents..ds # # 49# # # r) r)rr!splitr ospathsepextendrr3 systemrcpathr" userrcpath)envrc _rccomponentsr normpathss r rccomponentsrGJsz|| $Eh&&& !+.44X5GHH I IA   H H}Q7G7G H H H H H H H I KJ3G3I3IJJJ    YY|~~66777U###YYz||44555 rc dddS)zureturn a dict of default environment variables and their values, intended to be set before starting a pager. sFRXs-c)sLESSsLVr7r7rrdefaultpagerenvrImsE * **rcdtjvS)z5True if repositories `.hg/hgrc` config should be reads HGRCSKIPREPO)rr!r7rr use_repo_hgrcrKts ("2 22r)N)rrrrutilsr iswindowsr scmplatformr fallbackpagerrBrCrr)r3rGrIrKr7rrrQs     *+++++++))))))) '  # .   F+++33333r