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