##// END OF EJS Templates
test-extdiff: fix 5c0e1222e7c0 temporary dir output
Patrick Mezard -
r13762:3740792d default
parent child Browse files
Show More
@@ -1,179 +1,179 b''
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 */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
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
77 $ hg falabala
78 diffing a.2a13a4d2da36/a $TESTTMP/a/a
78 diffing */extdiff.*/a.2a13a4d2da36/a */a/a (glob)
79 [1]
79 [1]
80
80
81
81
82 Test --change option:
82 Test --change option:
83
83
84 $ hg ci -d '2 0' -mtest3
84 $ hg ci -d '2 0' -mtest3
85 $ hg falabala -c 1
85 $ hg falabala -c 1
86 diffing a.8a5febb7f867/a a.34eed99112ab/a
86 diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
87 [1]
87 [1]
88
88
89 Check diff are made from the first parent:
89 Check diff are made from the first parent:
90
90
91 $ 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"
92 diffing a.2a13a4d2da36/a a.46c0e4daeb72/a
92 diffing */extdiff.*/a.2a13a4d2da36/a a.46c0e4daeb72/a (glob)
93 diff-like tools yield a non-zero exit code
93 diff-like tools yield a non-zero exit code
94
94
95 Test extdiff of multiple files in tmp dir:
95 Test extdiff of multiple files in tmp dir:
96
96
97 $ hg update -C 0 > /dev/null
97 $ hg update -C 0 > /dev/null
98 $ echo changed > a
98 $ echo changed > a
99 $ echo changed > b
99 $ echo changed > b
100 $ chmod +x b
100 $ chmod +x b
101
101
102 Diff in working directory, before:
102 Diff in working directory, before:
103
103
104 $ hg diff --git
104 $ hg diff --git
105 diff --git a/a b/a
105 diff --git a/a b/a
106 --- a/a
106 --- a/a
107 +++ b/a
107 +++ b/a
108 @@ -1,1 +1,1 @@
108 @@ -1,1 +1,1 @@
109 -a
109 -a
110 +changed
110 +changed
111 diff --git a/b b/b
111 diff --git a/b b/b
112 old mode 100644
112 old mode 100644
113 new mode 100755
113 new mode 100755
114 --- a/b
114 --- a/b
115 +++ b/b
115 +++ b/b
116 @@ -1,1 +1,1 @@
116 @@ -1,1 +1,1 @@
117 -b
117 -b
118 +changed
118 +changed
119
119
120
120
121 Edit with extdiff -p:
121 Edit with extdiff -p:
122
122
123 Prepare custom diff/edit tool:
123 Prepare custom diff/edit tool:
124
124
125 $ cat > 'diff tool.py' << EOT
125 $ cat > 'diff tool.py' << EOT
126 > #!/usr/bin/env python
126 > #!/usr/bin/env python
127 > import time
127 > import time
128 > time.sleep(1) # avoid unchanged-timestamp problems
128 > time.sleep(1) # avoid unchanged-timestamp problems
129 > file('a/a', 'ab').write('edited\n')
129 > file('a/a', 'ab').write('edited\n')
130 > file('a/b', 'ab').write('edited\n')
130 > file('a/b', 'ab').write('edited\n')
131 > EOT
131 > EOT
132
132
133 $ chmod +x 'diff tool.py'
133 $ chmod +x 'diff tool.py'
134
134
135 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
136 and start tool
136 and start tool
137
137
138 $ hg extdiff -p "`pwd`/diff tool.py"
138 $ hg extdiff -p "`pwd`/diff tool.py"
139 [1]
139 [1]
140
140
141 Diff in working directory, after:
141 Diff in working directory, after:
142
142
143 $ hg diff --git
143 $ hg diff --git
144 diff --git a/a b/a
144 diff --git a/a b/a
145 --- a/a
145 --- a/a
146 +++ b/a
146 +++ b/a
147 @@ -1,1 +1,2 @@
147 @@ -1,1 +1,2 @@
148 -a
148 -a
149 +changed
149 +changed
150 +edited
150 +edited
151 diff --git a/b b/b
151 diff --git a/b b/b
152 old mode 100644
152 old mode 100644
153 new mode 100755
153 new mode 100755
154 --- a/b
154 --- a/b
155 +++ b/b
155 +++ b/b
156 @@ -1,1 +1,2 @@
156 @@ -1,1 +1,2 @@
157 -b
157 -b
158 +changed
158 +changed
159 +edited
159 +edited
160
160
161 Test extdiff with --option:
161 Test extdiff with --option:
162
162
163 $ hg extdiff -p echo -o this -c 1
163 $ hg extdiff -p echo -o this -c 1
164 this a.8a5febb7f867/a a.34eed99112ab/a
164 this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
165 [1]
165 [1]
166
166
167 $ hg falabala -o this -c 1
167 $ hg falabala -o this -c 1
168 diffing this a.8a5febb7f867/a a.34eed99112ab/a
168 diffing this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
169 [1]
169 [1]
170
170
171 Test with revsets:
171 Test with revsets:
172
172
173 $ hg extdif -p echo -c "rev(1)"
173 $ hg extdif -p echo -c "rev(1)"
174 a.8a5febb7f867/a a.34eed99112ab/a
174 */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
175 [1]
175 [1]
176
176
177 $ hg extdif -p echo -r "0::1"
177 $ hg extdif -p echo -r "0::1"
178 a.8a5febb7f867/a a.34eed99112ab/a
178 */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
179 [1]
179 [1]
General Comments 0
You need to be logged in to leave comments. Login now