\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@sdZddlmZddlmZddlmZmZmZm Z m Z m Z m Z mZmZmZmZdZiZejeZdZdZdZd Zd Zd Zd Zed ddeedfddeedfddeedfddeedfddeedfddeedfddeed fdd!eed"fdd#eed$fdd%eed&fg ejed'd(ed)Zd*S(+sG 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/** i(tabsolute_import(t_( tcommandstdirstateterrort extensionsthgt logcmdutiltmatchtpycompatt registrartsparsetutilsships-with-hg-corecC@s5tt_t|t|t|t|dS(N(tTrueR tenabledt _setupclonet _setuplogt _setupaddt_setupdirstate(tui((s2/usr/lib64/python2.7/site-packages/hgext/sparse.pytextsetupds     cC@s|}t|stxS|tk rm||jkr]|j|}t||||Pn|jd}qW|tkrttd||fndS(siReplace a filecache property with a new class. This allows changing the cache invalidation condition.istype '%s' has no property '%s'N(tcallabletAssertionErrortobjectt__dict__tsetattrt __bases__tAttributeErrorR(tclstpropnamet replacementtorigclstorig((s2/usr/lib64/python2.7/site-packages/hgext/sparse.pytreplacefilecachels  cC@s>tjd}|djdd}tjtd|dS( Ns log|historyitR s1limit to changesets affecting the sparse checkoutc@sU||}|jdrQtjfd}|j|}n|S(NR c@s*|}tfd|jDS(Nc3@s!|]}|r|VqdS(N((t.0tf(t sparsematch(s2/usr/lib64/python2.7/site-packages/hgext/sparse.pys s(tanytfiles(trevtctx(trepoR%(s2/usr/lib64/python2.7/site-packages/hgext/sparse.pytctxmatchs (tgetR tmatchertfilter(R R*toptstrevsR+((R*R%s2/usr/lib64/python2.7/site-packages/hgext/sparse.pyt _initialrevss R1(R"R Ns1limit to changesets affecting the sparse checkout(RttabletappendtNoneRt wrapfunctionR(RtentryR1((s2/usr/lib64/python2.7/site-packages/hgext/sparse.pyR|s    c @s|jd}|jd}|jd}t|rP|tn|re|tn|rz|tntgdkrtjtdnssrfd}tjt d|n|||||S(Ntincludetexcludetenable_profileistoo many flags specified.c @sGtj|jiddddt||||||S(NR7R8t enableprofiletusereporootpaths(R t updateconfigt unfilteredR (R tselftnodet overwritetargstkwargs(R:R8R7tpat(s2/usr/lib64/python2.7/site-packages/hgext/sparse.pyt clonesparses t updaterepo( R,tFalseR tsumRtAbortRRR5R( R RR*RAR/t include_patt exclude_pattenableprofile_patRD((R:R8R7RCs2/usr/lib64/python2.7/site-packages/hgext/sparse.pyt_clonesparsecmds&   cC@s~tjd}|djddgdf|djddgdf|djddgd ftjtjdtdS( NtcloneiR"senable-profilesenable a sparse profileR7sinclude sparse patternR8sexclude sparse pattern(RR2R3Rt wrapcommandRL(RR6((s2/usr/lib64/python2.7/site-packages/hgext/sparse.pyRs    cC@sAtjd}|djdd}tjtjd|dS(NtadditsR s8also include directories of added files in sparse configc _@s|jdrmt}x0|D](}tj|\}}|j|qWtj|t||dtn|||||S(NR R7( R,tsetR tsplitROR R<tlistR ( R RR*tpatsR/tdirsRCtdirnametbasename((s2/usr/lib64/python2.7/site-packages/hgext/sparse.pyt_adds  "(RPR Ns8also include directories of added files in sparse config(RR2R3R4RRN(RR6RX((s2/usr/lib64/python2.7/site-packages/hgext/sparse.pyRs    c@std}tjtjd|dd}tjtjd|ddddd d g}td d x3|D]+}fd }tjtj||qsWdS(s|Modify the dirstate to prevent stat'ing excluded files, and to prevent modifications to files outside the checkout. c S@sdtj|j|j|j}tj|j|g}tj||}|||||||S(N(tmatchmodtexactt_roott_cwdR't unionmatchert_sparsematchertintersectmatchers( R R>Rtsubrepostunknowntignoredtfulltemtsm((s2/usr/lib64/python2.7/site-packages/hgext/sparse.pytwalks!Rfc@s|jjs|j}|rRg|D]}|r1|^q1}n|dk rtfd|D}|j|}qn|||||S(Nc3@s!|]}|s|VqdS(N((R#R$(R-(s2/usr/lib64/python2.7/site-packages/hgext/sparse.pys s(R^talwaystmatchesR4RQtunion(R R>tparenttallfilest changedfilesR$tdirstatefilestoremove((R-s2/usr/lib64/python2.7/site-packages/hgext/sparse.pyt_rebuilds  ( trebuildtnormalROt normallookuptcopytremovetmerges>include file with `hg debugsparse --include ` or use s9`hg add -s ` to include file directory while addingc@s}|j}|jspxX|D]M}|dk r|| r||krtjtd|dqqWn|||S(Ns3cannot add '%s' - it is outside the sparse checkoutthint(R^RgR4RRHR(R R>RAR%R$(Ru(s2/usr/lib64/python2.7/site-packages/hgext/sparse.pyt_wrappers    N(R RR5RR4R(RRfRnt editfuncstfuncRv((Rus2/usr/lib64/python2.7/site-packages/hgext/sparse.pyRs     t debugsparsetIR7s$include files in the sparse checkouttXR8s$exclude files in the sparse checkouttdtdeletesdelete an include/exclude ruleR$tforces.allow changing rules even with pending changesR"senable-profilesenables the specified profilesdisable-profilesdisables the specified profiles import-rulessimports rules from a files clear-ruless"clears local include/exclude rulestrefreshs,updates the working after sparseness changestresetsmakes the repo full agains[--OPTION] PATTERN...t helpbasiccO@stj|}|jd}|jd}|jd}|jd}|jd}|jd} |jd} |jd} |jd } |jd } t||||| | | | | g }|d krtjtd n|d kr|jjdrs|j |jj ddt j |}|r|j td|j dj |dqn|j tddS|s|s| s| s|s|rt j|||d|d|d | d| d|d|d|n| rt j|||d|n| r,t j|d|n| rzq|j}ttt j||j t j|d|}t j||d|d d|d d|dWd|jXndS(smake the current checkout sparse, or edit the existing checkout The sparse command is used to make the current checkout sparse. This means files that don't meet the sparse condition will not be written to disk, or show up in any working copy operations. It does not affect files in history in any way. Passing no arguments prints the currently applied sparse rules. --include and --exclude are used to add and remove files from the sparse checkout. The effects of adding an include or exclude rule are applied immediately. If applying the new rule would cause a file with pending changes to be added or removed, the command will fail. Pass --force to force a rule change even with pending changes (the changes on disk will be preserved). --delete removes an existing include/exclude rule. The effects are immediate. --refresh refreshes the files on disk based on the sparse rules. This is only necessary if .hg/sparse was changed by hand. --enable-profile and --disable-profile accept a path to a .hgsparse file. This allows defining sparse checkouts and tracking them inside the repository. This is useful for defining commonly used sparse checkouts for many people to use. As the profile definition changes over time, the sparse checkout will automatically be updated appropriately, depending on which changeset is checked out. Changes to .hgsparse are not applied until they have been committed. --import-rules accepts a path to a file containing rules in the .hgsparse format, allowing you to add --include, --exclude and --enable-profile rules in bulk. Like the --include, --exclude and --enable-profile switches, the changes are applied immediately. --clear-rules removes all local include and exclude rules, while leaving any enabled profiles in place. Returns 0 if editing the sparse checkout succeeds. R7R8R~R9tdisable_profilet import_rulest clear_rulesR}RRistoo many flags specifiediR s s/Temporarily Included Files (for merge/rebase): srepo is not sparse NR:tdisableprofiletaddedtdroppedt conflictingi(R t byteskwargsR,RGRRHRtvfstexistststatustreadR treadtemporaryincludestjoinR<timportfromfilest clearrulestwlocktmaptlent refreshwdirR-t printchangestrelease(RR*RTR/R7R8R~R:Rt importrulesRR}RRtcountttemporaryincludesRtfcounts((s2/usr/lib64/python2.7/site-packages/hgext/sparse.pyRysV7   $  ! #N( t__doc__t __future__Rtmercurial.i18nRt mercurialRRRRRRRRYR R R R t testedwithtcmdtabletcommandRR!RRLRRRRFt templateoptsR Ry(((s2/usr/lib64/python2.7/site-packages/hgext/sparse.pytHs6L      1