##// END OF EJS Templates
tests: removed test names in tests...
Erik Zielke -
r12587:e3247cea default
parent child Browse files
Show More
@@ -1,82 +1,82
1 1 $ hg init
2 2
3 3 should fail
4 4
5 5 $ hg add .hg/00changelog.i
6 6 abort: path contains illegal component: .hg/00changelog.i
7 7 [255]
8 8
9 9 $ mkdir a
10 10 $ echo a > a/a
11 11 $ hg ci -Ama
12 12 adding a/a
13 13 $ ln -s a b
14 14 $ echo b > a/b
15 15
16 16 should fail
17 17
18 18 $ hg add b/b
19 19 abort: path 'b/b' traverses symbolic link 'b'
20 20 [255]
21 21
22 22 should succeed
23 23
24 24 $ hg add b
25 25
26 26 should still fail - maybe
27 27
28 28 $ hg add b/b
29 29 abort: path 'b/b' traverses symbolic link 'b'
30 30 [255]
31 31
32 32 unbundle tampered bundle
33 33
34 34 $ hg init target
35 35 $ cd target
36 36 $ hg unbundle $TESTDIR/tampered.hg
37 37 adding changesets
38 38 adding manifests
39 39 adding file changes
40 40 added 5 changesets with 6 changes to 6 files (+4 heads)
41 41 (run 'hg heads' to see heads, 'hg merge' to merge)
42 42
43 43 attack .hg/test
44 44
45 45 $ hg manifest -r0
46 46 .hg/test
47 47 $ hg update -Cr0
48 48 abort: path contains illegal component: .hg/test
49 49 [255]
50 50
51 51 attack foo/.hg/test
52 52
53 53 $ hg manifest -r1
54 54 foo/.hg/test
55 55 $ hg update -Cr1
56 56 abort: path 'foo/.hg/test' is inside repo 'foo'
57 57 [255]
58 58
59 59 attack back/test where back symlinks to ..
60 60
61 61 $ hg manifest -r2
62 62 back
63 63 back/test
64 64 $ hg update -Cr2
65 65 abort: path 'back/test' traverses symbolic link 'back'
66 66 [255]
67 67
68 68 attack ../test
69 69
70 70 $ hg manifest -r3
71 71 ../test
72 72 $ hg update -Cr3
73 73 abort: path contains illegal component: ../test
74 74 [255]
75 75
76 76 attack /tmp/test
77 77
78 78 $ hg manifest -r4
79 79 /tmp/test
80 80 $ hg update -Cr4
81 abort: No such file or directory: */test-audit-path.t/target//tmp/test (glob)
81 abort: No such file or directory: */target//tmp/test (glob)
82 82 [255]
@@ -1,135 +1,135
1 1
2 2 $ "$TESTDIR/hghave" svn svn-bindings || exit 80
3 3
4 4 $ cat > $HGRCPATH <<EOF
5 5 > [extensions]
6 6 > convert =
7 7 > graphlog =
8 8 > EOF
9 9
10 10 $ svnadmin create svn-repo
11 11 $ svnadmin load -q svn-repo < "$TESTDIR/svn/encoding.svndump"
12 12
13 13 Convert while testing all possible outputs
14 14
15 15 $ hg --debug convert svn-repo A-hg
16 16 initializing destination A-hg repository
17 reparent to file://*/test-convert-svn-encoding.t/svn-repo (glob)
17 reparent to file://*/svn-repo (glob)
18 18 run hg sink pre-conversion action
19 19 scanning source...
20 20 found trunk at 'trunk'
21 21 found tags at 'tags'
22 22 found branches at 'branches'
23 23 found branch branché at 5
24 24 found branch branchée at 6
25 25 scanning: 1 revisions
26 reparent to file://*/test-convert-svn-encoding.t/svn-repo/trunk (glob)
26 reparent to file://*/svn-repo/trunk (glob)
27 27 fetching revision log for "/trunk" from 4 to 0
28 28 parsing revision 4 (2 changes)
29 29 parsing revision 3 (4 changes)
30 30 parsing revision 2 (3 changes)
31 31 parsing revision 1 (3 changes)
32 32 no copyfrom path, don't know what to do.
33 33 '/branches' is not under '/trunk', ignoring
34 34 '/tags' is not under '/trunk', ignoring
35 35 scanning: 2 revisions
36 reparent to file://*/test-convert-svn-encoding.t/svn-repo/branches/branch%C3%A9 (glob)
36 reparent to file://*/svn-repo/branches/branch%C3%A9 (glob)
37 37 fetching revision log for "/branches/branché" from 5 to 0
38 38 parsing revision 5 (1 changes)
39 reparent to file://*/test-convert-svn-encoding.t/svn-repo (glob)
40 reparent to file://*/test-convert-svn-encoding.t/svn-repo/branches/branch%C3%A9 (glob)
39 reparent to file://*/svn-repo (glob)
40 reparent to file://*/svn-repo/branches/branch%C3%A9 (glob)
41 41 found parent of branch /branches/branché at 4: /trunk
42 42 scanning: 3 revisions
43 reparent to file://*/test-convert-svn-encoding.t/svn-repo/branches/branch%C3%A9e (glob)
43 reparent to file://*/svn-repo/branches/branch%C3%A9e (glob)
44 44 fetching revision log for "/branches/branchée" from 6 to 0
45 45 parsing revision 6 (1 changes)
46 reparent to file://*/test-convert-svn-encoding.t/svn-repo (glob)
47 reparent to file://*/test-convert-svn-encoding.t/svn-repo/branches/branch%C3%A9e (glob)
46 reparent to file://*/svn-repo (glob)
47 reparent to file://*/svn-repo/branches/branch%C3%A9e (glob)
48 48 found parent of branch /branches/branchée at 5: /branches/branché
49 49 scanning: 4 revisions
50 50 scanning: 5 revisions
51 51 scanning: 6 revisions
52 52 sorting...
53 53 converting...
54 54 5 init projA
55 55 source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@1
56 56 converting: 0/6 revisions (0.00%)
57 57 4 hello
58 58 source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@2
59 59 converting: 1/6 revisions (16.67%)
60 reparent to file://*/test-convert-svn-encoding.t/svn-repo/trunk (glob)
60 reparent to file://*/svn-repo/trunk (glob)
61 61 scanning paths: /trunk/à 0/3 (0.00%)
62 62 scanning paths: /trunk/à/é 1/3 (33.33%)
63 63 scanning paths: /trunk/é 2/3 (66.67%)
64 64 à/é
65 65 getting files: à/é 1/2 (50.00%)
66 66 é
67 67 getting files: é 2/2 (100.00%)
68 68 3 copy files
69 69 source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@3
70 70 converting: 2/6 revisions (33.33%)
71 71 scanning paths: /trunk/à 0/4 (0.00%)
72 72 gone from -1
73 reparent to file://*/test-convert-svn-encoding.t/svn-repo (glob)
74 reparent to file://*/test-convert-svn-encoding.t/svn-repo/trunk (glob)
73 reparent to file://*/svn-repo (glob)
74 reparent to file://*/svn-repo/trunk (glob)
75 75 scanning paths: /trunk/è 1/4 (25.00%)
76 76 copied to è from é@2
77 77 scanning paths: /trunk/é 2/4 (50.00%)
78 78 gone from -1
79 reparent to file://*/test-convert-svn-encoding.t/svn-repo (glob)
80 reparent to file://*/test-convert-svn-encoding.t/svn-repo/trunk (glob)
79 reparent to file://*/svn-repo (glob)
80 reparent to file://*/svn-repo/trunk (glob)
81 81 scanning paths: /trunk/ù 3/4 (75.00%)
82 82 mark /trunk/ù came from à:2
83 83 à/é
84 84 getting files: à/é 1/4 (25.00%)
85 85 è
86 86 getting files: è 2/4 (50.00%)
87 87 è: copy é:6b67ccefd5ce6de77e7ead4f5292843a0255329f
88 88 é
89 89 getting files: é 3/4 (75.00%)
90 90 ù/é
91 91 getting files: ù/é 4/4 (100.00%)
92 92 ù/é: copy à/é:a9092a3d84a37b9993b5c73576f6de29b7ea50f6
93 93 2 remove files
94 94 source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@4
95 95 converting: 3/6 revisions (50.00%)
96 96 scanning paths: /trunk/è 0/2 (0.00%)
97 97 gone from -1
98 reparent to file://*/test-convert-svn-encoding.t/svn-repo (glob)
99 reparent to file://*/test-convert-svn-encoding.t/svn-repo/trunk (glob)
98 reparent to file://*/svn-repo (glob)
99 reparent to file://*/svn-repo/trunk (glob)
100 100 scanning paths: /trunk/ù 1/2 (50.00%)
101 101 gone from -1
102 reparent to file://*/test-convert-svn-encoding.t/svn-repo (glob)
103 reparent to file://*/test-convert-svn-encoding.t/svn-repo/trunk (glob)
102 reparent to file://*/svn-repo (glob)
103 reparent to file://*/svn-repo/trunk (glob)
104 104 è
105 105 getting files: è 1/2 (50.00%)
106 106 ù/é
107 107 getting files: ù/é 2/2 (100.00%)
108 108 1 branch to branch?
109 109 source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/branches/branch?@5
110 110 converting: 4/6 revisions (66.67%)
111 reparent to file://*/test-convert-svn-encoding.t/svn-repo/branches/branch%C3%A9 (glob)
111 reparent to file://*/svn-repo/branches/branch%C3%A9 (glob)
112 112 scanning paths: /branches/branché 0/1 (0.00%)
113 113 0 branch to branch?e
114 114 source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/branches/branch?e@6
115 115 converting: 5/6 revisions (83.33%)
116 reparent to file://*/test-convert-svn-encoding.t/svn-repo/branches/branch%C3%A9e (glob)
116 reparent to file://*svn-repo/branches/branch%C3%A9e (glob)
117 117 scanning paths: /branches/branchée 0/1 (0.00%)
118 reparent to file://*/test-convert-svn-encoding.t/svn-repo (glob)
119 reparent to file://*/test-convert-svn-encoding.t/svn-repo/branches/branch%C3%A9e (glob)
120 reparent to file://*/test-convert-svn-encoding.t/svn-repo (glob)
121 reparent to file://*/test-convert-svn-encoding.t/svn-repo/branches/branch%C3%A9e (glob)
118 reparent to file://*svn-repo (glob)
119 reparent to file://*svn-repo/branches/branch%C3%A9e (glob)
120 reparent to file://*svn-repo (glob)
121 reparent to file://*svn-repo/branches/branch%C3%A9e (glob)
122 122 updating tags
123 123 .hgtags
124 124 run hg sink post-conversion action
125 125 $ cd A-hg
126 126 $ hg up
127 127 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
128 128
129 129 Check tags are in UTF-8
130 130
131 131 $ python -c "print '\n'.join([('%r' % l) for l in file('.hgtags', 'rb').readlines()])"
132 132 '221c3fdaf24df5f14c0a64c597581e2eacfb47bb branch\xc3\xa9e\n'
133 133 '7a40952c2db29cf00d9e31df3749e98d8a4bdcbf branch\xc3\xa9\n'
134 134
135 135 $ cd ..
@@ -1,173 +1,170
1 1 $ echo "[extensions]" >> $HGRCPATH
2 2 $ echo "extdiff=" >> $HGRCPATH
3 3
4 4 $ hg init a
5 5 $ cd a
6 6 $ echo a > a
7 7 $ echo b > b
8 8 $ hg add
9 9 adding a
10 10 adding b
11 11
12 12 Should diff cloned directories:
13 13
14 14 $ hg extdiff -o -r $opt
15 15 Only in a: a
16 16 Only in a: b
17 17 [1]
18 18
19 19 $ echo "[extdiff]" >> $HGRCPATH
20 20 $ echo "cmd.falabala=echo" >> $HGRCPATH
21 21 $ echo "opts.falabala=diffing" >> $HGRCPATH
22 22
23 23 $ hg falabala
24 24 diffing a.000000000000 a
25 25 [1]
26 26
27 27 $ hg help falabala
28 28 hg falabala [OPTION]... [FILE]...
29 29
30 30 use 'echo' to diff repository (or selected files)
31 31
32 32 Show differences between revisions for the specified files, using the
33 33 'echo' program.
34 34
35 35 When two revision arguments are given, then changes are shown between
36 36 those revisions. If only one revision is specified then that revision is
37 37 compared to the working directory, and, when no revisions are specified,
38 38 the working directory files are compared to its parent.
39 39
40 40 options:
41 41
42 42 -o --option OPT [+] pass option to comparison program
43 43 -r --rev REV [+] revision
44 44 -c --change REV change made by revision
45 45 -I --include PATTERN [+] include names matching the given patterns
46 46 -X --exclude PATTERN [+] exclude names matching the given patterns
47 47
48 48 [+] marked option can be specified multiple times
49 49
50 50 use "hg -v help falabala" to show global options
51 51
52 52 $ hg ci -d '0 0' -mtest1
53 53
54 54 $ echo b >> a
55 55 $ hg ci -d '1 0' -mtest2
56 56
57 57 Should diff cloned files directly:
58 58
59 59 $ hg falabala -r 0:1
60 60 diffing a.8a5febb7f867/a a.34eed99112ab/a
61 61 [1]
62 62
63 63 Test diff during merge:
64 64
65 65 $ hg update -C 0
66 66 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
67 67 $ echo c >> c
68 68 $ hg add c
69 69 $ hg ci -m "new branch" -d '1 0'
70 70 created new head
71 71 $ hg merge 1
72 72 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
73 73 (branch merge, don't forget to commit)
74 74
75 75 Should diff cloned file against wc file:
76 76
77 $ hg falabala > out
77 $ hg falabala
78 diffing a.2a13a4d2da36/a */a/a (glob)
78 79 [1]
79 80
80 Cleanup the output since the wc is a tmp directory:
81
82 $ sed 's:\(diffing [^ ]* \).*\(\/test-extdiff\):\1[tmp]\2:' out
83 diffing a.2a13a4d2da36/a [tmp]/test-extdiff.t/a/a
84 81
85 82 Test --change option:
86 83
87 84 $ hg ci -d '2 0' -mtest3
88 85 $ hg falabala -c 1
89 86 diffing a.8a5febb7f867/a a.34eed99112ab/a
90 87 [1]
91 88
92 89 Check diff are made from the first parent:
93 90
94 91 $ hg falabala -c 3 || echo "diff-like tools yield a non-zero exit code"
95 92 diffing a.2a13a4d2da36/a a.46c0e4daeb72/a
96 93 diff-like tools yield a non-zero exit code
97 94
98 95 Test extdiff of multiple files in tmp dir:
99 96
100 97 $ hg update -C 0 > /dev/null
101 98 $ echo changed > a
102 99 $ echo changed > b
103 100 $ chmod +x b
104 101
105 102 Diff in working directory, before:
106 103
107 104 $ hg diff --git
108 105 diff --git a/a b/a
109 106 --- a/a
110 107 +++ b/a
111 108 @@ -1,1 +1,1 @@
112 109 -a
113 110 +changed
114 111 diff --git a/b b/b
115 112 old mode 100644
116 113 new mode 100755
117 114 --- a/b
118 115 +++ b/b
119 116 @@ -1,1 +1,1 @@
120 117 -b
121 118 +changed
122 119
123 120
124 121 Edit with extdiff -p:
125 122
126 123 Prepare custom diff/edit tool:
127 124
128 125 $ cat > 'diff tool.py' << EOT
129 126 > #!/usr/bin/env python
130 127 > import time
131 128 > time.sleep(1) # avoid unchanged-timestamp problems
132 129 > file('a/a', 'ab').write('edited\n')
133 130 > file('a/b', 'ab').write('edited\n')
134 131 > EOT
135 132
136 133 $ chmod +x 'diff tool.py'
137 134
138 135 will change to /tmp/extdiff.TMP and populate directories a.TMP and a
139 136 and start tool
140 137
141 138 $ hg extdiff -p "`pwd`/diff tool.py"
142 139 [1]
143 140
144 141 Diff in working directory, after:
145 142
146 143 $ hg diff --git
147 144 diff --git a/a b/a
148 145 --- a/a
149 146 +++ b/a
150 147 @@ -1,1 +1,2 @@
151 148 -a
152 149 +changed
153 150 +edited
154 151 diff --git a/b b/b
155 152 old mode 100644
156 153 new mode 100755
157 154 --- a/b
158 155 +++ b/b
159 156 @@ -1,1 +1,2 @@
160 157 -b
161 158 +changed
162 159 +edited
163 160
164 161 Test extdiff with --option:
165 162
166 163 $ hg extdiff -p echo -o this -c 1
167 164 this a.8a5febb7f867/a a.34eed99112ab/a
168 165 [1]
169 166
170 167 $ hg falabala -o this -c 1
171 168 diffing this a.8a5febb7f867/a a.34eed99112ab/a
172 169 [1]
173 170
@@ -1,483 +1,483
1 1 $ cp "$TESTDIR"/printenv.py .
2 2
3 3 commit hooks can see env vars
4 4
5 5 $ hg init a
6 6 $ cd a
7 7 $ echo "[hooks]" > .hg/hgrc
8 8 $ echo 'commit = unset HG_LOCAL HG_TAG; python ../printenv.py commit' >> .hg/hgrc
9 9 $ echo 'commit.b = unset HG_LOCAL HG_TAG; python ../printenv.py commit.b' >> .hg/hgrc
10 10 $ echo 'precommit = unset HG_LOCAL HG_NODE HG_TAG; python ../printenv.py precommit' >> .hg/hgrc
11 11 $ echo 'pretxncommit = unset HG_LOCAL HG_TAG; python ../printenv.py pretxncommit' >> .hg/hgrc
12 12 $ echo 'pretxncommit.tip = hg -q tip' >> .hg/hgrc
13 13 $ echo 'pre-identify = python ../printenv.py pre-identify 1' >> .hg/hgrc
14 14 $ echo 'pre-cat = python ../printenv.py pre-cat' >> .hg/hgrc
15 15 $ echo 'post-cat = python ../printenv.py post-cat' >> .hg/hgrc
16 16 $ echo a > a
17 17 $ hg add a
18 18 $ hg commit -m a
19 19 precommit hook: HG_PARENT1=0000000000000000000000000000000000000000
20 pretxncommit hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 HG_PENDING=$HGTMP/test-hook.t/a
20 pretxncommit hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 HG_PENDING=$HGTMP/*/a (glob)
21 21 0:cb9a9f314b8b
22 22 commit hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000
23 23 commit.b hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000
24 24
25 25 $ hg clone . ../b
26 26 updating to branch default
27 27 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28 28 $ cd ../b
29 29
30 30 changegroup hooks can see env vars
31 31
32 32 $ echo '[hooks]' > .hg/hgrc
33 33 $ echo 'prechangegroup = python ../printenv.py prechangegroup' >> .hg/hgrc
34 34 $ echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc
35 35 $ echo 'incoming = python ../printenv.py incoming' >> .hg/hgrc
36 36
37 37 pretxncommit and commit hooks can see both parents of merge
38 38
39 39 $ cd ../a
40 40 $ echo b >> a
41 41 $ hg commit -m a1 -d "1 0"
42 42 precommit hook: HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
43 pretxncommit hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$HGTMP/test-hook.t/a
43 pretxncommit hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$HGTMP/*/a (glob)
44 44 1:ab228980c14d
45 45 commit hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
46 46 commit.b hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
47 47 $ hg update -C 0
48 48 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
49 49 $ echo b > b
50 50 $ hg add b
51 51 $ hg commit -m b -d '1 0'
52 52 precommit hook: HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
53 pretxncommit hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$HGTMP/test-hook.t/a
53 pretxncommit hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$HGTMP/*/a (glob)
54 54 2:ee9deb46ab31
55 55 commit hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
56 56 commit.b hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
57 57 created new head
58 58 $ hg merge 1
59 59 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
60 60 (branch merge, don't forget to commit)
61 61 $ hg commit -m merge -d '2 0'
62 62 precommit hook: HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
63 pretxncommit hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd HG_PENDING=$HGTMP/test-hook.t/a
63 pretxncommit hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd HG_PENDING=$HGTMP/*/a (glob)
64 64 3:07f3376c1e65
65 65 commit hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
66 66 commit.b hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
67 67
68 68 test generic hooks
69 69
70 70 $ hg id
71 71 pre-identify hook: HG_ARGS=id HG_OPTS={'tags': None, 'rev': '', 'num': None, 'branch': None, 'id': None} HG_PATS=[]
72 72 warning: pre-identify hook exited with status 1
73 73 [1]
74 74 $ hg cat b
75 75 pre-cat hook: HG_ARGS=cat b HG_OPTS={'rev': '', 'decode': None, 'exclude': [], 'output': '', 'include': []} HG_PATS=['b']
76 76 post-cat hook: HG_ARGS=cat b HG_OPTS={'rev': '', 'decode': None, 'exclude': [], 'output': '', 'include': []} HG_PATS=['b'] HG_RESULT=0
77 77 b
78 78
79 79 $ cd ../b
80 80 $ hg pull ../a
81 81 prechangegroup hook: HG_SOURCE=pull HG_URL=file:
82 82 changegroup hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_URL=file:
83 83 incoming hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_URL=file:
84 84 incoming hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_SOURCE=pull HG_URL=file:
85 85 incoming hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_SOURCE=pull HG_URL=file:
86 86 pulling from ../a
87 87 searching for changes
88 88 adding changesets
89 89 adding manifests
90 90 adding file changes
91 91 added 3 changesets with 2 changes to 2 files
92 92 (run 'hg update' to get a working copy)
93 93
94 94 tag hooks can see env vars
95 95
96 96 $ cd ../a
97 97 $ echo 'pretag = python ../printenv.py pretag' >> .hg/hgrc
98 98 $ echo 'tag = unset HG_PARENT1 HG_PARENT2; python ../printenv.py tag' >> .hg/hgrc
99 99 $ hg tag -d '3 0' a
100 100 pretag hook: HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a
101 101 precommit hook: HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
102 pretxncommit hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PENDING=$HGTMP/test-hook.t/a
102 pretxncommit hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PENDING=$HGTMP/*/a (glob)
103 103 4:539e4b31b6dc
104 104 commit hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
105 105 commit.b hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
106 106 tag hook: HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a
107 107 $ hg tag -l la
108 108 pretag hook: HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=la
109 109 tag hook: HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=la
110 110
111 111 pretag hook can forbid tagging
112 112
113 113 $ echo 'pretag.forbid = python ../printenv.py pretag.forbid 1' >> .hg/hgrc
114 114 $ hg tag -d '4 0' fa
115 115 pretag hook: HG_LOCAL=0 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fa
116 116 pretag.forbid hook: HG_LOCAL=0 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fa
117 117 abort: pretag.forbid hook exited with status 1
118 118 [255]
119 119 $ hg tag -l fla
120 120 pretag hook: HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fla
121 121 pretag.forbid hook: HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fla
122 122 abort: pretag.forbid hook exited with status 1
123 123 [255]
124 124
125 125 pretxncommit hook can see changeset, can roll back txn, changeset no
126 126 more there after
127 127
128 128 $ echo 'pretxncommit.forbid0 = hg tip -q' >> .hg/hgrc
129 129 $ echo 'pretxncommit.forbid1 = python ../printenv.py pretxncommit.forbid 1' >> .hg/hgrc
130 130 $ echo z > z
131 131 $ hg add z
132 132 $ hg -q tip
133 133 4:539e4b31b6dc
134 134 $ hg commit -m 'fail' -d '4 0'
135 135 precommit hook: HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
136 pretxncommit hook: HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$HGTMP/test-hook.t/a
136 pretxncommit hook: HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$HGTMP/*/a (glob)
137 137 5:6f611f8018c1
138 138 5:6f611f8018c1
139 pretxncommit.forbid hook: HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$HGTMP/test-hook.t/a
139 pretxncommit.forbid hook: HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$HGTMP/*/a (glob)
140 140 transaction abort!
141 141 rollback completed
142 142 abort: pretxncommit.forbid1 hook exited with status 1
143 143 [255]
144 144 $ hg -q tip
145 145 4:539e4b31b6dc
146 146
147 147 precommit hook can prevent commit
148 148
149 149 $ echo 'precommit.forbid = python ../printenv.py precommit.forbid 1' >> .hg/hgrc
150 150 $ hg commit -m 'fail' -d '4 0'
151 151 precommit hook: HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
152 152 precommit.forbid hook: HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
153 153 abort: precommit.forbid hook exited with status 1
154 154 [255]
155 155 $ hg -q tip
156 156 4:539e4b31b6dc
157 157
158 158 preupdate hook can prevent update
159 159
160 160 $ echo 'preupdate = python ../printenv.py preupdate' >> .hg/hgrc
161 161 $ hg update 1
162 162 preupdate hook: HG_PARENT1=ab228980c14d
163 163 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
164 164
165 165 update hook
166 166
167 167 $ echo 'update = python ../printenv.py update' >> .hg/hgrc
168 168 $ hg update
169 169 preupdate hook: HG_PARENT1=539e4b31b6dc
170 170 update hook: HG_ERROR=0 HG_PARENT1=539e4b31b6dc
171 171 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
172 172
173 173 prechangegroup hook can prevent incoming changes
174 174
175 175 $ cd ../b
176 176 $ hg -q tip
177 177 3:07f3376c1e65
178 178 $ echo '[hooks]' > .hg/hgrc
179 179 $ echo 'prechangegroup.forbid = python ../printenv.py prechangegroup.forbid 1' >> .hg/hgrc
180 180 $ hg pull ../a
181 181 prechangegroup.forbid hook: HG_SOURCE=pull HG_URL=file:
182 182 pulling from ../a
183 183 searching for changes
184 184 abort: prechangegroup.forbid hook exited with status 1
185 185 [255]
186 186
187 187 pretxnchangegroup hook can see incoming changes, can roll back txn,
188 188 incoming changes no longer there after
189 189
190 190 $ echo '[hooks]' > .hg/hgrc
191 191 $ echo 'pretxnchangegroup.forbid0 = hg tip -q' >> .hg/hgrc
192 192 $ echo 'pretxnchangegroup.forbid1 = python ../printenv.py pretxnchangegroup.forbid 1' >> .hg/hgrc
193 193 $ hg pull ../a
194 194 4:539e4b31b6dc
195 pretxnchangegroup.forbid hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$HGTMP/test-hook.t/b HG_SOURCE=pull HG_URL=file:
195 pretxnchangegroup.forbid hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$HGTMP/*/b HG_SOURCE=pull HG_URL=file: (glob)
196 196 pulling from ../a
197 197 searching for changes
198 198 adding changesets
199 199 adding manifests
200 200 adding file changes
201 201 added 1 changesets with 1 changes to 1 files
202 202 transaction abort!
203 203 rollback completed
204 204 abort: pretxnchangegroup.forbid1 hook exited with status 1
205 205 [255]
206 206 $ hg -q tip
207 207 3:07f3376c1e65
208 208
209 209 outgoing hooks can see env vars
210 210
211 211 $ rm .hg/hgrc
212 212 $ echo '[hooks]' > ../a/.hg/hgrc
213 213 $ echo 'preoutgoing = python ../printenv.py preoutgoing' >> ../a/.hg/hgrc
214 214 $ echo 'outgoing = python ../printenv.py outgoing' >> ../a/.hg/hgrc
215 215 $ hg pull ../a
216 216 preoutgoing hook: HG_SOURCE=pull
217 217 outgoing hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_SOURCE=pull
218 218 pulling from ../a
219 219 searching for changes
220 220 adding changesets
221 221 adding manifests
222 222 adding file changes
223 223 added 1 changesets with 1 changes to 1 files
224 224 (run 'hg update' to get a working copy)
225 225 $ hg rollback
226 226 rolling back to revision 3 (undo pull)
227 227
228 228 preoutgoing hook can prevent outgoing changes
229 229
230 230 $ echo 'preoutgoing.forbid = python ../printenv.py preoutgoing.forbid 1' >> ../a/.hg/hgrc
231 231 $ hg pull ../a
232 232 preoutgoing hook: HG_SOURCE=pull
233 233 preoutgoing.forbid hook: HG_SOURCE=pull
234 234 pulling from ../a
235 235 searching for changes
236 236 abort: preoutgoing.forbid hook exited with status 1
237 237 [255]
238 238
239 239 outgoing hooks work for local clones
240 240
241 241 $ cd ..
242 242 $ echo '[hooks]' > a/.hg/hgrc
243 243 $ echo 'preoutgoing = python ../printenv.py preoutgoing' >> a/.hg/hgrc
244 244 $ echo 'outgoing = python ../printenv.py outgoing' >> a/.hg/hgrc
245 245 $ hg clone a c
246 246 preoutgoing hook: HG_SOURCE=clone
247 247 outgoing hook: HG_NODE=0000000000000000000000000000000000000000 HG_SOURCE=clone
248 248 updating to branch default
249 249 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
250 250 $ rm -rf c
251 251
252 252 preoutgoing hook can prevent outgoing changes for local clones
253 253
254 254 $ echo 'preoutgoing.forbid = python ../printenv.py preoutgoing.forbid 1' >> a/.hg/hgrc
255 255 $ hg clone a zzz
256 256 preoutgoing hook: HG_SOURCE=clone
257 257 preoutgoing.forbid hook: HG_SOURCE=clone
258 258 abort: preoutgoing.forbid hook exited with status 1
259 259 [255]
260 260 $ cd b
261 261
262 262 $ cat > hooktests.py <<EOF
263 263 > from mercurial import util
264 264 >
265 265 > uncallable = 0
266 266 >
267 267 > def printargs(args):
268 268 > args.pop('ui', None)
269 269 > args.pop('repo', None)
270 270 > a = list(args.items())
271 271 > a.sort()
272 272 > print 'hook args:'
273 273 > for k, v in a:
274 274 > print ' ', k, v
275 275 >
276 276 > def passhook(**args):
277 277 > printargs(args)
278 278 >
279 279 > def failhook(**args):
280 280 > printargs(args)
281 281 > return True
282 282 >
283 283 > class LocalException(Exception):
284 284 > pass
285 285 >
286 286 > def raisehook(**args):
287 287 > raise LocalException('exception from hook')
288 288 >
289 289 > def aborthook(**args):
290 290 > raise util.Abort('raise abort from hook')
291 291 >
292 292 > def brokenhook(**args):
293 293 > return 1 + {}
294 294 >
295 295 > class container:
296 296 > unreachable = 1
297 297 > EOF
298 298
299 299 test python hooks
300 300
301 301 $ PYTHONPATH="`pwd`:$PYTHONPATH"
302 302 $ export PYTHONPATH
303 303
304 304 $ echo '[hooks]' > ../a/.hg/hgrc
305 305 $ echo 'preoutgoing.broken = python:hooktests.brokenhook' >> ../a/.hg/hgrc
306 306 $ hg pull ../a 2>&1 | grep 'raised an exception'
307 307 error: preoutgoing.broken hook raised an exception: unsupported operand type(s) for +: 'int' and 'dict'
308 308
309 309 $ echo '[hooks]' > ../a/.hg/hgrc
310 310 $ echo 'preoutgoing.raise = python:hooktests.raisehook' >> ../a/.hg/hgrc
311 311 $ hg pull ../a 2>&1 | grep 'raised an exception'
312 312 error: preoutgoing.raise hook raised an exception: exception from hook
313 313
314 314 $ echo '[hooks]' > ../a/.hg/hgrc
315 315 $ echo 'preoutgoing.abort = python:hooktests.aborthook' >> ../a/.hg/hgrc
316 316 $ hg pull ../a
317 317 pulling from ../a
318 318 searching for changes
319 319 error: preoutgoing.abort hook failed: raise abort from hook
320 320 abort: raise abort from hook
321 321 [255]
322 322
323 323 $ echo '[hooks]' > ../a/.hg/hgrc
324 324 $ echo 'preoutgoing.fail = python:hooktests.failhook' >> ../a/.hg/hgrc
325 325 $ hg pull ../a
326 326 pulling from ../a
327 327 searching for changes
328 328 hook args:
329 329 hooktype preoutgoing
330 330 source pull
331 331 abort: preoutgoing.fail hook failed
332 332 [255]
333 333
334 334 $ echo '[hooks]' > ../a/.hg/hgrc
335 335 $ echo 'preoutgoing.uncallable = python:hooktests.uncallable' >> ../a/.hg/hgrc
336 336 $ hg pull ../a
337 337 pulling from ../a
338 338 searching for changes
339 339 abort: preoutgoing.uncallable hook is invalid ("hooktests.uncallable" is not callable)
340 340 [255]
341 341
342 342 $ echo '[hooks]' > ../a/.hg/hgrc
343 343 $ echo 'preoutgoing.nohook = python:hooktests.nohook' >> ../a/.hg/hgrc
344 344 $ hg pull ../a
345 345 pulling from ../a
346 346 searching for changes
347 347 abort: preoutgoing.nohook hook is invalid ("hooktests.nohook" is not defined)
348 348 [255]
349 349
350 350 $ echo '[hooks]' > ../a/.hg/hgrc
351 351 $ echo 'preoutgoing.nomodule = python:nomodule' >> ../a/.hg/hgrc
352 352 $ hg pull ../a
353 353 pulling from ../a
354 354 searching for changes
355 355 abort: preoutgoing.nomodule hook is invalid ("nomodule" not in a module)
356 356 [255]
357 357
358 358 $ echo '[hooks]' > ../a/.hg/hgrc
359 359 $ echo 'preoutgoing.badmodule = python:nomodule.nowhere' >> ../a/.hg/hgrc
360 360 $ hg pull ../a
361 361 pulling from ../a
362 362 searching for changes
363 363 abort: preoutgoing.badmodule hook is invalid (import of "nomodule" failed)
364 364 [255]
365 365
366 366 $ echo '[hooks]' > ../a/.hg/hgrc
367 367 $ echo 'preoutgoing.unreachable = python:hooktests.container.unreachable' >> ../a/.hg/hgrc
368 368 $ hg pull ../a
369 369 pulling from ../a
370 370 searching for changes
371 371 abort: preoutgoing.unreachable hook is invalid (import of "hooktests.container" failed)
372 372 [255]
373 373
374 374 $ echo '[hooks]' > ../a/.hg/hgrc
375 375 $ echo 'preoutgoing.pass = python:hooktests.passhook' >> ../a/.hg/hgrc
376 376 $ hg pull ../a
377 377 pulling from ../a
378 378 searching for changes
379 379 hook args:
380 380 hooktype preoutgoing
381 381 source pull
382 382 adding changesets
383 383 adding manifests
384 384 adding file changes
385 385 added 1 changesets with 1 changes to 1 files
386 386 (run 'hg update' to get a working copy)
387 387
388 388 make sure --traceback works
389 389
390 390 $ echo '[hooks]' > .hg/hgrc
391 391 $ echo 'commit.abort = python:hooktests.aborthook' >> .hg/hgrc
392 392
393 393 $ echo aa > a
394 394 $ hg --traceback commit -d '0 0' -ma 2>&1 | grep '^Traceback'
395 395 Traceback (most recent call last):
396 396
397 397 $ cd ..
398 398 $ hg init c
399 399 $ cd c
400 400
401 401 $ cat > hookext.py <<EOF
402 402 > def autohook(**args):
403 403 > print "Automatically installed hook"
404 404 >
405 405 > def reposetup(ui, repo):
406 406 > repo.ui.setconfig("hooks", "commit.auto", autohook)
407 407 > EOF
408 408 $ echo '[extensions]' >> .hg/hgrc
409 409 $ echo 'hookext = hookext.py' >> .hg/hgrc
410 410
411 411 $ touch foo
412 412 $ hg add foo
413 413 $ hg ci -d '0 0' -m 'add foo'
414 414 Automatically installed hook
415 415 $ echo >> foo
416 416 $ hg ci --debug -d '0 0' -m 'change foo'
417 417 foo
418 418 calling hook commit.auto: <function autohook at *> (glob)
419 419 Automatically installed hook
420 420 committed changeset 1:52998019f6252a2b893452765fcb0a47351a5708
421 421
422 422 $ hg showconfig hooks
423 423 hooks.commit.auto=<function autohook at *> (glob)
424 424
425 425 test python hook configured with python:[file]:[hook] syntax
426 426
427 427 $ cd ..
428 428 $ mkdir d
429 429 $ cd d
430 430 $ hg init repo
431 431 $ mkdir hooks
432 432
433 433 $ cd hooks
434 434 $ cat > testhooks.py <<EOF
435 435 > def testhook(**args):
436 436 > print 'hook works'
437 437 > EOF
438 438 $ echo '[hooks]' > ../repo/.hg/hgrc
439 439 $ echo "pre-commit.test = python:`pwd`/testhooks.py:testhook" >> ../repo/.hg/hgrc
440 440
441 441 $ cd ../repo
442 442 $ hg commit -d '0 0'
443 443 hook works
444 444 nothing changed
445 445 [1]
446 446
447 447 $ cd ../../b
448 448
449 449 make sure --traceback works on hook import failure
450 450
451 451 $ cat > importfail.py <<EOF
452 452 > import somebogusmodule
453 453 > # dereference something in the module to force demandimport to load it
454 454 > somebogusmodule.whatever
455 455 > EOF
456 456
457 457 $ echo '[hooks]' > .hg/hgrc
458 458 $ echo 'precommit.importfail = python:importfail.whatever' >> .hg/hgrc
459 459
460 460 $ echo a >> a
461 461 $ hg --traceback commit -ma 2>&1 | egrep '^(exception|Traceback|ImportError)'
462 462 exception from first failed import attempt:
463 463 Traceback (most recent call last):
464 464 ImportError: No module named somebogusmodule
465 465 exception from second failed import attempt:
466 466 Traceback (most recent call last):
467 467 ImportError: No module named hgext_importfail
468 468 Traceback (most recent call last):
469 469
470 470 Issue1827: Hooks Update & Commit not completely post operation
471 471
472 472 commit and update hooks should run after command completion
473 473
474 474 $ echo '[hooks]' > .hg/hgrc
475 475 $ echo 'commit = hg id' >> .hg/hgrc
476 476 $ echo 'update = hg id' >> .hg/hgrc
477 477 $ echo bb > a
478 478 $ hg ci -ma
479 479 223eafe2750c tip
480 480 $ hg up 0
481 481 cb9a9f314b8b
482 482 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
483 483
@@ -1,965 +1,965
1 1 $ cat <<EOF >> $HGRCPATH
2 2 > [extensions]
3 3 > keyword =
4 4 > mq =
5 5 > notify =
6 6 > record =
7 7 > transplant =
8 8 > [ui]
9 9 > interactive = true
10 10 > EOF
11 11
12 12 Run kwdemo before [keyword] files are set up
13 13 as it would succeed without uisetup otherwise
14 14
15 15 $ hg --quiet kwdemo
16 16 [extensions]
17 17 keyword =
18 18 [keyword]
19 19 demo.txt =
20 20 [keywordmaps]
21 21 Author = {author|user}
22 22 Date = {date|utcdate}
23 23 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
24 24 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
25 25 RCSFile = {file|basename},v
26 26 RCSfile = {file|basename},v
27 27 Revision = {node|short}
28 28 Source = {root}/{file},v
29 29 $Author: test $
30 30 $Date: ????/??/?? ??:??:?? $ (glob)
31 31 $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
32 32 $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
33 33 $RCSFile: demo.txt,v $
34 34 $RCSfile: demo.txt,v $
35 35 $Revision: ???????????? $ (glob)
36 36 $Source: */demo.txt,v $ (glob)
37 37
38 38 $ hg --quiet kwdemo "Branch = {branches}"
39 39 [extensions]
40 40 keyword =
41 41 [keyword]
42 42 demo.txt =
43 43 [keywordmaps]
44 44 Branch = {branches}
45 45 $Branch: demobranch $
46 46
47 47 $ cat <<EOF >> $HGRCPATH
48 48 > [keyword]
49 49 > ** =
50 50 > b = ignore
51 51 > [hooks]
52 52 > commit=
53 53 > commit.test=cp a hooktest
54 54 > EOF
55 55
56 56 $ hg init Test-bndl
57 57 $ cd Test-bndl
58 58
59 59 kwshrink should exit silently in empty/invalid repo
60 60
61 61 $ hg kwshrink
62 62
63 63 Symlinks cannot be created on Windows.
64 64 A bundle to test this was made with:
65 65 hg init t
66 66 cd t
67 67 echo a > a
68 68 ln -s a sym
69 69 hg add sym
70 70 hg ci -m addsym -u mercurial
71 71 hg bundle --base null ../test-keyword.hg
72 72
73 73 $ hg pull -u "$TESTDIR"/test-keyword.hg
74 74 pulling from *test-keyword.hg (glob)
75 75 requesting all changes
76 76 adding changesets
77 77 adding manifests
78 78 adding file changes
79 79 added 1 changesets with 1 changes to 1 files
80 80 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
81 81
82 82 $ echo 'expand $Id$' > a
83 83 $ echo 'do not process $Id:' >> a
84 84 $ echo 'xxx $' >> a
85 85 $ echo 'ignore $Id$' > b
86 86
87 87 Output files as they were created
88 88
89 89 $ cat a b
90 90 expand $Id$
91 91 do not process $Id:
92 92 xxx $
93 93 ignore $Id$
94 94
95 95 no kwfiles
96 96
97 97 $ hg kwfiles
98 98
99 99 untracked candidates
100 100
101 101 $ hg -v kwfiles --unknown
102 102 k a
103 103
104 104 Add files and check status
105 105
106 106 $ hg addremove
107 107 adding a
108 108 adding b
109 109 $ hg status
110 110 A a
111 111 A b
112 112
113 113
114 114 Default keyword expansion including commit hook
115 115 Interrupted commit should not change state or run commit hook
116 116
117 117 $ hg --debug commit
118 118 abort: empty commit message
119 119 [255]
120 120 $ hg status
121 121 A a
122 122 A b
123 123
124 124 Commit with several checks
125 125
126 126 $ hg --debug commit -mabsym -u 'User Name <user@example.com>'
127 127 a
128 128 b
129 129 overwriting a expanding keywords
130 130 running hook commit.test: cp a hooktest
131 131 committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
132 132 $ hg status
133 133 ? hooktest
134 134 $ hg debugrebuildstate
135 135 $ hg --quiet identify
136 136 ef63ca68695b
137 137
138 138 cat files in working directory with keywords expanded
139 139
140 140 $ cat a b
141 141 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
142 142 do not process $Id:
143 143 xxx $
144 144 ignore $Id$
145 145
146 146 hg cat files and symlink, no expansion
147 147
148 148 $ hg cat sym a b && echo
149 149 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
150 150 do not process $Id:
151 151 xxx $
152 152 ignore $Id$
153 153 a* (glob)
154 154
155 155 Test hook execution
156 156
157 157 $ diff a hooktest
158 158
159 159 Removing commit hook from config
160 160
161 161 $ sed -e '/\[hooks\]/,$ d' "$HGRCPATH" > $HGRCPATH.nohook
162 162 $ mv "$HGRCPATH".nohook "$HGRCPATH"
163 163 $ rm hooktest
164 164
165 165 bundle
166 166
167 167 $ hg bundle --base null ../kw.hg
168 168 2 changesets found
169 169 $ cd ..
170 170 $ hg init Test
171 171 $ cd Test
172 172
173 173 Notify on pull to check whether keywords stay as is in email
174 174 ie. if patch.diff wrapper acts as it should
175 175
176 176 $ cat <<EOF >> $HGRCPATH
177 177 > [hooks]
178 178 > incoming.notify = python:hgext.notify.hook
179 179 > [notify]
180 180 > sources = pull
181 181 > diffstat = False
182 182 > [reposubs]
183 183 > * = Test
184 184 > EOF
185 185
186 186 Pull from bundle and trigger notify
187 187
188 188 $ hg pull -u ../kw.hg
189 189 pulling from ../kw.hg
190 190 requesting all changes
191 191 adding changesets
192 192 adding manifests
193 193 adding file changes
194 194 added 2 changesets with 3 changes to 3 files
195 195 Content-Type: text/plain; charset="us-ascii"
196 196 MIME-Version: 1.0
197 197 Content-Transfer-Encoding: 7bit
198 198 Date: * (glob)
199 199 Subject: changeset in * (glob)
200 200 From: mercurial
201 201 X-Hg-Notification: changeset a2392c293916
202 202 Message-Id: <hg.a2392c293916*> (glob)
203 203 To: Test
204 204
205 205 changeset a2392c293916 in * (glob)
206 206 details: *cmd=changeset;node=a2392c293916 (glob)
207 207 description:
208 208 addsym
209 209
210 210 diffs (6 lines):
211 211
212 212 diff -r 000000000000 -r a2392c293916 sym
213 213 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
214 214 +++ b/sym Sat Feb 09 20:25:47 2008 +0100
215 215 @@ -0,0 +1,1 @@
216 216 +a
217 217 \ No newline at end of file
218 218 Content-Type: text/plain; charset="us-ascii"
219 219 MIME-Version: 1.0
220 220 Content-Transfer-Encoding: 7bit
221 221 Date:* (glob)
222 222 Subject: changeset in* (glob)
223 223 From: User Name <user@example.com>
224 224 X-Hg-Notification: changeset ef63ca68695b
225 225 Message-Id: <hg.ef63ca68695b*> (glob)
226 226 To: Test
227 227
228 228 changeset ef63ca68695b in * (glob)
229 229 details: *cmd=changeset;node=ef63ca68695b (glob)
230 230 description:
231 231 absym
232 232
233 233 diffs (12 lines):
234 234
235 235 diff -r a2392c293916 -r ef63ca68695b a
236 236 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
237 237 +++ b/a Thu Jan 01 00:00:00 1970 +0000
238 238 @@ -0,0 +1,3 @@
239 239 +expand $Id$
240 240 +do not process $Id:
241 241 +xxx $
242 242 diff -r a2392c293916 -r ef63ca68695b b
243 243 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
244 244 +++ b/b Thu Jan 01 00:00:00 1970 +0000
245 245 @@ -0,0 +1,1 @@
246 246 +ignore $Id$
247 247 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
248 248
249 249 Remove notify config
250 250
251 251 $ sed -e '/\[hooks\]/,$ d' "$HGRCPATH" > $HGRCPATH.nonotify
252 252 $ mv "$HGRCPATH".nonotify "$HGRCPATH"
253 253
254 254 Touch files and check with status
255 255
256 256 $ touch a b
257 257 $ hg status
258 258
259 259 Update and expand
260 260
261 261 $ rm sym a b
262 262 $ hg update -C
263 263 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
264 264 $ cat a b
265 265 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
266 266 do not process $Id:
267 267 xxx $
268 268 ignore $Id$
269 269
270 270 Check whether expansion is filewise
271 271
272 272 $ echo '$Id$' > c
273 273 $ echo 'tests for different changenodes' >> c
274 274
275 275 commit file c
276 276
277 277 $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
278 278 adding c
279 279
280 280 force expansion
281 281
282 282 $ hg -v kwexpand
283 283 overwriting a expanding keywords
284 284 overwriting c expanding keywords
285 285
286 286 compare changenodes in a and c
287 287
288 288 $ cat a c
289 289 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
290 290 do not process $Id:
291 291 xxx $
292 292 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
293 293 tests for different changenodes
294 294
295 295 record chunk
296 296
297 297 $ python -c \
298 298 > 'l=open("a").readlines();l.insert(1,"foo\n");l.append("bar\n");open("a","w").writelines(l);'
299 299 $ hg record -d '1 10' -m rectest<<EOF
300 300 > y
301 301 > y
302 302 > n
303 303 > EOF
304 304 diff --git a/a b/a
305 305 2 hunks, 2 lines changed
306 306 examine changes to 'a'? [Ynsfdaq?]
307 307 @@ -1,3 +1,4 @@
308 308 expand $Id$
309 309 +foo
310 310 do not process $Id:
311 311 xxx $
312 312 record change 1/2 to 'a'? [Ynsfdaq?]
313 313 @@ -2,2 +3,3 @@
314 314 do not process $Id:
315 315 xxx $
316 316 +bar
317 317 record change 2/2 to 'a'? [Ynsfdaq?]
318 318
319 319 $ hg identify
320 320 d17e03c92c97+ tip
321 321 $ hg status
322 322 M a
323 323
324 324 Cat modified file a
325 325
326 326 $ cat a
327 327 expand $Id: a,v d17e03c92c97 1970/01/01 00:00:01 test $
328 328 foo
329 329 do not process $Id:
330 330 xxx $
331 331 bar
332 332
333 333 Diff remaining chunk
334 334
335 335 $ hg diff
336 336 diff -r d17e03c92c97 a
337 337 --- a/a Wed Dec 31 23:59:51 1969 -0000
338 338 +++ b/a * (glob)
339 339 @@ -2,3 +2,4 @@
340 340 foo
341 341 do not process $Id:
342 342 xxx $
343 343 +bar
344 344
345 345 $ hg rollback
346 346 rolling back to revision 2 (undo commit)
347 347
348 348 Record all chunks in file a
349 349
350 350 $ echo foo > msg
351 351
352 352 - do not use "hg record -m" here!
353 353
354 354 $ hg record -l msg -d '1 11'<<EOF
355 355 > y
356 356 > y
357 357 > y
358 358 > EOF
359 359 diff --git a/a b/a
360 360 2 hunks, 2 lines changed
361 361 examine changes to 'a'? [Ynsfdaq?]
362 362 @@ -1,3 +1,4 @@
363 363 expand $Id$
364 364 +foo
365 365 do not process $Id:
366 366 xxx $
367 367 record change 1/2 to 'a'? [Ynsfdaq?]
368 368 @@ -2,2 +3,3 @@
369 369 do not process $Id:
370 370 xxx $
371 371 +bar
372 372 record change 2/2 to 'a'? [Ynsfdaq?]
373 373
374 374 File a should be clean
375 375
376 376 $ hg status -A a
377 377 C a
378 378 $ rm msg
379 379
380 380 rollback and revert expansion
381 381
382 382 $ cat a
383 383 expand $Id: a,v 59f969a3b52c 1970/01/01 00:00:01 test $
384 384 foo
385 385 do not process $Id:
386 386 xxx $
387 387 bar
388 388 $ hg --verbose rollback
389 389 rolling back to revision 2 (undo commit)
390 390 overwriting a expanding keywords
391 391 $ hg status a
392 392 M a
393 393 $ cat a
394 394 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
395 395 foo
396 396 do not process $Id:
397 397 xxx $
398 398 bar
399 399 $ echo '$Id$' > y
400 400 $ echo '$Id$' > z
401 401 $ hg add y
402 402 $ hg commit -Am "rollback only" z
403 403 $ cat z
404 404 $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $
405 405 $ hg --verbose rollback
406 406 rolling back to revision 2 (undo commit)
407 407 overwriting z shrinking keywords
408 408
409 409 Only z should be overwritten
410 410
411 411 $ hg status a y z
412 412 M a
413 413 A y
414 414 A z
415 415 $ cat z
416 416 $Id$
417 417 $ hg forget y z
418 418 $ rm y z
419 419
420 420 $ hg update -C
421 421 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
422 422
423 423 Test patch queue repo
424 424
425 425 $ hg init --mq
426 426 $ hg qimport -r tip -n mqtest.diff
427 427 $ hg commit --mq -m mqtest
428 428
429 429 Keywords should not be expanded in patch
430 430
431 431 $ cat .hg/patches/mqtest.diff
432 432 # HG changeset patch
433 433 # User User Name <user@example.com>
434 434 # Date 1 0
435 435 # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
436 436 # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9
437 437 cndiff
438 438
439 439 diff -r ef63ca68695b -r 40a904bbbe4c c
440 440 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
441 441 +++ b/c Thu Jan 01 00:00:01 1970 +0000
442 442 @@ -0,0 +1,2 @@
443 443 +$Id$
444 444 +tests for different changenodes
445 445
446 446 $ hg qpop
447 447 popping mqtest.diff
448 448 patch queue now empty
449 449
450 450 qgoto, implying qpush, should expand
451 451
452 452 $ hg qgoto mqtest.diff
453 453 applying mqtest.diff
454 454 now at: mqtest.diff
455 455 $ cat c
456 456 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
457 457 tests for different changenodes
458 458 $ hg cat c
459 459 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
460 460 tests for different changenodes
461 461
462 462 Keywords should not be expanded in filelog
463 463
464 464 $ hg --config 'extensions.keyword=!' cat c
465 465 $Id$
466 466 tests for different changenodes
467 467
468 468 qpop and move on
469 469
470 470 $ hg qpop
471 471 popping mqtest.diff
472 472 patch queue now empty
473 473
474 474 Copy and show added kwfiles
475 475
476 476 $ hg cp a c
477 477 $ hg kwfiles
478 478 a
479 479 c
480 480
481 481 Commit and show expansion in original and copy
482 482
483 483 $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
484 484 c
485 485 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
486 486 overwriting c expanding keywords
487 487 committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
488 488 $ cat a c
489 489 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
490 490 do not process $Id:
491 491 xxx $
492 492 expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
493 493 do not process $Id:
494 494 xxx $
495 495
496 496 Touch copied c and check its status
497 497
498 498 $ touch c
499 499 $ hg status
500 500
501 501 Test different options of hg kwfiles
502 502
503 503 $ hg kwfiles
504 504 a
505 505 c
506 506 $ hg -v kwfiles --ignore
507 507 I b
508 508 I sym
509 509 $ hg kwfiles --all
510 510 K a
511 511 K c
512 512 I b
513 513 I sym
514 514
515 515 Diff specific revision
516 516
517 517 $ hg diff --rev 1
518 518 diff -r ef63ca68695b c
519 519 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
520 520 +++ b/c * (glob)
521 521 @@ -0,0 +1,3 @@
522 522 +expand $Id$
523 523 +do not process $Id:
524 524 +xxx $
525 525
526 526 Status after rollback:
527 527
528 528 $ hg rollback
529 529 rolling back to revision 1 (undo commit)
530 530 $ hg status
531 531 A c
532 532 $ hg update --clean
533 533 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
534 534
535 535 Custom keywordmaps as argument to kwdemo
536 536
537 537 $ hg --quiet kwdemo "Xinfo = {author}: {desc}"
538 538 [extensions]
539 539 keyword =
540 540 [keyword]
541 541 ** =
542 542 b = ignore
543 543 demo.txt =
544 544 [keywordmaps]
545 545 Xinfo = {author}: {desc}
546 546 $Xinfo: test: hg keyword configuration and expansion example $
547 547
548 548 Configure custom keywordmaps
549 549
550 550 $ cat <<EOF >>$HGRCPATH
551 551 > [keywordmaps]
552 552 > Id = {file} {node|short} {date|rfc822date} {author|user}
553 553 > Xinfo = {author}: {desc}
554 554 > EOF
555 555
556 556 Cat and hg cat files before custom expansion
557 557
558 558 $ cat a b
559 559 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
560 560 do not process $Id:
561 561 xxx $
562 562 ignore $Id$
563 563 $ hg cat sym a b && echo
564 564 expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
565 565 do not process $Id:
566 566 xxx $
567 567 ignore $Id$
568 568 a* (glob)
569 569
570 570 Write custom keyword and prepare multiline commit message
571 571
572 572 $ echo '$Xinfo$' >> a
573 573 $ cat <<EOF >> log
574 574 > firstline
575 575 > secondline
576 576 > EOF
577 577
578 578 Interrupted commit should not change state
579 579
580 580 $ hg commit
581 581 abort: empty commit message
582 582 [255]
583 583 $ hg status
584 584 M a
585 585 ? c
586 586 ? log
587 587
588 588 Commit with multiline message and custom expansion
589 589
590 590 $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
591 591 a
592 592 overwriting a expanding keywords
593 593 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
594 594 $ rm log
595 595
596 596 Stat, verify and show custom expansion (firstline)
597 597
598 598 $ hg status
599 599 ? c
600 600 $ hg verify
601 601 checking changesets
602 602 checking manifests
603 603 crosschecking files in changesets and manifests
604 604 checking files
605 605 3 files, 3 changesets, 4 total revisions
606 606 $ cat a b
607 607 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
608 608 do not process $Id:
609 609 xxx $
610 610 $Xinfo: User Name <user@example.com>: firstline $
611 611 ignore $Id$
612 612 $ hg cat sym a b && echo
613 613 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
614 614 do not process $Id:
615 615 xxx $
616 616 $Xinfo: User Name <user@example.com>: firstline $
617 617 ignore $Id$
618 618 a* (glob)
619 619
620 620 annotate
621 621
622 622 $ hg annotate a
623 623 1: expand $Id$
624 624 1: do not process $Id:
625 625 1: xxx $
626 626 2: $Xinfo$
627 627
628 628 remove with status checks
629 629
630 630 $ hg debugrebuildstate
631 631 $ hg remove a
632 632 $ hg --debug commit -m rma
633 633 committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
634 634 $ hg status
635 635 ? c
636 636
637 637 Rollback, revert, and check expansion
638 638
639 639 $ hg rollback
640 640 rolling back to revision 2 (undo commit)
641 641 $ hg status
642 642 R a
643 643 ? c
644 644 $ hg revert --no-backup --rev tip a
645 645 $ cat a
646 646 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
647 647 do not process $Id:
648 648 xxx $
649 649 $Xinfo: User Name <user@example.com>: firstline $
650 650
651 651 Clone to test global and local configurations
652 652
653 653 $ cd ..
654 654
655 655 Expansion in destinaton with global configuration
656 656
657 657 $ hg --quiet clone Test globalconf
658 658 $ cat globalconf/a
659 659 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
660 660 do not process $Id:
661 661 xxx $
662 662 $Xinfo: User Name <user@example.com>: firstline $
663 663
664 664 No expansion in destination with local configuration in origin only
665 665
666 666 $ hg --quiet --config 'keyword.**=ignore' clone Test localconf
667 667 $ cat localconf/a
668 668 expand $Id$
669 669 do not process $Id:
670 670 xxx $
671 671 $Xinfo$
672 672
673 673 Clone to test incoming
674 674
675 675 $ hg clone -r1 Test Test-a
676 676 requesting all changes
677 677 adding changesets
678 678 adding manifests
679 679 adding file changes
680 680 added 2 changesets with 3 changes to 3 files
681 681 updating to branch default
682 682 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
683 683 $ cd Test-a
684 684 $ cat <<EOF >> .hg/hgrc
685 685 > [paths]
686 686 > default = ../Test
687 687 > EOF
688 688 $ hg incoming
689 comparing with *test-keyword.t/Test (glob)
689 comparing with */Test (glob)
690 690 searching for changes
691 691 changeset: 2:bb948857c743
692 692 tag: tip
693 693 user: User Name <user@example.com>
694 694 date: Thu Jan 01 00:00:02 1970 +0000
695 695 summary: firstline
696 696
697 697 Imported patch should not be rejected
698 698
699 699 $ sed -e 's/Id.*/& rejecttest/' a > a.new
700 700 $ mv a.new a
701 701 $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
702 702 a
703 703 overwriting a expanding keywords
704 704 committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
705 705 $ hg export -o ../rejecttest.diff tip
706 706 $ cd ../Test
707 707 $ hg import ../rejecttest.diff
708 708 applying ../rejecttest.diff
709 709 $ cat a b
710 710 expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
711 711 do not process $Id: rejecttest
712 712 xxx $
713 713 $Xinfo: User Name <user@example.com>: rejects? $
714 714 ignore $Id$
715 715
716 716 $ hg rollback
717 717 rolling back to revision 2 (undo commit)
718 718 $ hg update --clean
719 719 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
720 720
721 721 kwexpand/kwshrink on selected files
722 722
723 723 $ mkdir x
724 724 $ hg copy a x/a
725 725 $ hg --verbose kwexpand a
726 726 overwriting a expanding keywords
727 727
728 728 kwexpand x/a should abort
729 729
730 730 $ hg --verbose kwexpand x/a
731 731 abort: outstanding uncommitted changes
732 732 [255]
733 733 $ cd x
734 734 $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
735 735 x/a
736 736 x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
737 737 overwriting x/a expanding keywords
738 738 committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
739 739 $ cat a
740 740 expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
741 741 do not process $Id:
742 742 xxx $
743 743 $Xinfo: User Name <user@example.com>: xa $
744 744
745 745 kwshrink a inside directory x
746 746
747 747 $ hg --verbose kwshrink a
748 748 overwriting x/a shrinking keywords
749 749 $ cat a
750 750 expand $Id$
751 751 do not process $Id:
752 752 xxx $
753 753 $Xinfo$
754 754 $ cd ..
755 755
756 756 kwexpand nonexistent
757 757
758 758 $ hg kwexpand nonexistent
759 759 nonexistent:* (glob)
760 760
761 761
762 762 hg serve
763 763 - expand with hgweb file
764 764 - no expansion with hgweb annotate/changeset/filediff
765 765 - check errors
766 766
767 767 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
768 768 $ cat hg.pid >> $DAEMON_PIDS
769 769 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/file/tip/a/?style=raw'
770 770 200 Script output follows
771 771
772 772 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
773 773 do not process $Id:
774 774 xxx $
775 775 $Xinfo: User Name <user@example.com>: firstline $
776 776 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/annotate/tip/a/?style=raw'
777 777 200 Script output follows
778 778
779 779
780 780 user@1: expand $Id$
781 781 user@1: do not process $Id:
782 782 user@1: xxx $
783 783 user@2: $Xinfo$
784 784
785 785
786 786
787 787
788 788 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/rev/tip/?style=raw'
789 789 200 Script output follows
790 790
791 791
792 792 # HG changeset patch
793 793 # User User Name <user@example.com>
794 794 # Date 3 0
795 795 # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
796 796 # Parent bb948857c743469b22bbf51f7ec8112279ca5d83
797 797 xa
798 798
799 799 diff -r bb948857c743 -r b4560182a3f9 x/a
800 800 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
801 801 +++ b/x/a Thu Jan 01 00:00:03 1970 +0000
802 802 @@ -0,0 +1,4 @@
803 803 +expand $Id$
804 804 +do not process $Id:
805 805 +xxx $
806 806 +$Xinfo$
807 807
808 808 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/diff/bb948857c743/a?style=raw'
809 809 200 Script output follows
810 810
811 811
812 812 diff -r ef63ca68695b -r bb948857c743 a
813 813 --- a/a Thu Jan 01 00:00:00 1970 +0000
814 814 +++ b/a Thu Jan 01 00:00:02 1970 +0000
815 815 @@ -1,3 +1,4 @@
816 816 expand $Id$
817 817 do not process $Id:
818 818 xxx $
819 819 +$Xinfo$
820 820
821 821
822 822
823 823
824 824 $ cat errors.log
825 825
826 826 Prepare merge and resolve tests
827 827
828 828 $ echo '$Id$' > m
829 829 $ hg add m
830 830 $ hg commit -m 4kw
831 831 $ echo foo >> m
832 832 $ hg commit -m 5foo
833 833
834 834 simplemerge
835 835
836 836 $ hg update 4
837 837 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
838 838 $ echo foo >> m
839 839 $ hg commit -m 6foo
840 840 created new head
841 841 $ hg merge
842 842 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
843 843 (branch merge, don't forget to commit)
844 844 $ hg commit -m simplemerge
845 845 $ cat m
846 846 $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
847 847 foo
848 848
849 849 conflict: keyword should stay outside conflict zone
850 850
851 851 $ hg update 4
852 852 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
853 853 $ echo bar >> m
854 854 $ hg commit -m 8bar
855 855 created new head
856 856 $ hg merge
857 857 merging m
858 858 warning: conflicts during merge.
859 859 merging m failed!
860 860 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
861 861 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
862 862 [1]
863 863 $ cat m
864 864 $Id$
865 865 <<<<<<< local
866 866 bar
867 867 =======
868 868 foo
869 869 >>>>>>> other
870 870
871 871 resolve to local
872 872
873 873 $ HGMERGE=internal:local hg resolve -a
874 874 $ hg commit -m localresolve
875 875 $ cat m
876 876 $Id: m 41efa6d38e9b Thu, 01 Jan 1970 00:00:00 +0000 test $
877 877 bar
878 878
879 879 Test restricted mode with transplant -b
880 880
881 881 $ hg update 6
882 882 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
883 883 $ hg branch foo
884 884 marked working directory as branch foo
885 885 $ mv a a.bak
886 886 $ echo foobranch > a
887 887 $ cat a.bak >> a
888 888 $ rm a.bak
889 889 $ hg commit -m 9foobranch
890 890 $ hg update default
891 891 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
892 892 $ hg -y transplant -b foo tip
893 893 applying 4aa30d025d50
894 894 4aa30d025d50 transplanted to 5a4da427c162
895 895
896 896 Expansion in changeset but not in file
897 897
898 898 $ hg tip -p
899 899 changeset: 11:5a4da427c162
900 900 tag: tip
901 901 parent: 9:41efa6d38e9b
902 902 user: test
903 903 date: Thu Jan 01 00:00:00 1970 +0000
904 904 summary: 9foobranch
905 905
906 906 diff -r 41efa6d38e9b -r 5a4da427c162 a
907 907 --- a/a Thu Jan 01 00:00:00 1970 +0000
908 908 +++ b/a Thu Jan 01 00:00:00 1970 +0000
909 909 @@ -1,3 +1,4 @@
910 910 +foobranch
911 911 expand $Id$
912 912 do not process $Id:
913 913 xxx $
914 914
915 915 $ head -n 2 a
916 916 foobranch
917 917 expand $Id: a 5a4da427c162 Thu, 01 Jan 1970 00:00:00 +0000 test $
918 918
919 919 Turn off expansion
920 920
921 921 $ hg -q rollback
922 922 $ hg -q update -C
923 923
924 924 kwshrink with unknown file u
925 925
926 926 $ cp a u
927 927 $ hg --verbose kwshrink
928 928 overwriting a shrinking keywords
929 929 overwriting m shrinking keywords
930 930 overwriting x/a shrinking keywords
931 931
932 932 Keywords shrunk in working directory, but not yet disabled
933 933 - cat shows unexpanded keywords
934 934 - hg cat shows expanded keywords
935 935
936 936 $ cat a b
937 937 expand $Id$
938 938 do not process $Id:
939 939 xxx $
940 940 $Xinfo$
941 941 ignore $Id$
942 942 $ hg cat sym a b && echo
943 943 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
944 944 do not process $Id:
945 945 xxx $
946 946 $Xinfo: User Name <user@example.com>: firstline $
947 947 ignore $Id$
948 948 a* (glob)
949 949
950 950 Now disable keyword expansion
951 951
952 952 $ rm "$HGRCPATH"
953 953 $ cat a b
954 954 expand $Id$
955 955 do not process $Id:
956 956 xxx $
957 957 $Xinfo$
958 958 ignore $Id$
959 959 $ hg cat sym a b && echo
960 960 expand $Id$
961 961 do not process $Id:
962 962 xxx $
963 963 $Xinfo$
964 964 ignore $Id$
965 965 a* (glob)
@@ -1,16 +1,16
1 1 $ hg init a
2 2 $ hg clone a b
3 3 updating to branch default
4 4 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
5 5 $ cd a
6 6 $ echo '[paths]' >> .hg/hgrc
7 7 $ echo 'dupe = ../b' >> .hg/hgrc
8 8 $ hg in dupe
9 comparing with */test-paths.t/b (glob)
9 comparing with */b (glob)
10 10 no changes found
11 11 [1]
12 12 $ cd ..
13 13 $ hg -R a in dupe
14 comparing with */test-paths.t/b (glob)
14 comparing with */b (glob)
15 15 no changes found
16 16 [1]
@@ -1,233 +1,233
1 1
2 2 $ cp "$TESTDIR"/printenv.py .
3 3
4 4 This test tries to exercise the ssh functionality with a dummy script
5 5
6 6 $ cat <<EOF > dummyssh
7 7 > import sys
8 8 > import os
9 9 >
10 10 > os.chdir(os.path.dirname(sys.argv[0]))
11 11 > if sys.argv[1] != "user@dummy":
12 12 > sys.exit(-1)
13 13 >
14 14 > if not os.path.exists("dummyssh"):
15 15 > sys.exit(-1)
16 16 >
17 17 > os.environ["SSH_CLIENT"] = "127.0.0.1 1 2"
18 18 >
19 19 > log = open("dummylog", "ab")
20 20 > log.write("Got arguments")
21 21 > for i, arg in enumerate(sys.argv[1:]):
22 22 > log.write(" %d:%s" % (i+1, arg))
23 23 > log.write("\n")
24 24 > log.close()
25 25 > r = os.system(sys.argv[2])
26 26 > sys.exit(bool(r))
27 27 > EOF
28 28 $ cat <<EOF > badhook
29 29 > import sys
30 30 > sys.stdout.write("KABOOM\n")
31 31 > EOF
32 32
33 33 creating 'remote
34 34
35 35 $ hg init remote
36 36 $ cd remote
37 37 $ echo this > foo
38 38 $ echo this > fooO
39 39 $ hg ci -A -m "init" foo fooO
40 40 $ echo '[server]' > .hg/hgrc
41 41 $ echo 'uncompressed = True' >> .hg/hgrc
42 42 $ echo '[hooks]' >> .hg/hgrc
43 43 $ echo 'changegroup = python ../printenv.py changegroup-in-remote 0 ../dummylog' >> .hg/hgrc
44 44 $ cd ..
45 45
46 46 repo not found error
47 47
48 48 $ hg clone -e "python ./dummyssh" ssh://user@dummy/nonexistent local
49 49 remote: abort: There is no Mercurial repository here (.hg not found)!
50 50 abort: no suitable response from remote hg!
51 51 [255]
52 52
53 53 non-existent absolute path
54 54
55 55 $ hg clone -e "python ./dummyssh" ssh://user@dummy//$HGTMP/nonexistent local
56 56 remote: abort: There is no Mercurial repository here (.hg not found)!
57 57 abort: no suitable response from remote hg!
58 58 [255]
59 59
60 60 clone remote via stream
61 61
62 62 $ hg clone -e "python ./dummyssh" --uncompressed ssh://user@dummy/remote local-stream
63 63 streaming all changes
64 64 4 files to transfer, 392 bytes of data
65 65 transferred 392 bytes in * seconds (*B/sec) (glob)
66 66 updating to branch default
67 67 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
68 68 $ cd local-stream
69 69 $ hg verify
70 70 checking changesets
71 71 checking manifests
72 72 crosschecking files in changesets and manifests
73 73 checking files
74 74 2 files, 1 changesets, 2 total revisions
75 75 $ cd ..
76 76
77 77 clone remote via pull
78 78
79 79 $ hg clone -e "python ./dummyssh" ssh://user@dummy/remote local
80 80 requesting all changes
81 81 adding changesets
82 82 adding manifests
83 83 adding file changes
84 84 added 1 changesets with 2 changes to 2 files
85 85 updating to branch default
86 86 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
87 87
88 88 verify
89 89
90 90 $ cd local
91 91 $ hg verify
92 92 checking changesets
93 93 checking manifests
94 94 crosschecking files in changesets and manifests
95 95 checking files
96 96 2 files, 1 changesets, 2 total revisions
97 97 $ echo '[hooks]' >> .hg/hgrc
98 98 $ echo 'changegroup = python ../printenv.py changegroup-in-local 0 ../dummylog' >> .hg/hgrc
99 99
100 100 empty default pull
101 101
102 102 $ hg paths
103 103 default = ssh://user@dummy/remote
104 104 $ hg pull -e "python ../dummyssh"
105 105 pulling from ssh://user@dummy/remote
106 106 searching for changes
107 107 no changes found
108 108
109 109 local change
110 110
111 111 $ echo bleah > foo
112 112 $ hg ci -m "add"
113 113
114 114 updating rc
115 115
116 116 $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
117 117 $ echo "[ui]" >> .hg/hgrc
118 118 $ echo "ssh = python ../dummyssh" >> .hg/hgrc
119 119
120 120 find outgoing
121 121
122 122 $ hg out ssh://user@dummy/remote
123 123 comparing with ssh://user@dummy/remote
124 124 searching for changes
125 125 changeset: 1:a28a9d1a809c
126 126 tag: tip
127 127 user: test
128 128 date: Thu Jan 01 00:00:00 1970 +0000
129 129 summary: add
130 130
131 131
132 132 find incoming on the remote side
133 133
134 134 $ hg incoming -R ../remote -e "python ../dummyssh" ssh://user@dummy/local
135 135 comparing with ssh://user@dummy/local
136 136 searching for changes
137 137 changeset: 1:a28a9d1a809c
138 138 tag: tip
139 139 user: test
140 140 date: Thu Jan 01 00:00:00 1970 +0000
141 141 summary: add
142 142
143 143
144 144 find incoming on the remote side (using absolute path)
145 145
146 146 $ hg incoming -R ../remote -e "python ../dummyssh" "ssh://user@dummy/`pwd`"
147 comparing with ssh://user@dummy/*/test-ssh.t/local (glob)
147 comparing with ssh://user@dummy/*/local (glob)
148 148 searching for changes
149 149 changeset: 1:a28a9d1a809c
150 150 tag: tip
151 151 user: test
152 152 date: Thu Jan 01 00:00:00 1970 +0000
153 153 summary: add
154 154
155 155
156 156 push
157 157
158 158 $ hg push
159 159 pushing to ssh://user@dummy/remote
160 160 searching for changes
161 161 remote: adding changesets
162 162 remote: adding manifests
163 163 remote: adding file changes
164 164 remote: added 1 changesets with 1 changes to 1 files
165 165 $ cd ../remote
166 166
167 167 check remote tip
168 168
169 169 $ hg tip
170 170 changeset: 1:a28a9d1a809c
171 171 tag: tip
172 172 user: test
173 173 date: Thu Jan 01 00:00:00 1970 +0000
174 174 summary: add
175 175
176 176 $ hg verify
177 177 checking changesets
178 178 checking manifests
179 179 crosschecking files in changesets and manifests
180 180 checking files
181 181 2 files, 2 changesets, 3 total revisions
182 182 $ hg cat -r tip foo
183 183 bleah
184 184 $ echo z > z
185 185 $ hg ci -A -m z z
186 186 created new head
187 187
188 188 a bad, evil hook that prints to stdout
189 189
190 190 $ echo 'changegroup.stdout = python ../badhook' >> .hg/hgrc
191 191 $ cd ../local
192 192 $ echo r > r
193 193 $ hg ci -A -m z r
194 194
195 195 push should succeed even though it has an unexpected response
196 196
197 197 $ hg push
198 198 pushing to ssh://user@dummy/remote
199 199 searching for changes
200 200 note: unsynced remote changes!
201 201 remote: adding changesets
202 202 remote: adding manifests
203 203 remote: adding file changes
204 204 remote: added 1 changesets with 1 changes to 1 files
205 205 remote: KABOOM
206 206 $ hg -R ../remote heads
207 207 changeset: 3:1383141674ec
208 208 tag: tip
209 209 parent: 1:a28a9d1a809c
210 210 user: test
211 211 date: Thu Jan 01 00:00:00 1970 +0000
212 212 summary: z
213 213
214 214 changeset: 2:6c0482d977a3
215 215 parent: 0:1160648e36ce
216 216 user: test
217 217 date: Thu Jan 01 00:00:00 1970 +0000
218 218 summary: z
219 219
220 220 $ cd ..
221 221 $ cat dummylog
222 222 Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
223 223 Got arguments 1:user@dummy 2:hg -R */nonexistent serve --stdio (glob)
224 224 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
225 225 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
226 226 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
227 227 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
228 228 Got arguments 1:user@dummy 2:hg -R local serve --stdio
229 Got arguments 1:user@dummy 2:hg -R /*/test-ssh.t/local serve --stdio (glob)
229 Got arguments 1:user@dummy 2:hg -R /*/local serve --stdio (glob)
230 230 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
231 231 changegroup-in-remote hook: HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1
232 232 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
233 233 changegroup-in-remote hook: HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1
@@ -1,32 +1,32
1 1 $ hg init outer
2 2 $ cd outer
3 3
4 4 hg debugsub with no remapping
5 5
6 6 $ echo 'sub = http://example.net/libfoo' > .hgsub
7 7 $ hg add .hgsub
8 8
9 9 $ hg debugsub
10 10 path sub
11 11 source http://example.net/libfoo
12 12 revision
13 13
14 14 hg debugsub with remapping
15 15
16 16 $ echo '[subpaths]' > .hg/hgrc
17 17 $ printf 'http://example.net/lib(.*) = C:\\libs\\\\1-lib\\\n' >> .hg/hgrc
18 18
19 19 $ hg debugsub
20 20 path sub
21 21 source C:\libs\foo-lib\
22 22 revision
23 23
24 24 test bad subpaths pattern
25 25
26 26 $ cat > .hg/hgrc <<EOF
27 27 > [subpaths]
28 28 > .* = \1
29 29 > EOF
30 30 $ hg debugsub
31 abort: bad subrepository pattern in */test-subrepo-paths.t/outer/.hg/hgrc:2: invalid group reference (glob)
31 abort: bad subrepository pattern in */outer/.hg/hgrc:2: invalid group reference (glob)
32 32 [255]
@@ -1,353 +1,353
1 1 Make status look into subrepositories by default:
2 2
3 3 $ echo '[defaults]' >> $HGRCPATH
4 4 $ echo 'status = -S' >> $HGRCPATH
5 5 $ echo 'diff = --nodates -S' >> $HGRCPATH
6 6
7 7 Create test repository:
8 8
9 9 $ hg init repo
10 10 $ cd repo
11 11 $ echo x1 > x.txt
12 12
13 13 $ hg init foo
14 14 $ cd foo
15 15 $ echo y1 > y.txt
16 16
17 17 $ hg init bar
18 18 $ cd bar
19 19 $ echo z1 > z.txt
20 20
21 21 $ cd ..
22 22 $ echo 'bar = bar' > .hgsub
23 23
24 24 $ cd ..
25 25 $ echo 'foo = foo' > .hgsub
26 26
27 27 Add files --- .hgsub files must go first to trigger subrepos:
28 28
29 29 $ hg add -S .hgsub
30 30 $ hg add -S foo/.hgsub
31 31 $ hg add -S foo/bar
32 32 adding foo/bar/z.txt
33 33 $ hg add -S
34 34 adding x.txt
35 35 adding foo/y.txt
36 36
37 37 Test recursive status without committing anything:
38 38
39 39 $ hg status
40 40 A .hgsub
41 41 A foo/.hgsub
42 42 A foo/bar/z.txt
43 43 A foo/y.txt
44 44 A x.txt
45 45
46 46 Test recursive diff without committing anything:
47 47
48 48 $ hg diff foo
49 49 diff -r 000000000000 foo/.hgsub
50 50 --- /dev/null
51 51 +++ b/foo/.hgsub
52 52 @@ -0,0 +1,1 @@
53 53 +bar = bar
54 54 diff -r 000000000000 foo/y.txt
55 55 --- /dev/null
56 56 +++ b/foo/y.txt
57 57 @@ -0,0 +1,1 @@
58 58 +y1
59 59 diff -r 000000000000 foo/bar/z.txt
60 60 --- /dev/null
61 61 +++ b/foo/bar/z.txt
62 62 @@ -0,0 +1,1 @@
63 63 +z1
64 64
65 65 Commits:
66 66
67 67 $ hg commit -m 0-0-0
68 68 committing subrepository foo
69 69 committing subrepository foo/bar
70 70
71 71 $ cd foo
72 72 $ echo y2 >> y.txt
73 73 $ hg commit -m 0-1-0
74 74
75 75 $ cd bar
76 76 $ echo z2 >> z.txt
77 77 $ hg commit -m 0-1-1
78 78
79 79 $ cd ..
80 80 $ hg commit -m 0-2-1
81 81 committing subrepository bar
82 82
83 83 $ cd ..
84 84 $ hg commit -m 1-2-1
85 85 committing subrepository foo
86 86
87 87 Change working directory:
88 88
89 89 $ echo y3 >> foo/y.txt
90 90 $ echo z3 >> foo/bar/z.txt
91 91 $ hg status
92 92 M foo/bar/z.txt
93 93 M foo/y.txt
94 94 $ hg diff
95 95 diff -r d254738c5f5e foo/y.txt
96 96 --- a/foo/y.txt
97 97 +++ b/foo/y.txt
98 98 @@ -1,2 +1,3 @@
99 99 y1
100 100 y2
101 101 +y3
102 102 diff -r 9647f22de499 foo/bar/z.txt
103 103 --- a/foo/bar/z.txt
104 104 +++ b/foo/bar/z.txt
105 105 @@ -1,2 +1,3 @@
106 106 z1
107 107 z2
108 108 +z3
109 109
110 110 Status call crossing repository boundaries:
111 111
112 112 $ hg status foo/bar/z.txt
113 113 M foo/bar/z.txt
114 114 $ hg status -I 'foo/?.txt'
115 115 M foo/y.txt
116 116 $ hg status -I '**/?.txt'
117 117 M foo/bar/z.txt
118 118 M foo/y.txt
119 119 $ hg diff -I '**/?.txt'
120 120 diff -r d254738c5f5e foo/y.txt
121 121 --- a/foo/y.txt
122 122 +++ b/foo/y.txt
123 123 @@ -1,2 +1,3 @@
124 124 y1
125 125 y2
126 126 +y3
127 127 diff -r 9647f22de499 foo/bar/z.txt
128 128 --- a/foo/bar/z.txt
129 129 +++ b/foo/bar/z.txt
130 130 @@ -1,2 +1,3 @@
131 131 z1
132 132 z2
133 133 +z3
134 134
135 135 Status from within a subdirectory:
136 136
137 137 $ mkdir dir
138 138 $ cd dir
139 139 $ echo a1 > a.txt
140 140 $ hg status
141 141 M foo/bar/z.txt
142 142 M foo/y.txt
143 143 ? dir/a.txt
144 144 $ hg diff
145 145 diff -r d254738c5f5e foo/y.txt
146 146 --- a/foo/y.txt
147 147 +++ b/foo/y.txt
148 148 @@ -1,2 +1,3 @@
149 149 y1
150 150 y2
151 151 +y3
152 152 diff -r 9647f22de499 foo/bar/z.txt
153 153 --- a/foo/bar/z.txt
154 154 +++ b/foo/bar/z.txt
155 155 @@ -1,2 +1,3 @@
156 156 z1
157 157 z2
158 158 +z3
159 159
160 160 Status with relative path:
161 161
162 162 $ hg status ..
163 163 M ../foo/bar/z.txt
164 164 M ../foo/y.txt
165 165 ? a.txt
166 166 $ hg diff ..
167 167 diff -r d254738c5f5e foo/y.txt
168 168 --- a/foo/y.txt
169 169 +++ b/foo/y.txt
170 170 @@ -1,2 +1,3 @@
171 171 y1
172 172 y2
173 173 +y3
174 174 diff -r 9647f22de499 foo/bar/z.txt
175 175 --- a/foo/bar/z.txt
176 176 +++ b/foo/bar/z.txt
177 177 @@ -1,2 +1,3 @@
178 178 z1
179 179 z2
180 180 +z3
181 181 $ cd ..
182 182
183 183 Cleanup and final commit:
184 184
185 185 $ rm -r dir
186 186 $ hg commit -m 2-3-2
187 187 committing subrepository foo
188 188 committing subrepository foo/bar
189 189
190 190 Log with the relationships between repo and its subrepo:
191 191
192 192 $ hg log --template '{rev}:{node|short} {desc}\n'
193 193 2:1326fa26d0c0 2-3-2
194 194 1:4b3c9ff4f66b 1-2-1
195 195 0:23376cbba0d8 0-0-0
196 196
197 197 $ hg -R foo log --template '{rev}:{node|short} {desc}\n'
198 198 3:65903cebad86 2-3-2
199 199 2:d254738c5f5e 0-2-1
200 200 1:8629ce7dcc39 0-1-0
201 201 0:af048e97ade2 0-0-0
202 202
203 203 $ hg -R foo/bar log --template '{rev}:{node|short} {desc}\n'
204 204 2:31ecbdafd357 2-3-2
205 205 1:9647f22de499 0-1-1
206 206 0:4904098473f9 0-0-0
207 207
208 208 Status between revisions:
209 209
210 210 $ hg status
211 211 $ hg status --rev 0:1
212 212 M .hgsubstate
213 213 M foo/.hgsubstate
214 214 M foo/bar/z.txt
215 215 M foo/y.txt
216 216 $ hg diff -I '**/?.txt' --rev 0:1
217 217 diff -r af048e97ade2 -r d254738c5f5e foo/y.txt
218 218 --- a/foo/y.txt
219 219 +++ b/foo/y.txt
220 220 @@ -1,1 +1,2 @@
221 221 y1
222 222 +y2
223 223 diff -r 4904098473f9 -r 9647f22de499 foo/bar/z.txt
224 224 --- a/foo/bar/z.txt
225 225 +++ b/foo/bar/z.txt
226 226 @@ -1,1 +1,2 @@
227 227 z1
228 228 +z2
229 229
230 230 Test archiving to a directory tree:
231 231
232 232 $ hg archive --subrepos ../archive
233 233 $ find ../archive | sort
234 234 ../archive
235 235 ../archive/.hg_archival.txt
236 236 ../archive/.hgsub
237 237 ../archive/.hgsubstate
238 238 ../archive/foo
239 239 ../archive/foo/.hgsub
240 240 ../archive/foo/.hgsubstate
241 241 ../archive/foo/bar
242 242 ../archive/foo/bar/z.txt
243 243 ../archive/foo/y.txt
244 244 ../archive/x.txt
245 245
246 246 Test archiving to zip file (unzip output is unstable):
247 247
248 248 $ hg archive --subrepos ../archive.zip
249 249
250 250 Clone and test outgoing:
251 251
252 252 $ cd ..
253 253 $ hg clone repo repo2
254 254 updating to branch default
255 pulling subrepo foo from */test-subrepo-recursion.t/repo/foo (glob)
255 pulling subrepo foo from */repo/foo (glob)
256 256 requesting all changes
257 257 adding changesets
258 258 adding manifests
259 259 adding file changes
260 260 added 4 changesets with 7 changes to 3 files
261 pulling subrepo foo/bar from */test-subrepo-recursion.t/repo/foo/bar (glob)
261 pulling subrepo foo/bar from */repo/foo/bar (glob)
262 262 requesting all changes
263 263 adding changesets
264 264 adding manifests
265 265 adding file changes
266 266 added 3 changesets with 3 changes to 1 files
267 267 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
268 268 $ cd repo2
269 269 $ hg outgoing -S
270 comparing with */test-subrepo-recursion.t/repo (glob)
270 comparing with */repo (glob)
271 271 searching for changes
272 272 no changes found
273 comparing with */test-subrepo-recursion.t/repo/foo (glob)
273 comparing with */repo/foo (glob)
274 274 searching for changes
275 275 no changes found
276 comparing with */test-subrepo-recursion.t/repo/foo/bar (glob)
276 comparing with */repo/foo/bar (glob)
277 277 searching for changes
278 278 no changes found
279 279 [1]
280 280
281 281 Make nested change:
282 282
283 283 $ echo y4 >> foo/y.txt
284 284 $ hg diff
285 285 diff -r 65903cebad86 foo/y.txt
286 286 --- a/foo/y.txt
287 287 +++ b/foo/y.txt
288 288 @@ -1,3 +1,4 @@
289 289 y1
290 290 y2
291 291 y3
292 292 +y4
293 293 $ hg commit -m 3-4-2
294 294 committing subrepository foo
295 295 $ hg outgoing -S
296 comparing with */test-subrepo-recursion.t/repo (glob)
296 comparing with */repo (glob)
297 297 searching for changes
298 298 changeset: 3:2655b8ecc4ee
299 299 tag: tip
300 300 user: test
301 301 date: Thu Jan 01 00:00:00 1970 +0000
302 302 summary: 3-4-2
303 303
304 comparing with */test-subrepo-recursion.t/repo/foo (glob)
304 comparing with */repo/foo (glob)
305 305 searching for changes
306 306 changeset: 4:e96193d6cb36
307 307 tag: tip
308 308 user: test
309 309 date: Thu Jan 01 00:00:00 1970 +0000
310 310 summary: 3-4-2
311 311
312 comparing with */test-subrepo-recursion.t/repo/foo/bar (glob)
312 comparing with */repo/foo/bar (glob)
313 313 searching for changes
314 314 no changes found
315 315
316 316 Switch to original repo and setup default path:
317 317
318 318 $ cd ../repo
319 319 $ echo '[paths]' >> .hg/hgrc
320 320 $ echo 'default = ../repo2' >> .hg/hgrc
321 321
322 322 Test incoming:
323 323
324 324 $ hg incoming -S
325 comparing with */test-subrepo-recursion.t/repo2 (glob)
325 comparing with */repo2 (glob)
326 326 searching for changes
327 327 changeset: 3:2655b8ecc4ee
328 328 tag: tip
329 329 user: test
330 330 date: Thu Jan 01 00:00:00 1970 +0000
331 331 summary: 3-4-2
332 332
333 comparing with */test-subrepo-recursion.t/repo2/foo (glob)
333 comparing with */repo2/foo (glob)
334 334 searching for changes
335 335 changeset: 4:e96193d6cb36
336 336 tag: tip
337 337 user: test
338 338 date: Thu Jan 01 00:00:00 1970 +0000
339 339 summary: 3-4-2
340 340
341 comparing with */test-subrepo-recursion.t/repo2/foo/bar (glob)
341 comparing with */repo2/foo/bar (glob)
342 342 searching for changes
343 343 no changes found
344 344
345 345 $ hg incoming -S --bundle incoming.hg
346 346 abort: cannot combine --bundle and --subrepos
347 347 [255]
348 348
349 349 Test missing subrepo:
350 350
351 351 $ rm -r foo
352 352 $ hg status
353 353 warning: error "unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'" in subrepository "foo"
@@ -1,587 +1,587
1 1 $ rm -rf sub
2 2 $ mkdir sub
3 3 $ cd sub
4 4 $ hg init t
5 5 $ cd t
6 6
7 7 first revision, no sub
8 8
9 9 $ echo a > a
10 10 $ hg ci -Am0
11 11 adding a
12 12
13 13 add first sub
14 14
15 15 $ echo s = s > .hgsub
16 16 $ hg add .hgsub
17 17 $ hg init s
18 18 $ echo a > s/a
19 19
20 20 Issue2232: committing a subrepo without .hgsub
21 21
22 22 $ hg ci -mbad s
23 23 abort: can't commit subrepos without .hgsub
24 24 [255]
25 25
26 26 $ hg -R s ci -Ams0
27 27 adding a
28 28 $ hg sum
29 29 parent: 0:f7b1eb17ad24 tip
30 30 0
31 31 branch: default
32 32 commit: 1 added, 1 subrepos
33 33 update: (current)
34 34 $ hg ci -m1
35 35 committing subrepository s
36 36
37 37 Issue2022: update -C
38 38
39 39 $ echo b > s/a
40 40 $ hg sum
41 41 parent: 1:7cf8cfea66e4 tip
42 42 1
43 43 branch: default
44 44 commit: 1 subrepos
45 45 update: (current)
46 46 $ hg co -C 1
47 47 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
48 48 $ hg sum
49 49 parent: 1:7cf8cfea66e4 tip
50 50 1
51 51 branch: default
52 52 commit: (clean)
53 53 update: (current)
54 54
55 55 add sub sub
56 56
57 57 $ echo ss = ss > s/.hgsub
58 58 $ hg init s/ss
59 59 $ echo a > s/ss/a
60 60 $ hg -R s add s/.hgsub
61 61 $ hg -R s/ss add s/ss/a
62 62 $ hg sum
63 63 parent: 1:7cf8cfea66e4 tip
64 64 1
65 65 branch: default
66 66 commit: 1 subrepos
67 67 update: (current)
68 68 $ hg ci -m2
69 69 committing subrepository s
70 70 committing subrepository s/ss
71 71 $ hg sum
72 72 parent: 2:df30734270ae tip
73 73 2
74 74 branch: default
75 75 commit: (clean)
76 76 update: (current)
77 77
78 78 bump sub rev
79 79
80 80 $ echo b > s/a
81 81 $ hg -R s ci -ms1
82 82 $ hg ci -m3
83 83 committing subrepository s
84 84
85 85 leave sub dirty
86 86
87 87 $ echo c > s/a
88 88 $ hg ci -m4
89 89 committing subrepository s
90 90 $ hg tip -R s
91 91 changeset: 3:1c833a7a9e3a
92 92 tag: tip
93 93 user: test
94 94 date: Thu Jan 01 00:00:00 1970 +0000
95 95 summary: 4
96 96
97 97
98 98 check caching
99 99
100 100 $ hg co 0
101 101 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
102 102 $ hg debugsub
103 103
104 104 restore
105 105
106 106 $ hg co
107 107 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
108 108 $ hg debugsub
109 109 path s
110 110 source s
111 111 revision 1c833a7a9e3a4445c711aaf0f012379cd0d4034e
112 112
113 113 new branch for merge tests
114 114
115 115 $ hg co 1
116 116 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
117 117 $ echo t = t >> .hgsub
118 118 $ hg init t
119 119 $ echo t > t/t
120 120 $ hg -R t add t
121 121 adding t/t
122 122
123 123 5
124 124
125 125 $ hg ci -m5 # add sub
126 126 committing subrepository t
127 127 created new head
128 128 $ echo t2 > t/t
129 129
130 130 6
131 131
132 132 $ hg st -R s
133 133 $ hg ci -m6 # change sub
134 134 committing subrepository t
135 135 $ hg debugsub
136 136 path s
137 137 source s
138 138 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
139 139 path t
140 140 source t
141 141 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
142 142 $ echo t3 > t/t
143 143
144 144 7
145 145
146 146 $ hg ci -m7 # change sub again for conflict test
147 147 committing subrepository t
148 148 $ hg rm .hgsub
149 149
150 150 8
151 151
152 152 $ hg ci -m8 # remove sub
153 153
154 154 merge tests
155 155
156 156 $ hg co -C 3
157 157 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
158 158 $ hg merge 5 # test adding
159 159 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
160 160 (branch merge, don't forget to commit)
161 161 $ hg debugsub
162 162 path s
163 163 source s
164 164 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
165 165 path t
166 166 source t
167 167 revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382
168 168 $ hg ci -m9
169 169 created new head
170 170 $ hg merge 6 --debug # test change
171 171 searching for copies back to rev 2
172 172 resolving manifests
173 173 overwrite None partial False
174 174 ancestor 1f14a2e2d3ec local f0d2028bf86d+ remote 1831e14459c4
175 175 .hgsubstate: versions differ -> m
176 176 updating: .hgsubstate 1/1 files (100.00%)
177 177 subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec
178 178 subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg
179 179 getting subrepo t
180 180 resolving manifests
181 181 overwrite True partial False
182 182 ancestor 60ca1237c194+ local 60ca1237c194+ remote 6747d179aa9a
183 183 t: remote is newer -> g
184 184 updating: t 1/1 files (100.00%)
185 185 getting t
186 186 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
187 187 (branch merge, don't forget to commit)
188 188 $ hg debugsub
189 189 path s
190 190 source s
191 191 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
192 192 path t
193 193 source t
194 194 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
195 195 $ echo conflict > t/t
196 196 $ hg ci -m10
197 197 committing subrepository t
198 198 $ HGMERGE=internal:merge hg merge --debug 7 # test conflict
199 199 searching for copies back to rev 2
200 200 resolving manifests
201 201 overwrite None partial False
202 202 ancestor 1831e14459c4 local e45c8b14af55+ remote f94576341bcf
203 203 .hgsubstate: versions differ -> m
204 204 updating: .hgsubstate 1/1 files (100.00%)
205 205 subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4
206 206 subrepo t: both sides changed, merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg
207 207 merging subrepo t
208 208 searching for copies back to rev 2
209 209 resolving manifests
210 210 overwrite None partial False
211 211 ancestor 6747d179aa9a local 20a0db6fbf6c+ remote 7af322bc1198
212 212 t: versions differ -> m
213 213 preserving t for resolve of t
214 214 updating: t 1/1 files (100.00%)
215 215 picked tool 'internal:merge' for t (binary False symlink False)
216 216 merging t
217 217 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
218 218 warning: conflicts during merge.
219 219 merging t failed!
220 220 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
221 221 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
222 222 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
223 223 (branch merge, don't forget to commit)
224 224
225 225 should conflict
226 226
227 227 $ cat t/t
228 228 <<<<<<< local
229 229 conflict
230 230 =======
231 231 t3
232 232 >>>>>>> other
233 233
234 234 clone
235 235
236 236 $ cd ..
237 237 $ hg clone t tc
238 238 updating to branch default
239 239 pulling subrepo s from */sub/t/s (glob)
240 240 requesting all changes
241 241 adding changesets
242 242 adding manifests
243 243 adding file changes
244 244 added 4 changesets with 5 changes to 3 files
245 245 pulling subrepo s/ss from */sub/t/s/ss (glob)
246 246 requesting all changes
247 247 adding changesets
248 248 adding manifests
249 249 adding file changes
250 250 added 1 changesets with 1 changes to 1 files
251 251 pulling subrepo t from */sub/t/t (glob)
252 252 requesting all changes
253 253 adding changesets
254 254 adding manifests
255 255 adding file changes
256 256 added 4 changesets with 4 changes to 1 files (+1 heads)
257 257 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
258 258 $ cd tc
259 259 $ hg debugsub
260 260 path s
261 261 source s
262 262 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
263 263 path t
264 264 source t
265 265 revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e
266 266
267 267 push
268 268
269 269 $ echo bah > t/t
270 270 $ hg ci -m11
271 271 committing subrepository t
272 272 $ hg push
273 273 pushing *sub/t (glob)
274 274 pushing *sub/t/s/ss (glob)
275 275 searching for changes
276 276 no changes found
277 277 pushing *sub/t/s (glob)
278 278 searching for changes
279 279 no changes found
280 280 pushing *sub/t/t (glob)
281 281 searching for changes
282 282 adding changesets
283 283 adding manifests
284 284 adding file changes
285 285 added 1 changesets with 1 changes to 1 files
286 286 searching for changes
287 287 adding changesets
288 288 adding manifests
289 289 adding file changes
290 290 added 1 changesets with 1 changes to 1 files
291 291
292 292 push -f
293 293
294 294 $ echo bah > s/a
295 295 $ hg ci -m12
296 296 committing subrepository s
297 297 $ hg push
298 298 pushing *sub/t (glob)
299 299 pushing *sub/t/s/ss (glob)
300 300 searching for changes
301 301 no changes found
302 302 pushing *sub/t/s (glob)
303 303 searching for changes
304 304 abort: push creates new remote heads on branch 'default'!
305 305 (did you forget to merge? use push -f to force)
306 306 [255]
307 307 $ hg push -f
308 308 pushing *sub/t (glob)
309 309 pushing *sub/t/s/ss (glob)
310 310 searching for changes
311 311 no changes found
312 312 pushing *sub/t/s (glob)
313 313 searching for changes
314 314 adding changesets
315 315 adding manifests
316 316 adding file changes
317 317 added 1 changesets with 1 changes to 1 files (+1 heads)
318 318 pushing *sub/t/t (glob)
319 319 searching for changes
320 320 no changes found
321 321 searching for changes
322 322 adding changesets
323 323 adding manifests
324 324 adding file changes
325 325 added 1 changesets with 1 changes to 1 files
326 326
327 327 update
328 328
329 329 $ cd ../t
330 330 $ hg up -C # discard our earlier merge
331 331 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
332 332 $ echo blah > t/t
333 333 $ hg ci -m13
334 334 committing subrepository t
335 335
336 336 pull
337 337
338 338 $ cd ../tc
339 339 $ hg pull
340 340 pulling *sub/t (glob)
341 341 searching for changes
342 342 adding changesets
343 343 adding manifests
344 344 adding file changes
345 345 added 1 changesets with 1 changes to 1 files
346 346 (run 'hg update' to get a working copy)
347 347
348 348 should pull t
349 349
350 350 $ hg up
351 351 pulling subrepo t from */sub/t/t (glob)
352 352 searching for changes
353 353 adding changesets
354 354 adding manifests
355 355 adding file changes
356 356 added 1 changesets with 1 changes to 1 files
357 357 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
358 358 $ cat t/t
359 359 blah
360 360
361 361 bogus subrepo path aborts
362 362
363 363 $ echo 'bogus=[boguspath' >> .hgsub
364 364 $ hg ci -m 'bogus subrepo path'
365 365 abort: missing ] in subrepo source
366 366 [255]
367 367
368 368 Issue1986: merge aborts when trying to merge a subrepo that
369 369 shouldn't need merging
370 370
371 371 # subrepo layout
372 372 #
373 373 # o 5 br
374 374 # /|
375 375 # o | 4 default
376 376 # | |
377 377 # | o 3 br
378 378 # |/|
379 379 # o | 2 default
380 380 # | |
381 381 # | o 1 br
382 382 # |/
383 383 # o 0 default
384 384
385 385 $ cd ..
386 386 $ rm -rf sub
387 387 $ hg init main
388 388 $ cd main
389 389 $ hg init s
390 390 $ cd s
391 391 $ echo a > a
392 392 $ hg ci -Am1
393 393 adding a
394 394 $ hg branch br
395 395 marked working directory as branch br
396 396 $ echo a >> a
397 397 $ hg ci -m1
398 398 $ hg up default
399 399 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
400 400 $ echo b > b
401 401 $ hg ci -Am1
402 402 adding b
403 403 $ hg up br
404 404 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
405 405 $ hg merge tip
406 406 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
407 407 (branch merge, don't forget to commit)
408 408 $ hg ci -m1
409 409 $ hg up 2
410 410 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
411 411 $ echo c > c
412 412 $ hg ci -Am1
413 413 adding c
414 414 $ hg up 3
415 415 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
416 416 $ hg merge 4
417 417 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
418 418 (branch merge, don't forget to commit)
419 419 $ hg ci -m1
420 420
421 421 # main repo layout:
422 422 #
423 423 # * <-- try to merge default into br again
424 424 # .`|
425 425 # . o 5 br --> substate = 5
426 426 # . |
427 427 # o | 4 default --> substate = 4
428 428 # | |
429 429 # | o 3 br --> substate = 2
430 430 # |/|
431 431 # o | 2 default --> substate = 2
432 432 # | |
433 433 # | o 1 br --> substate = 3
434 434 # |/
435 435 # o 0 default --> substate = 2
436 436
437 437 $ cd ..
438 438 $ echo 's = s' > .hgsub
439 439 $ hg -R s up 2
440 440 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
441 441 $ hg ci -Am1
442 442 adding .hgsub
443 443 committing subrepository s
444 444 $ hg branch br
445 445 marked working directory as branch br
446 446 $ echo b > b
447 447 $ hg -R s up 3
448 448 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
449 449 $ hg ci -Am1
450 450 adding b
451 451 committing subrepository s
452 452 $ hg up default
453 453 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
454 454 $ echo c > c
455 455 $ hg ci -Am1
456 456 adding c
457 457 $ hg up 1
458 458 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
459 459 $ hg merge 2
460 460 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
461 461 (branch merge, don't forget to commit)
462 462 $ hg ci -m1
463 463 $ hg up 2
464 464 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
465 465 $ hg -R s up 4
466 466 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
467 467 $ echo d > d
468 468 $ hg ci -Am1
469 469 adding d
470 470 committing subrepository s
471 471 $ hg up 3
472 472 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
473 473 $ hg -R s up 5
474 474 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
475 475 $ echo e > e
476 476 $ hg ci -Am1
477 477 adding e
478 478 committing subrepository s
479 479
480 480 $ hg up 5
481 481 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
482 482 $ hg merge 4 # try to merge default into br again
483 483 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
484 484 (branch merge, don't forget to commit)
485 485 $ cd ..
486 486
487 487 test subrepo delete from .hgsubstate
488 488
489 489 $ hg init testdelete
490 490 $ mkdir testdelete/nested testdelete/nested2
491 491 $ hg init testdelete/nested
492 492 $ hg init testdelete/nested2
493 493 $ echo test > testdelete/nested/foo
494 494 $ echo test > testdelete/nested2/foo
495 495 $ hg -R testdelete/nested add
496 496 adding testdelete/nested/foo
497 497 $ hg -R testdelete/nested2 add
498 498 adding testdelete/nested2/foo
499 499 $ hg -R testdelete/nested ci -m test
500 500 $ hg -R testdelete/nested2 ci -m test
501 501 $ echo nested = nested > testdelete/.hgsub
502 502 $ echo nested2 = nested2 >> testdelete/.hgsub
503 503 $ hg -R testdelete add
504 504 adding testdelete/.hgsub
505 505 $ hg -R testdelete ci -m "nested 1 & 2 added"
506 506 committing subrepository nested
507 507 committing subrepository nested2
508 508 $ echo nested = nested > testdelete/.hgsub
509 509 $ hg -R testdelete ci -m "nested 2 deleted"
510 510 $ cat testdelete/.hgsubstate
511 511 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
512 512 $ hg -R testdelete remove testdelete/.hgsub
513 513 $ hg -R testdelete ci -m ".hgsub deleted"
514 514 $ cat testdelete/.hgsubstate
515 515
516 516 test repository cloning
517 517
518 518 $ mkdir mercurial mercurial2
519 519 $ hg init nested_absolute
520 520 $ echo test > nested_absolute/foo
521 521 $ hg -R nested_absolute add
522 522 adding nested_absolute/foo
523 523 $ hg -R nested_absolute ci -mtest
524 524 $ cd mercurial
525 525 $ hg init nested_relative
526 526 $ echo test2 > nested_relative/foo2
527 527 $ hg -R nested_relative add
528 528 adding nested_relative/foo2
529 529 $ hg -R nested_relative ci -mtest2
530 530 $ hg init main
531 531 $ echo "nested_relative = ../nested_relative" > main/.hgsub
532 532 $ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub
533 533 $ hg -R main add
534 534 adding main/.hgsub
535 535 $ hg -R main ci -m "add subrepos"
536 536 committing subrepository nested_absolute
537 537 committing subrepository nested_relative
538 538 $ cd ..
539 539 $ hg clone mercurial/main mercurial2/main
540 540 updating to branch default
541 541 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
542 542 $ cat mercurial2/main/nested_absolute/.hg/hgrc \
543 543 > mercurial2/main/nested_relative/.hg/hgrc
544 544 [paths]
545 default = */test-subrepo.t/sub/mercurial/nested_absolute (glob)
545 default = */sub/mercurial/nested_absolute (glob)
546 546 [paths]
547 default = */test-subrepo.t/sub/mercurial/nested_relative (glob)
547 default = */sub/mercurial/nested_relative (glob)
548 548 $ rm -rf mercurial mercurial2
549 549
550 550 Issue1977: multirepo push should fail if subrepo push fails
551 551
552 552 $ hg init repo
553 553 $ hg init repo/s
554 554 $ echo a > repo/s/a
555 555 $ hg -R repo/s ci -Am0
556 556 adding a
557 557 $ echo s = s > repo/.hgsub
558 558 $ hg -R repo ci -Am1
559 559 adding .hgsub
560 560 committing subrepository s
561 561 $ hg clone repo repo2
562 562 updating to branch default
563 563 pulling subrepo s from */sub/repo/s (glob)
564 564 requesting all changes
565 565 adding changesets
566 566 adding manifests
567 567 adding file changes
568 568 added 1 changesets with 1 changes to 1 files
569 569 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
570 570 $ hg -q -R repo2 pull -u
571 571 $ echo 1 > repo2/s/a
572 572 $ hg -R repo2/s ci -m2
573 573 $ hg -q -R repo2/s push
574 574 $ hg -R repo2/s up -C 0
575 575 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
576 576 $ echo 2 > repo2/s/a
577 577 $ hg -R repo2/s ci -m3
578 578 created new head
579 579 $ hg -R repo2 ci -m3
580 580 committing subrepository s
581 581 $ hg -q -R repo2 push
582 582 abort: push creates new remote heads on branch 'default'!
583 583 (did you forget to merge? use push -f to force)
584 584 [255]
585 585 $ hg -R repo update
586 586 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
587 587 $ rm -rf repo2 repo
General Comments 0
You need to be logged in to leave comments. Login now