##// 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 1 $ echo "[extensions]" >> $HGRCPATH
2 2 $ echo "extdiff=" >> $HGRCPATH
3 3
4 4 $ hg init a
5 5 $ cd a
6 6 $ echo a > a
7 7 $ echo b > b
8 8 $ hg add
9 9 adding a
10 10 adding b
11 11
12 12 Should diff cloned directories:
13 13
14 14 $ hg extdiff -o -r $opt
15 15 Only in a: a
16 16 Only in a: b
17 17 [1]
18 18
19 19 $ echo "[extdiff]" >> $HGRCPATH
20 20 $ echo "cmd.falabala=echo" >> $HGRCPATH
21 21 $ echo "opts.falabala=diffing" >> $HGRCPATH
22 22
23 23 $ hg falabala
24 24 diffing a.000000000000 a
25 25 [1]
26 26
27 27 $ hg help falabala
28 28 hg falabala [OPTION]... [FILE]...
29 29
30 30 use 'echo' to diff repository (or selected files)
31 31
32 32 Show differences between revisions for the specified files, using the
33 33 'echo' program.
34 34
35 35 When two revision arguments are given, then changes are shown between
36 36 those revisions. If only one revision is specified then that revision is
37 37 compared to the working directory, and, when no revisions are specified,
38 38 the working directory files are compared to its parent.
39 39
40 40 options:
41 41
42 42 -o --option OPT [+] pass option to comparison program
43 43 -r --rev REV [+] revision
44 44 -c --change REV change made by revision
45 45 -I --include PATTERN [+] include names matching the given patterns
46 46 -X --exclude PATTERN [+] exclude names matching the given patterns
47 47
48 48 [+] marked option can be specified multiple times
49 49
50 50 use "hg -v help falabala" to show global options
51 51
52 52 $ hg ci -d '0 0' -mtest1
53 53
54 54 $ echo b >> a
55 55 $ hg ci -d '1 0' -mtest2
56 56
57 57 Should diff cloned files directly:
58 58
59 59 $ hg falabala -r 0:1
60 diffing a.8a5febb7f867/a a.34eed99112ab/a
60 diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
61 61 [1]
62 62
63 63 Test diff during merge:
64 64
65 65 $ hg update -C 0
66 66 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
67 67 $ echo c >> c
68 68 $ hg add c
69 69 $ hg ci -m "new branch" -d '1 0'
70 70 created new head
71 71 $ hg merge 1
72 72 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
73 73 (branch merge, don't forget to commit)
74 74
75 75 Should diff cloned file against wc file:
76 76
77 77 $ hg falabala
78 diffing a.2a13a4d2da36/a $TESTTMP/a/a
78 diffing */extdiff.*/a.2a13a4d2da36/a */a/a (glob)
79 79 [1]
80 80
81 81
82 82 Test --change option:
83 83
84 84 $ hg ci -d '2 0' -mtest3
85 85 $ hg falabala -c 1
86 diffing a.8a5febb7f867/a a.34eed99112ab/a
86 diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
87 87 [1]
88 88
89 89 Check diff are made from the first parent:
90 90
91 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 93 diff-like tools yield a non-zero exit code
94 94
95 95 Test extdiff of multiple files in tmp dir:
96 96
97 97 $ hg update -C 0 > /dev/null
98 98 $ echo changed > a
99 99 $ echo changed > b
100 100 $ chmod +x b
101 101
102 102 Diff in working directory, before:
103 103
104 104 $ hg diff --git
105 105 diff --git a/a b/a
106 106 --- a/a
107 107 +++ b/a
108 108 @@ -1,1 +1,1 @@
109 109 -a
110 110 +changed
111 111 diff --git a/b b/b
112 112 old mode 100644
113 113 new mode 100755
114 114 --- a/b
115 115 +++ b/b
116 116 @@ -1,1 +1,1 @@
117 117 -b
118 118 +changed
119 119
120 120
121 121 Edit with extdiff -p:
122 122
123 123 Prepare custom diff/edit tool:
124 124
125 125 $ cat > 'diff tool.py' << EOT
126 126 > #!/usr/bin/env python
127 127 > import time
128 128 > time.sleep(1) # avoid unchanged-timestamp problems
129 129 > file('a/a', 'ab').write('edited\n')
130 130 > file('a/b', 'ab').write('edited\n')
131 131 > EOT
132 132
133 133 $ chmod +x 'diff tool.py'
134 134
135 135 will change to /tmp/extdiff.TMP and populate directories a.TMP and a
136 136 and start tool
137 137
138 138 $ hg extdiff -p "`pwd`/diff tool.py"
139 139 [1]
140 140
141 141 Diff in working directory, after:
142 142
143 143 $ hg diff --git
144 144 diff --git a/a b/a
145 145 --- a/a
146 146 +++ b/a
147 147 @@ -1,1 +1,2 @@
148 148 -a
149 149 +changed
150 150 +edited
151 151 diff --git a/b b/b
152 152 old mode 100644
153 153 new mode 100755
154 154 --- a/b
155 155 +++ b/b
156 156 @@ -1,1 +1,2 @@
157 157 -b
158 158 +changed
159 159 +edited
160 160
161 161 Test extdiff with --option:
162 162
163 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 165 [1]
166 166
167 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 169 [1]
170 170
171 171 Test with revsets:
172 172
173 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 175 [1]
176 176
177 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 179 [1]
General Comments 0
You need to be logged in to leave comments. Login now