@@ -334,7 +334,7 @@ def entryDeleted(key, value):
334
334
335
335
# Sends a mail for a notification consistent of two parts: (1) the output of a
336
336
# show command, and (2) the output of a diff command.
337
- def sendChangeMail (rev , subject , heads , show_cmd , diff_cmd ):
337
+ def sendChangeMail (rev , subject , heads , show_cmd , diff_cmd , stat_cmd ):
338
338
339
339
(out , fname ) = generateMailHeader (subject )
340
340
@@ -365,8 +365,10 @@ def sendChangeMail(rev, subject, heads, show_cmd, diff_cmd):
365
365
size = os .path .getsize (tname )
366
366
367
367
if size > Config .maxdiffsize :
368
+ (tmp , tname ) = makeTmp ()
369
+ diff = git (stat_cmd , stdout_to = tmp )
370
+ tmp .close ()
368
371
footer = "\n Diff suppressed because of size. To see it, use:\n \n git %s" % diff_cmd
369
- tname = None
370
372
371
373
print >> out , Separator
372
374
@@ -388,6 +390,7 @@ def sendChangeMail(rev, subject, heads, show_cmd, diff_cmd):
388
390
print >> out , "-- "
389
391
print >> out , "debug: show_cmd = git %s" % show_cmd
390
392
print >> out , "debug: diff_cmd = git %s" % diff_cmd
393
+ print >> out , "debug: stat_cmd = git %s" % stat_cmd
391
394
392
395
sendMail (out , fname )
393
396
@@ -416,8 +419,9 @@ def commit(current, rev, force=False, subject_head=None):
416
419
417
420
show_cmd = "show -s --no-color --find-copies-harder --pretty=medium %s" % rev
418
421
diff_cmd = "diff-tree --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol %s %s" % (merge_diff , rev )
422
+ stat_cmd = "diff --stat --no-color --find-copies-harder --ignore-space-at-eol ^%s~1 %s " % (rev , rev )
419
423
420
- sendChangeMail (rev , subject , heads , show_cmd , diff_cmd )
424
+ sendChangeMail (rev , subject , heads , show_cmd , diff_cmd , stat_cmd )
421
425
422
426
# Sends a diff between two revisions.
423
427
#
@@ -438,8 +442,9 @@ def diff(head, first, last):
438
442
439
443
show_cmd = "show -s --no-color --find-copies-harder --pretty=medium %s" % last
440
444
diff_cmd = "diff --patch-with-stat -m --no-color --find-copies-harder --ignore-space-at-eol %s %s" % (first , last )
445
+ stat_cmd = "diff --stat -m --no-color --find-copies-harder --ignore-space-at-eol %s %s" % (first , last )
441
446
442
- sendChangeMail (last , subject , heads , show_cmd , diff_cmd )
447
+ sendChangeMail (last , subject , heads , show_cmd , diff_cmd , stat_cmd )
443
448
444
449
# Sends pair-wise diffs for a path of revisions. Also records all revision on
445
450
# the path as seen.
0 commit comments