korsygfhrtzangaiide
Elepffwdsff
/
lib64
/
python2.7
/
site-packages
/
hgext
/
Upload FileeE
HOME
� Hq�Qc @ s/ d Z d d l m Z d d l m Z m Z m Z m Z m Z d d l Z d d l Z d Z e j d � Z e j d � Z d � Z d � Z d � Z d � Z i e d 6e d 6e d 6e d 6e d 6Z d e f d � � YZ d � Z d � Z d � Z d � Z e Z d � Z d � Z d � Z d � Z d S( s' automatically manage newlines in repository files This extension allows you to manage the type of line endings (CRLF or LF) that are used in the repository and in the local working directory. That way you can get CRLF line endings on Windows and LF on Unix/Mac, thereby letting everybody use their OS native line endings. The extension reads its configuration from a versioned ``.hgeol`` configuration file found in the root of the working copy. The ``.hgeol`` file use the same syntax as all other Mercurial configuration files. It uses two sections, ``[patterns]`` and ``[repository]``. The ``[patterns]`` section specifies how line endings should be converted between the working copy and the repository. The format is specified by a file pattern. The first match is used, so put more specific patterns first. The available line endings are ``LF``, ``CRLF``, and ``BIN``. Files with the declared format of ``CRLF`` or ``LF`` are always checked out and stored in the repository in that format and files declared to be binary (``BIN``) are left unchanged. Additionally, ``native`` is an alias for checking out in the platform's default line ending: ``LF`` on Unix (including Mac OS X) and ``CRLF`` on Windows. Note that ``BIN`` (do nothing to line endings) is Mercurial's default behaviour; it is only needed if you need to override a later, more general pattern. The optional ``[repository]`` section specifies the line endings to use for files stored in the repository. It has a single setting, ``native``, which determines the storage line endings for files declared as ``native`` in the ``[patterns]`` section. It can be set to ``LF`` or ``CRLF``. The default is ``LF``. For example, this means that on Windows, files configured as ``native`` (``CRLF`` by default) will be converted to ``LF`` when stored in the repository. Files declared as ``LF``, ``CRLF``, or ``BIN`` in the ``[patterns]`` section are always stored as-is in the repository. Example versioned ``.hgeol`` file:: [patterns] **.py = native **.vcproj = CRLF **.txt = native Makefile = LF **.jpg = BIN [repository] native = LF .. note:: The rules will first apply when files are touched in the working copy, e.g. by updating to null and back to tip to touch all files. The extension uses an optional ``[eol]`` section read from both the normal Mercurial configuration files and the ``.hgeol`` file, with the latter overriding the former. You can use that section to control the overall behavior. There are three settings: - ``eol.native`` (default ``os.linesep``) can be set to ``LF`` or ``CRLF`` to override the default interpretation of ``native`` for checkout. This can be used with :hg:`archive` on Unix, say, to generate an archive where files have line endings for Windows. - ``eol.only-consistent`` (default True) can be set to False to make the extension convert files with inconsistent EOLs. Inconsistent means that there is both ``CRLF`` and ``LF`` present in the file. Such files are normally not touched under the assumption that they have mixed EOLs on purpose. - ``eol.fix-trailing-newline`` (default False) can be set to True to ensure that converted files end with a EOL character (either ``\n`` or ``\r\n`` as per the configured patterns). The extension provides ``cleverencode:`` and ``cleverdecode:`` filters like the deprecated win32text extension does. This means that you can disable win32text and enable eol and your filters will still work. You only need to these filters until you have prepared a ``.hgeol`` file. The ``win32text.forbid*`` hooks provided by the win32text extension have been unified into a single hook named ``eol.checkheadshook``. The hook will lookup the expected line endings from the ``.hgeol`` file, which means you must migrate to a ``.hgeol`` file first before using the hook. ``eol.checkheadshook`` only checks heads, intermediate invalid revisions will be pushed. To forbid them completely, use the ``eol.checkallhook`` hook. These hooks are best used as ``pretxnchangegroup`` hooks. See :hg:`help patterns` for more information about the glob patterns used. i����( t _( t utilt configt extensionst matcht errorNt internals (^|[^ ]) s * c C s d | k o t j | � S( Ns ( t singlelft search( t data( ( s/ /usr/lib64/python2.7/site-packages/hgext/eol.pyt inconsistenteolk s c K s� t j | � r | S| j d d t � r8 t | � r8 | S| j d d t � rp | rp | d d k rp | d } n t j d | � S( s Filter to convert to LF EOLs.t eols only-consistents fix-trailing-newlinei����s ( R t binaryt configboolt TrueR t Falset eolret sub( t st paramst uit kwargs( ( s/ /usr/lib64/python2.7/site-packages/hgext/eol.pyt tolfn s ! c K s� t j | � r | S| j d d t � r8 t | � r8 | S| j d d t � rp | rp | d d k rp | d } n t j d | � S( s Filter to convert to CRLF EOLs.R s only-consistents fix-trailing-newlinei����s s ( R R R R R R R R ( R R R R ( ( s/ /usr/lib64/python2.7/site-packages/hgext/eol.pyt tocrlfy s ! c C s | S( s# Filter to do nothing with the file.( ( R R ( ( s/ /usr/lib64/python2.7/site-packages/hgext/eol.pyt isbinary� s s to-lfs to-crlfs is-binarys cleverencode:s cleverdecode:t eolfilec B s# e Z d � Z d � Z d � Z RS( c C se i d d 6d d 6d d 6| _ i d d 6d d 6d d 6| _ t j � | _ | j j d d d � | j j d | � | j j d d � d k } | r� d p� d | j d <| j d d t j � d k } | r� d p� d | j d <g } g } xU | j j d � D]A \ } } | j � } | d k r2| j | � q� | j | � q� Wt j | d g | | � | _ d S( Ns to-lft LFs to-crlft CRLFs is-binaryt BINt patternss .hg*s .hgeolt repositoryt nativet NATIVER s t ( R s ( t _decodet _encodeR t cfgt sett parset gett ost linesept itemst uppert appendR ( t selfR t rootR t isrepolft iswdlft includet excludet patternt stylet key( ( s/ /usr/lib64/python2.7/site-packages/hgext/eol.pyt __init__� s"