File: //usr/lib/python3/dist-packages/hgext/__pycache__/sparse.cpython-310.pyc
o
�]Lb�9 � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZm Z m
Z
mZmZm
Z
mZmZmZmZmZmZ dZi Ze�e�Zdd� Zd d
� Zdd� Zd
d� Zdd� Zdd� Zdd� Zedddg ed�ed�fddg ed�ed�fddg ed�ed�fd d!d"ed#�fd$d%g ed&�ed�fd$d'g ed(�ed�fd$d)g ed*�ed�fd$d+d"ed,�fd$d-d"ed.�fd$d/d"ed0�fg
e j ed1�d2d3�d4d5� �Z!d6S )7aG allow sparse checkouts of the working directory (EXPERIMENTAL)
(This extension is not yet protected by backwards compatibility
guarantees. Any aspect may break in future releases until this
notice is removed.)
This extension allows the working directory to only consist of a
subset of files for the revision. This allows specific files or
directories to be explicitly included or excluded. Many repository
operations have performance proportional to the number of files in
the working directory. So only realizing a subset of files in the
working directory can improve performance.
Sparse Config Files
-------------------
The set of files that are part of a sparse checkout are defined by
a sparse config file. The file defines 3 things: includes (files to
include in the sparse checkout), excludes (files to exclude from the
sparse checkout), and profiles (links to other config files).
The file format is newline delimited. Empty lines and lines beginning
with ``#`` are ignored.
Lines beginning with ``%include `` denote another sparse config file
to include. e.g. ``%include tests.sparse``. The filename is relative
to the repository root.
The special lines ``[include]`` and ``[exclude]`` denote the section
for includes and excludes that follow, respectively. It is illegal to
have ``[include]`` after ``[exclude]``.
Non-special lines resemble file patterns to be added to either includes
or excludes. The syntax of these lines is documented by :hg:`help patterns`.
Patterns are interpreted as ``glob:`` by default and match against the
root of the repository.
Exclusion patterns take precedence over inclusion patterns. So even
if a file is explicitly included, an ``[exclude]`` entry can remove it.
For example, say you have a repository with 3 directories, ``frontend/``,
``backend/``, and ``tools/``. ``frontend/`` and ``backend/`` correspond
to different projects and it is uncommon for someone working on one
to need the files for the other. But ``tools/`` contains files shared
between both projects. Your sparse config files may resemble::
# frontend.sparse
frontend/**
tools/**
# backend.sparse
backend/**
tools/**
Say the backend grows in size. Or there's a directory with thousands
of files you wish to exclude. You can modify the profile to exclude
certain files::
[include]
backend/**
tools/**
[exclude]
tools/tests/**
� )�absolute_import)�_)�setattr)�cmdutil�commands�dirstate�error�
extensions�
logcmdutil�match�merge�pycompat� registrar�sparse�utils ships-with-hg-corec C s* dt _t| � t| � t| � t| � d S )NT)r �enabled�_setupclone� _setuplog� _setupadd�_setupdirstate)�ui� r �./usr/lib/python3/dist-packages/hgext/sparse.py�extsetupg s
r c C sp | }t |�sJ �| tur(|| jv r| j| }t| |||�� n | jd } | tus| tu r6ttd�||f ��dS )ziReplace a filecache property with a new class. This allows changing the
cache invalidation condition.r s type '%s' has no property '%s'N)�callable�object�__dict__r � __bases__�AttributeErrorr )�cls�propname�replacement�origcls�origr r r �replacefilecachep s
���r$ c C s2 t jd }|d �d� dd� }t�td|� d S )Ns log|history� )� � sparseNs1 limit to changesets affecting the sparse checkoutc s<