comparison tests/test-narrow-clone-no-ellipsis.t @ 39247:f4d4bd8c8911

narrow: add a --narrowspec flag to clone command This patch adds a --narrowspec flag to `hg clone` command in narrow extension which can be used to read a file and parse narrowspecs from it and use it while cloning a repository. The --narrowspec flag assumes that the user wanted to narrow the clone. Tests are added both for ellipsis and non-ellipsis mode. Differential Revision: https://phab.mercurial-scm.org/D4156
author Pulkit Goyal <pulkit@yandex-team.ru>
date Wed, 08 Aug 2018 13:56:53 +0300
parents fa64a229f24b
children 8301741e1f89
comparison
equal deleted inserted replaced
39246:61700d525a3b 39247:f4d4bd8c8911
121 dir/src/f7 121 dir/src/f7
122 dir/src/f8 122 dir/src/f8
123 dir/src/f9 123 dir/src/f9
124 124
125 $ cd .. 125 $ cd ..
126
127 Testing the --narrowspec flag to clone
128
129 $ cat >> narrowspecs <<EOF
130 > %include foo
131 > [include]
132 > path:dir/tests/
133 > file:dir/src/f12
134 > EOF
135
136 $ hg clone ssh://user@dummy/master specfile --narrowspec narrowspecs
137 reading narrowspec from '$TESTTMP/narrowspecs'
138 abort: cannot specify other files using '%include' in narrowspec
139 [255]
140
141 $ cat > narrowspecs <<EOF
142 > [include]
143 > path:dir/tests/
144 > file:dir/src/f12
145 > EOF
146
147 $ hg clone ssh://user@dummy/master specfile --narrowspec narrowspecs
148 reading narrowspec from '$TESTTMP/narrowspecs'
149 requesting all changes
150 adding changesets
151 adding manifests
152 adding file changes
153 added 40 changesets with 20 changes to 20 files
154 new changesets 681085829a73:26ce255d5b5d
155 updating to branch default
156 20 files updated, 0 files merged, 0 files removed, 0 files unresolved
157 $ cd specfile
158 $ hg tracked
159 I path:dir/tests
160 I path:file:dir/src/f12
161 $ cd ..