sapling/tests/test-sparse-merges.t
Durham Goode 08d5465b17 sparse: add sparse checkout extension
Summary:
Adds a sparse checkout extension that allows you to checkout just part of the
working copy.  This only affects the working copy, it does not affect history,
or what is pushed and pulled from the server.

The basic api is:

hg sparse --include PATTERN...  # add a pattern to the sparse checkout
hg sparse --exclude PATTERN...  # excludes files from the sparse checkout
hg sparse --delete PATTERN...   # deletes an include/exclude rule
hg sparse --enable-profile      # enables a predefined sparse profile
hg sparse --disable-profile     # disables a predefined sparse profile
hg sparse --reset               # makes the repository full again
hg sparse --refresh             # refreshes the working copy if .hg/sparse was
modified manually
hg sparse                       # show the current sparse rules

Test Plan:
Added tests. Ran them. Also deploy it to a couple users for a bit
without major issues.

Reviewers: pyd, sid0, rmcelroy, davidsp, mpm

Subscribers: mitrandir, akushner

Differential Revision: https://phabricator.fb.com/D1698824
2014-12-01 11:02:08 -08:00

27 lines
560 B
Perl

test sparse
$ hg init myrepo
$ cd myrepo
$ cat > .hg/hgrc <<EOF
> [extensions]
> sparse=$(dirname $TESTDIR)/sparse.py
> EOF
$ echo foo > foo
$ echo bar > bar
$ hg add foo bar
$ hg commit -m initial
$ hg branch feature
marked working directory as branch feature
(branches are permanent and global, did you want a bookmark?)
$ echo bar2 >> bar
$ hg commit -m 'feature - bar2'
$ hg update -q default
$ hg sparse --exclude 'bar**'
$ hg merge feature
abort: cannot merge because bar is outside the sparse checkout
[255]