comparison tests/test-narrow-copies.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 f1c1b4d0e695
comparison
equal deleted inserted replaced
36078:7f68235f23ff 36079:a2a6e724d61a
1
2 $ . "$TESTDIR/narrow-library.sh"
3
4 create full repo
5
6 $ hg init master
7 $ cd master
8
9 $ mkdir inside
10 $ echo inside > inside/f1
11 $ mkdir outside
12 $ echo outside > outside/f2
13 $ hg ci -Aqm 'initial'
14
15 $ hg mv outside/f2 inside/f2
16 $ hg ci -qm 'move f2 from outside'
17
18 $ echo modified > inside/f2
19 $ hg ci -qm 'modify inside/f2'
20
21 $ cd ..
22
23 $ hg clone --narrow ssh://user@dummy/master narrow --include inside
24 requesting all changes
25 adding changesets
26 adding manifests
27 adding file changes
28 added 3 changesets with 3 changes to 2 files
29 new changesets *:* (glob)
30 updating to branch default
31 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
32 $ cd narrow
33
34 $ hg co 'desc("move f2")'
35 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
36 $ hg status
37 $ hg diff
38 $ hg diff --change . --git
39 diff --git a/inside/f2 b/inside/f2
40 new file mode 100644
41 --- /dev/null
42 +++ b/inside/f2
43 @@ -0,0 +1,1 @@
44 +outside
45
46 $ hg log --follow inside/f2 -r tip
47 changeset: 2:bcfb756e0ca9
48 tag: tip
49 user: test
50 date: Thu Jan 01 00:00:00 1970 +0000
51 summary: modify inside/f2
52
53 changeset: 1:5a016133b2bb
54 user: test
55 date: Thu Jan 01 00:00:00 1970 +0000
56 summary: move f2 from outside
57