File: //usr/lib/python2.7/dist-packages/mercurial/pathutil.pyc
σ
x7_c @@ sΆ d d l m Z d d l Z d d l Z d d l Z d d l Z d d l m Z d d l m Z m
Z
m Z d Z d e
f d YZ d d Z d
Z e j Z e j Z d S( i ( t absolute_importNi ( t _( t encodingt errort utilc C@ s t j | j S( N( R t hfsignorecleant lower( t s( ( s6 /usr/lib/python2.7/dist-packages/mercurial/pathutil.pyt _lowerclean s t pathauditorc B@ s; e Z d Z d e e d Z d Z d Z d Z RS( s^ ensure that a filesystem path contains no banned components.
the following properties of a path are checked:
- ends with a directory separator
- under top-level .hg
- starts at the root of a windows drive
- contains ".."
More check are also done about the file system states:
- traverses a symlink (e.g. a/symlink_here/b)
- inside a nested repository (a callback can be used to approve
some nested repositories, e.g., subrepositories)
The file system checks are only done when 'realfs' is set to True (the
default). They should be disable then we are auditing path for operation on
stored history.
If 'cached' is set to True, audited paths and sub-directories are cached.
Be careful to not keep the cache of unmanaged directories for long because
audited paths may be replaced with symlinks.
c C@ s} t | _ t | _ | | _ | | _ | | _ | | _ t j j | rm t
j | rm t
j | _ n d | _ d S( Nc S@ s | S( N( ( t x( ( s6 /usr/lib/python2.7/dist-packages/mercurial/pathutil.pyt <lambda>3 s (
t sett auditedt
auditeddirt roott _realfst _cachedt callbackt ost patht lexistsR t fscasesensitivet normcase( t selfR R t realfst cached( ( s6 /usr/lib/python2.7/dist-packages/mercurial/pathutil.pyt __init__) s "c C@ sά t j | } | j | } | | j k r1 d St j | r\ t j t d | n t j | } t j
j | d s¦ t | d d
k s¦ t j
| k rΒ t j t d | n xo | D]g } d | k rΙ | j d d \ } } | j r0| j d k r0t j t d | q0qΙ qΙ Wd t | k rΦg | D] } t | j ^ qM} xh d D]] } | | d k rr| j | } t j
j | | } t j t d | | f qrqrWn t j | }
t | t |
k st | j |
j g } x t t | D]x } t j j | | d }
t j j |
| d } | | j k rq0n | j r| j |
| n | j | q0W| j rΨ| j j | | j j | n d S( sP Check the relative path.
path may contain a pattern (e.g. foodir/**.txt)Ns$ path ends in directory separator: %si s .hgs .hg.t s# path contains illegal component: %st ~i t HGt HG8B6Cs"