Show More
@@ -1529,6 +1529,8 b' def trydiff(repo, revs, ctx1, ctx2, modi' | |||
|
1529 | 1529 | yield text |
|
1530 | 1530 | |
|
1531 | 1531 | def diffstatdata(lines): |
|
1532 | diffre = re.compile('^diff .*-r [a-z0-9]+\s(.*)$') | |
|
1533 | ||
|
1532 | 1534 | filename, adds, removes = None, 0, 0 |
|
1533 | 1535 | for line in lines: |
|
1534 | 1536 | if line.startswith('diff'): |
@@ -1539,9 +1541,9 b' def diffstatdata(lines):' | |||
|
1539 | 1541 | adds, removes = 0, 0 |
|
1540 | 1542 | if line.startswith('diff --git'): |
|
1541 | 1543 | filename = gitre.search(line).group(1) |
|
1542 | else: | |
|
1544 | elif line.startswith('diff -r'): | |
|
1543 | 1545 | # format: "diff -r ... -r ... filename" |
|
1544 |
filename = line. |
|
|
1546 | filename = diffre.search(line).group(1) | |
|
1545 | 1547 | elif line.startswith('+') and not line.startswith('+++'): |
|
1546 | 1548 | adds += 1 |
|
1547 | 1549 | elif line.startswith('-') and not line.startswith('---'): |
@@ -46,3 +46,20 b' Binary git diffstat:' | |||
|
46 | 46 | b | Bin |
|
47 | 47 | 1 files changed, 0 insertions(+), 0 deletions(-) |
|
48 | 48 | |
|
49 | $ hg ci -m createb | |
|
50 | ||
|
51 | $ printf '\0' > "file with spaces" | |
|
52 | $ hg add "file with spaces" | |
|
53 | ||
|
54 | Filename with spaces diffstat: | |
|
55 | ||
|
56 | $ hg diff --stat | |
|
57 | file with spaces | 0 | |
|
58 | 1 files changed, 0 insertions(+), 0 deletions(-) | |
|
59 | ||
|
60 | Filename with spaces git diffstat: | |
|
61 | ||
|
62 | $ hg diff --stat --git | |
|
63 | file with spaces | Bin | |
|
64 | 1 files changed, 0 insertions(+), 0 deletions(-) | |
|
65 |
General Comments 0
You need to be logged in to leave comments.
Login now