comparison tests/test-narrow-clone-no-ellipsis.t @ 36079:a2a6e724d61a

narrow: import experimental extension from narrowhg revision cb51d673e9c5 Adjustments: * renamed src to hgext/narrow * marked extension experimental * added correct copyright header where it was missing * updated hgrc extension enable line in library.sh * renamed library.sh to narrow-library.sh * dropped all files from repo root as they're not interesting * dropped test-pyflakes.t, test-check-code.t and test-check-py3-compat.t * renamed remaining tests to all be test-narrow-* when they didn't already * fixed test-narrow-expanddirstate.t to refer to narrow and not narrowhg * fixed tests that wanted `update -C .` instead of `merge --abort` * corrected a two-space indent in narrowspec.py * added a missing _() in narrowcommands.py * fixed imports to pass the import checker * narrow only adds its --include and --exclude to clone if sparse isn't enabled to avoid breaking test-duplicateoptions.py. This is a kludge, and we'll need to come up with a better solution in the future. These were more or less the minimum to import something that would pass tests and not create a bunch of files we'll never use. Changes I intend to make as followups: * rework the test-narrow-*-tree.t tests to use the new testcases functionality in run-tests.py * remove lots of monkeypatches of core things Differential Revision: https://phab.mercurial-scm.org/D1974
author Augie Fackler <augie@google.com>
date Mon, 29 Jan 2018 16:19:33 -0500
parents
children e14821b290eb
comparison
equal deleted inserted replaced
36078:7f68235f23ff 36079:a2a6e724d61a
1 $ . "$TESTDIR/narrow-library.sh"
2
3 $ hg init master
4 $ cd master
5 $ mkdir dir
6 $ mkdir dir/src
7 $ cd dir/src
8 $ for x in `$TESTDIR/seq.py 20`; do echo $x > "f$x"; hg add "f$x"; hg commit -m "Commit src $x"; done
9 $ cd ..
10 $ mkdir tests
11 $ cd tests
12 $ for x in `$TESTDIR/seq.py 20`; do echo $x > "t$x"; hg add "t$x"; hg commit -m "Commit test $x"; done
13 $ cd ../../..
14
15 narrow clone a file, f10
16
17 $ hg clone --narrow ssh://user@dummy/master narrow --noupdate --include "dir/src/f10"
18 requesting all changes
19 adding changesets
20 adding manifests
21 adding file changes
22 added 40 changesets with 1 changes to 1 files
23 new changesets *:* (glob)
24 $ cd narrow
25 $ cat .hg/requires | grep -v generaldelta
26 dotencode
27 fncache
28 narrowhg
29 revlogv1
30 store
31
32 $ cat .hg/narrowspec
33 [includes]
34 path:dir/src/f10
35 [excludes]
36 $ hg update
37 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
38 $ find * | sort
39 dir
40 dir/src
41 dir/src/f10
42 $ cat dir/src/f10
43 10
44
45 $ cd ..
46
47 narrow clone a directory, tests/, except tests/t19
48
49 $ hg clone --narrow ssh://user@dummy/master narrowdir --noupdate --include "dir/tests/" --exclude "dir/tests/t19"
50 requesting all changes
51 adding changesets
52 adding manifests
53 adding file changes
54 added 40 changesets with 19 changes to 19 files
55 new changesets *:* (glob)
56 $ cd narrowdir
57 $ cat .hg/narrowspec
58 [includes]
59 path:dir/tests
60 [excludes]
61 path:dir/tests/t19
62 $ hg update
63 19 files updated, 0 files merged, 0 files removed, 0 files unresolved
64 $ find * | sort
65 dir
66 dir/tests
67 dir/tests/t1
68 dir/tests/t10
69 dir/tests/t11
70 dir/tests/t12
71 dir/tests/t13
72 dir/tests/t14
73 dir/tests/t15
74 dir/tests/t16
75 dir/tests/t17
76 dir/tests/t18
77 dir/tests/t2
78 dir/tests/t20
79 dir/tests/t3
80 dir/tests/t4
81 dir/tests/t5
82 dir/tests/t6
83 dir/tests/t7
84 dir/tests/t8
85 dir/tests/t9
86
87 $ cd ..
88
89 narrow clone everything but a directory (tests/)
90
91 $ hg clone --narrow ssh://user@dummy/master narrowroot --noupdate --exclude "dir/tests"
92 requesting all changes
93 adding changesets
94 adding manifests
95 adding file changes
96 added 40 changesets with 20 changes to 20 files
97 new changesets *:* (glob)
98 $ cd narrowroot
99 $ cat .hg/narrowspec
100 [includes]
101 path:.
102 [excludes]
103 path:dir/tests
104 $ hg update
105 20 files updated, 0 files merged, 0 files removed, 0 files unresolved
106 $ find * | sort
107 dir
108 dir/src
109 dir/src/f1
110 dir/src/f10
111 dir/src/f11
112 dir/src/f12
113 dir/src/f13
114 dir/src/f14
115 dir/src/f15
116 dir/src/f16
117 dir/src/f17
118 dir/src/f18
119 dir/src/f19
120 dir/src/f2
121 dir/src/f20
122 dir/src/f3
123 dir/src/f4
124 dir/src/f5
125 dir/src/f6
126 dir/src/f7
127 dir/src/f8
128 dir/src/f9
129
130 $ cd ..