| 1 |
<?xml version="1.0" encoding="utf-8"?> |
| 2 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 3 |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| 4 |
<head> |
| 5 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| 6 |
<meta name="generator" content="Docutils 0.21.2: https://docutils.sourceforge.io/" /> |
| 7 |
<title>sparse</title> |
| 8 |
<link rel="stylesheet" href="../style.css" type="text/css" /> |
| 9 |
</head> |
| 10 |
<body> |
| 11 |
<div class="document" id="sparse"> |
| 12 |
<span id="ext-sparse"></span> |
| 13 |
<h1 class="title">sparse</h1> |
| 14 |
|
| 15 |
<div class="contents htmlonly topic" id="contents"> |
| 16 |
<p class="topic-title"><a class="reference internal" href="#top">Contents</a></p> |
| 17 |
<ul class="simple"> |
| 18 |
<li><a class="reference internal" href="#description" id="toc-entry-1">Description</a><ul> |
| 19 |
<li><a class="reference internal" href="#sparse-config-files" id="toc-entry-2">Sparse Config Files</a></li> |
| 20 |
</ul> |
| 21 |
</li> |
| 22 |
<li><a class="reference internal" href="#commands" id="toc-entry-3">Commands</a></li> |
| 23 |
</ul> |
| 24 |
</div> |
| 25 |
<p>allow sparse checkouts of the working directory (EXPERIMENTAL)</p> |
| 26 |
<div class="section" id="description"> |
| 27 |
<h1><a class="toc-backref" href="#contents">Description</a></h1> |
| 28 |
<p>(This extension is not yet protected by backwards compatibility |
| 29 |
guarantees. Any aspect may break in future releases until this |
| 30 |
notice is removed.)</p> |
| 31 |
<p>This extension allows the working directory to only consist of a |
| 32 |
subset of files for the revision. This allows specific files or |
| 33 |
directories to be explicitly included or excluded. Many repository |
| 34 |
operations have performance proportional to the number of files in |
| 35 |
the working directory. So only realizing a subset of files in the |
| 36 |
working directory can improve performance.</p> |
| 37 |
<div class="section" id="sparse-config-files"> |
| 38 |
<h2><a class="toc-backref" href="#contents">Sparse Config Files</a></h2> |
| 39 |
<p>The set of files that are part of a sparse checkout are defined by |
| 40 |
a sparse config file. The file defines 3 things: includes (files to |
| 41 |
include in the sparse checkout), excludes (files to exclude from the |
| 42 |
sparse checkout), and profiles (links to other config files).</p> |
| 43 |
<p>The file format is newline delimited. Empty lines and lines beginning |
| 44 |
with <tt class="docutils literal">#</tt> are ignored.</p> |
| 45 |
<p>Lines beginning with <tt class="docutils literal">%include `` denote another sparse config file |
| 46 |
to include. e.g. <span class="pre">``%include</span> tests.sparse</tt>. The filename is relative |
| 47 |
to the repository root.</p> |
| 48 |
<p>The special lines <tt class="docutils literal">[include]</tt> and <tt class="docutils literal">[exclude]</tt> denote the section |
| 49 |
for includes and excludes that follow, respectively. It is illegal to |
| 50 |
have <tt class="docutils literal">[include]</tt> after <tt class="docutils literal">[exclude]</tt>.</p> |
| 51 |
<p>Non-special lines resemble file patterns to be added to either includes |
| 52 |
or excludes. The syntax of these lines is documented by <a class="reference external" href="topic-patterns.html"><tt class="docutils literal">hg help patterns</tt></a>. |
| 53 |
Patterns are interpreted as <tt class="docutils literal">glob:</tt> by default and match against the |
| 54 |
root of the repository.</p> |
| 55 |
<p>Exclusion patterns take precedence over inclusion patterns. So even |
| 56 |
if a file is explicitly included, an <tt class="docutils literal">[exclude]</tt> entry can remove it.</p> |
| 57 |
<p>For example, say you have a repository with 3 directories, <tt class="docutils literal">frontend/</tt>, |
| 58 |
<tt class="docutils literal">backend/</tt>, and <tt class="docutils literal">tools/</tt>. <tt class="docutils literal">frontend/</tt> and <tt class="docutils literal">backend/</tt> correspond |
| 59 |
to different projects and it is uncommon for someone working on one |
| 60 |
to need the files for the other. But <tt class="docutils literal">tools/</tt> contains files shared |
| 61 |
between both projects. Your sparse config files may resemble:</p> |
| 62 |
<pre class="literal-block"> |
| 63 |
# frontend.sparse |
| 64 |
frontend/** |
| 65 |
tools/** |
| 66 |
|
| 67 |
# backend.sparse |
| 68 |
backend/** |
| 69 |
tools/** |
| 70 |
</pre> |
| 71 |
<p>Say the backend grows in size. Or there's a directory with thousands |
| 72 |
of files you wish to exclude. You can modify the profile to exclude |
| 73 |
certain files:</p> |
| 74 |
<pre class="literal-block"> |
| 75 |
[include] |
| 76 |
backend/** |
| 77 |
tools/** |
| 78 |
|
| 79 |
[exclude] |
| 80 |
tools/tests/** |
| 81 |
</pre> |
| 82 |
</div> |
| 83 |
</div> |
| 84 |
<div class="section" id="commands"> |
| 85 |
<h1><a class="toc-backref" href="#contents">Commands</a></h1> |
| 86 |
</div> |
| 87 |
</div> |
| 88 |
</body> |
| 89 |
</html> |