##// END OF EJS Templates
py3: suppress the output of open() using `and None`...
Pulkit Goyal -
r37385:87c4253b default
parent child Browse files
Show More
@@ -1,238 +1,238 b''
1 $ hg init repo
1 $ hg init repo
2 $ cd repo
2 $ cd repo
3 $ i=0; while [ "$i" -lt 213 ]; do echo a >> a; i=`expr $i + 1`; done
3 $ i=0; while [ "$i" -lt 213 ]; do echo a >> a; i=`expr $i + 1`; done
4 $ hg add a
4 $ hg add a
5 $ cp a b
5 $ cp a b
6 $ hg add b
6 $ hg add b
7
7
8 Wide diffstat:
8 Wide diffstat:
9
9
10 $ hg diff --stat
10 $ hg diff --stat
11 a | 213 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
11 a | 213 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
12 b | 213 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
12 b | 213 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
13 2 files changed, 426 insertions(+), 0 deletions(-)
13 2 files changed, 426 insertions(+), 0 deletions(-)
14
14
15 diffstat width:
15 diffstat width:
16
16
17 $ COLUMNS=24 hg diff --config ui.interactive=true --stat
17 $ COLUMNS=24 hg diff --config ui.interactive=true --stat
18 a | 213 ++++++++++++++
18 a | 213 ++++++++++++++
19 b | 213 ++++++++++++++
19 b | 213 ++++++++++++++
20 2 files changed, 426 insertions(+), 0 deletions(-)
20 2 files changed, 426 insertions(+), 0 deletions(-)
21
21
22 $ hg ci -m adda
22 $ hg ci -m adda
23
23
24 $ cat >> a <<EOF
24 $ cat >> a <<EOF
25 > a
25 > a
26 > a
26 > a
27 > a
27 > a
28 > EOF
28 > EOF
29
29
30 Narrow diffstat:
30 Narrow diffstat:
31
31
32 $ hg diff --stat
32 $ hg diff --stat
33 a | 3 +++
33 a | 3 +++
34 1 files changed, 3 insertions(+), 0 deletions(-)
34 1 files changed, 3 insertions(+), 0 deletions(-)
35
35
36 $ hg ci -m appenda
36 $ hg ci -m appenda
37
37
38 >>> open("c", "wb").write(b"\0")
38 >>> open("c", "wb").write(b"\0") and None
39 $ touch d
39 $ touch d
40 $ hg add c d
40 $ hg add c d
41
41
42 Binary diffstat:
42 Binary diffstat:
43
43
44 $ hg diff --stat
44 $ hg diff --stat
45 c | Bin
45 c | Bin
46 1 files changed, 0 insertions(+), 0 deletions(-)
46 1 files changed, 0 insertions(+), 0 deletions(-)
47
47
48 Binary git diffstat:
48 Binary git diffstat:
49
49
50 $ hg diff --stat --git
50 $ hg diff --stat --git
51 c | Bin
51 c | Bin
52 d | 0
52 d | 0
53 2 files changed, 0 insertions(+), 0 deletions(-)
53 2 files changed, 0 insertions(+), 0 deletions(-)
54
54
55 $ hg ci -m createb
55 $ hg ci -m createb
56
56
57 >>> open("file with spaces", "wb").write(b"\0")
57 >>> open("file with spaces", "wb").write(b"\0") and None
58 $ hg add "file with spaces"
58 $ hg add "file with spaces"
59
59
60 Filename with spaces diffstat:
60 Filename with spaces diffstat:
61
61
62 $ hg diff --stat
62 $ hg diff --stat
63 file with spaces | Bin
63 file with spaces | Bin
64 1 files changed, 0 insertions(+), 0 deletions(-)
64 1 files changed, 0 insertions(+), 0 deletions(-)
65
65
66 Filename with spaces git diffstat:
66 Filename with spaces git diffstat:
67
67
68 $ hg diff --stat --git
68 $ hg diff --stat --git
69 file with spaces | Bin
69 file with spaces | Bin
70 1 files changed, 0 insertions(+), 0 deletions(-)
70 1 files changed, 0 insertions(+), 0 deletions(-)
71
71
72 Filename without "a/" or "b/" (issue5759):
72 Filename without "a/" or "b/" (issue5759):
73
73
74 $ hg diff --config 'diff.noprefix=1' -c1 --stat --git
74 $ hg diff --config 'diff.noprefix=1' -c1 --stat --git
75 a | 3 +++
75 a | 3 +++
76 1 files changed, 3 insertions(+), 0 deletions(-)
76 1 files changed, 3 insertions(+), 0 deletions(-)
77 $ hg diff --config 'diff.noprefix=1' -c2 --stat --git
77 $ hg diff --config 'diff.noprefix=1' -c2 --stat --git
78 c | Bin
78 c | Bin
79 d | 0
79 d | 0
80 2 files changed, 0 insertions(+), 0 deletions(-)
80 2 files changed, 0 insertions(+), 0 deletions(-)
81
81
82 $ hg log --config 'diff.noprefix=1' -r '1:' -p --stat --git
82 $ hg log --config 'diff.noprefix=1' -r '1:' -p --stat --git
83 changeset: 1:3a95b07bb77f
83 changeset: 1:3a95b07bb77f
84 user: test
84 user: test
85 date: Thu Jan 01 00:00:00 1970 +0000
85 date: Thu Jan 01 00:00:00 1970 +0000
86 summary: appenda
86 summary: appenda
87
87
88 a | 3 +++
88 a | 3 +++
89 1 files changed, 3 insertions(+), 0 deletions(-)
89 1 files changed, 3 insertions(+), 0 deletions(-)
90
90
91 diff --git a a
91 diff --git a a
92 --- a
92 --- a
93 +++ a
93 +++ a
94 @@ -211,3 +211,6 @@
94 @@ -211,3 +211,6 @@
95 a
95 a
96 a
96 a
97 a
97 a
98 +a
98 +a
99 +a
99 +a
100 +a
100 +a
101
101
102 changeset: 2:c60a6c753773
102 changeset: 2:c60a6c753773
103 tag: tip
103 tag: tip
104 user: test
104 user: test
105 date: Thu Jan 01 00:00:00 1970 +0000
105 date: Thu Jan 01 00:00:00 1970 +0000
106 summary: createb
106 summary: createb
107
107
108 c | Bin
108 c | Bin
109 d | 0
109 d | 0
110 2 files changed, 0 insertions(+), 0 deletions(-)
110 2 files changed, 0 insertions(+), 0 deletions(-)
111
111
112 diff --git c c
112 diff --git c c
113 new file mode 100644
113 new file mode 100644
114 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f76dd238ade08917e6712764a16a22005a50573d
114 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f76dd238ade08917e6712764a16a22005a50573d
115 GIT binary patch
115 GIT binary patch
116 literal 1
116 literal 1
117 Ic${MZ000310RR91
117 Ic${MZ000310RR91
118
118
119 diff --git d d
119 diff --git d d
120 new file mode 100644
120 new file mode 100644
121
121
122
122
123 diffstat within directories:
123 diffstat within directories:
124
124
125 $ hg rm -f 'file with spaces'
125 $ hg rm -f 'file with spaces'
126
126
127 $ mkdir dir1 dir2
127 $ mkdir dir1 dir2
128 $ echo new1 > dir1/new
128 $ echo new1 > dir1/new
129 $ echo new2 > dir2/new
129 $ echo new2 > dir2/new
130 $ hg add dir1/new dir2/new
130 $ hg add dir1/new dir2/new
131 $ hg diff --stat
131 $ hg diff --stat
132 dir1/new | 1 +
132 dir1/new | 1 +
133 dir2/new | 1 +
133 dir2/new | 1 +
134 2 files changed, 2 insertions(+), 0 deletions(-)
134 2 files changed, 2 insertions(+), 0 deletions(-)
135
135
136 $ hg diff --stat --root dir1
136 $ hg diff --stat --root dir1
137 new | 1 +
137 new | 1 +
138 1 files changed, 1 insertions(+), 0 deletions(-)
138 1 files changed, 1 insertions(+), 0 deletions(-)
139
139
140 $ hg diff --stat --root dir1 dir2
140 $ hg diff --stat --root dir1 dir2
141 warning: dir2 not inside relative root dir1
141 warning: dir2 not inside relative root dir1
142
142
143 $ hg diff --stat --root dir1 -I dir1/old
143 $ hg diff --stat --root dir1 -I dir1/old
144
144
145 $ cd dir1
145 $ cd dir1
146 $ hg diff --stat .
146 $ hg diff --stat .
147 dir1/new | 1 +
147 dir1/new | 1 +
148 1 files changed, 1 insertions(+), 0 deletions(-)
148 1 files changed, 1 insertions(+), 0 deletions(-)
149 $ hg diff --stat --root .
149 $ hg diff --stat --root .
150 new | 1 +
150 new | 1 +
151 1 files changed, 1 insertions(+), 0 deletions(-)
151 1 files changed, 1 insertions(+), 0 deletions(-)
152
152
153 $ hg diff --stat --root ../dir1 ../dir2
153 $ hg diff --stat --root ../dir1 ../dir2
154 warning: ../dir2 not inside relative root .
154 warning: ../dir2 not inside relative root .
155
155
156 $ hg diff --stat --root . -I old
156 $ hg diff --stat --root . -I old
157
157
158 $ cd ..
158 $ cd ..
159
159
160 Files with lines beginning with '--' or '++' should be properly counted in diffstat
160 Files with lines beginning with '--' or '++' should be properly counted in diffstat
161
161
162 $ hg up -Cr tip
162 $ hg up -Cr tip
163 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
163 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
164 $ rm dir1/new
164 $ rm dir1/new
165 $ rm dir2/new
165 $ rm dir2/new
166 $ rm "file with spaces"
166 $ rm "file with spaces"
167 $ cat > file << EOF
167 $ cat > file << EOF
168 > line 1
168 > line 1
169 > line 2
169 > line 2
170 > line 3
170 > line 3
171 > EOF
171 > EOF
172 $ hg commit -Am file
172 $ hg commit -Am file
173 adding file
173 adding file
174
174
175 Lines added starting with '--' should count as additions
175 Lines added starting with '--' should count as additions
176 $ cat > file << EOF
176 $ cat > file << EOF
177 > line 1
177 > line 1
178 > -- line 2, with dashes
178 > -- line 2, with dashes
179 > line 3
179 > line 3
180 > EOF
180 > EOF
181
181
182 $ hg diff --root .
182 $ hg diff --root .
183 diff -r be1569354b24 file
183 diff -r be1569354b24 file
184 --- a/file Thu Jan 01 00:00:00 1970 +0000
184 --- a/file Thu Jan 01 00:00:00 1970 +0000
185 +++ b/file * (glob)
185 +++ b/file * (glob)
186 @@ -1,3 +1,3 @@
186 @@ -1,3 +1,3 @@
187 line 1
187 line 1
188 -line 2
188 -line 2
189 +-- line 2, with dashes
189 +-- line 2, with dashes
190 line 3
190 line 3
191
191
192 $ hg diff --root . --stat
192 $ hg diff --root . --stat
193 file | 2 +-
193 file | 2 +-
194 1 files changed, 1 insertions(+), 1 deletions(-)
194 1 files changed, 1 insertions(+), 1 deletions(-)
195
195
196 Lines changed starting with '--' should count as deletions
196 Lines changed starting with '--' should count as deletions
197 $ hg commit -m filev2
197 $ hg commit -m filev2
198 $ cat > file << EOF
198 $ cat > file << EOF
199 > line 1
199 > line 1
200 > -- line 2, with dashes, changed again
200 > -- line 2, with dashes, changed again
201 > line 3
201 > line 3
202 > EOF
202 > EOF
203
203
204 $ hg diff --root .
204 $ hg diff --root .
205 diff -r 160f7c034df6 file
205 diff -r 160f7c034df6 file
206 --- a/file Thu Jan 01 00:00:00 1970 +0000
206 --- a/file Thu Jan 01 00:00:00 1970 +0000
207 +++ b/file * (glob)
207 +++ b/file * (glob)
208 @@ -1,3 +1,3 @@
208 @@ -1,3 +1,3 @@
209 line 1
209 line 1
210 --- line 2, with dashes
210 --- line 2, with dashes
211 +-- line 2, with dashes, changed again
211 +-- line 2, with dashes, changed again
212 line 3
212 line 3
213
213
214 $ hg diff --root . --stat
214 $ hg diff --root . --stat
215 file | 2 +-
215 file | 2 +-
216 1 files changed, 1 insertions(+), 1 deletions(-)
216 1 files changed, 1 insertions(+), 1 deletions(-)
217
217
218 Lines changed starting with '--' should count as deletions
218 Lines changed starting with '--' should count as deletions
219 and starting with '++' should count as additions
219 and starting with '++' should count as additions
220 $ cat > file << EOF
220 $ cat > file << EOF
221 > line 1
221 > line 1
222 > ++ line 2, switched dashes to plusses
222 > ++ line 2, switched dashes to plusses
223 > line 3
223 > line 3
224 > EOF
224 > EOF
225
225
226 $ hg diff --root .
226 $ hg diff --root .
227 diff -r 160f7c034df6 file
227 diff -r 160f7c034df6 file
228 --- a/file Thu Jan 01 00:00:00 1970 +0000
228 --- a/file Thu Jan 01 00:00:00 1970 +0000
229 +++ b/file * (glob)
229 +++ b/file * (glob)
230 @@ -1,3 +1,3 @@
230 @@ -1,3 +1,3 @@
231 line 1
231 line 1
232 --- line 2, with dashes
232 --- line 2, with dashes
233 +++ line 2, switched dashes to plusses
233 +++ line 2, switched dashes to plusses
234 line 3
234 line 3
235
235
236 $ hg diff --root . --stat
236 $ hg diff --root . --stat
237 file | 2 +-
237 file | 2 +-
238 1 files changed, 1 insertions(+), 1 deletions(-)
238 1 files changed, 1 insertions(+), 1 deletions(-)
General Comments 0
You need to be logged in to leave comments. Login now