##// END OF EJS Templates
diffstat: don't fail on merges...
Patrick Mezard -
r7664:3cc74ee7 default
parent child Browse files
Show More
@@ -1343,14 +1343,13 b" def export(repo, revs, template='hg-%h.p"
1343 single(rev, seqno+1, fp)
1343 single(rev, seqno+1, fp)
1344
1344
1345 def diffstatdata(lines):
1345 def diffstatdata(lines):
1346 filename = None
1346 filename, adds, removes = None, 0, 0
1347 for line in lines:
1347 for line in lines:
1348 if line.startswith('diff'):
1348 if line.startswith('diff'):
1349 if filename:
1349 if filename:
1350 yield (filename, adds, removes)
1350 yield (filename, adds, removes)
1351 # set numbers to 0 anyway when starting new file
1351 # set numbers to 0 anyway when starting new file
1352 adds = 0
1352 adds, removes = 0, 0
1353 removes = 0
1354 if line.startswith('diff --git'):
1353 if line.startswith('diff --git'):
1355 filename = gitre.search(line).group(1)
1354 filename = gitre.search(line).group(1)
1356 else:
1355 else:
@@ -1360,7 +1359,8 b' def diffstatdata(lines):'
1360 adds += 1
1359 adds += 1
1361 elif line.startswith('-') and not line.startswith('---'):
1360 elif line.startswith('-') and not line.startswith('---'):
1362 removes += 1
1361 removes += 1
1363 yield (filename, adds, removes)
1362 if filename:
1363 yield (filename, adds, removes)
1364
1364
1365 def diffstat(lines):
1365 def diffstat(lines):
1366 output = []
1366 output = []
@@ -84,3 +84,17 b' hg --cwd b rollback'
84 hg --traceback --cwd b pull ../a 2>&1 | sed -e 's/\(Message-Id:\).*/\1/' \
84 hg --traceback --cwd b pull ../a 2>&1 | sed -e 's/\(Message-Id:\).*/\1/' \
85 -e 's/changeset \([0-9a-f]*\) in .*/changeset \1/' \
85 -e 's/changeset \([0-9a-f]*\) in .*/changeset \1/' \
86 -e 's/^Date:.*/Date:/'
86 -e 's/^Date:.*/Date:/'
87
88 echo % test merge
89 cd a
90 hg up -C 0
91 echo a >> a
92 hg ci -Am adda2 -d '2 0'
93 hg merge
94 hg ci -m merge -d '3 0'
95 cd ..
96
97 hg --traceback --cwd b pull ../a 2>&1 | sed -e 's/\(Message-Id:\).*/\1/' \
98 -e 's/changeset \([0-9a-f]*\) in .*/changeset \1/' \
99 -e 's/^Date:.*/Date:/'
100
@@ -164,3 +164,56 b' diff -r cb9a9f314b8b -r 0647d048b600 a'
164 a
164 a
165 +a
165 +a
166 (run 'hg update' to get a working copy)
166 (run 'hg update' to get a working copy)
167 % test merge
168 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
169 created new head
170 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
171 (branch merge, don't forget to commit)
172 pulling from ../a
173 searching for changes
174 adding changesets
175 adding manifests
176 adding file changes
177 added 2 changesets with 0 changes to 1 files
178 Content-Type: text/plain; charset="us-ascii"
179 MIME-Version: 1.0
180 Content-Transfer-Encoding: 7bit
181 X-Test: foo
182 Date:
183 Subject: adda2
184 From: test@test.com
185 X-Hg-Notification: changeset 0a184ce6067f
186 Message-Id:
187 To: baz@test.com, foo@bar
188
189 changeset 0a184ce6067f
190 description:
191 adda2
192 diffstat:
193
194 a | 1 +
195 1 files changed, 1 insertions(+), 0 deletions(-)
196
197 diffs (6 lines):
198
199 diff -r cb9a9f314b8b -r 0a184ce6067f a
200 --- a/a Thu Jan 01 00:00:00 1970 +0000
201 +++ b/a Thu Jan 01 00:00:02 1970 +0000
202 @@ -1,1 +1,2 @@
203 a
204 +a
205 Content-Type: text/plain; charset="us-ascii"
206 MIME-Version: 1.0
207 Content-Transfer-Encoding: 7bit
208 X-Test: foo
209 Date:
210 Subject: merge
211 From: test@test.com
212 X-Hg-Notification: changeset 22c88b85aa27
213 Message-Id:
214 To: baz@test.com, foo@bar
215
216 changeset 22c88b85aa27
217 description:
218 merge
219 (run 'hg update' to get a working copy)
General Comments 0
You need to be logged in to leave comments. Login now