Show More
@@ -54,12 +54,6 b' def diffordiffstat(ui, repo, diffopts, n' | |||
|
54 | 54 | changes=None, stat=False, fp=None, prefix='', |
|
55 | 55 | root='', listsubrepos=False, hunksfilterfn=None): |
|
56 | 56 | '''show diff or diffstat.''' |
|
57 | if fp is None: | |
|
58 | write = ui.write | |
|
59 | else: | |
|
60 | def write(s, **kw): | |
|
61 | fp.write(s) | |
|
62 | ||
|
63 | 57 | if root: |
|
64 | 58 | relroot = pathutil.canonpath(repo.root, repo.getcwd(), root) |
|
65 | 59 | else: |
@@ -85,10 +79,11 b' def diffordiffstat(ui, repo, diffopts, n' | |||
|
85 | 79 | hunksfilterfn=hunksfilterfn) |
|
86 | 80 | |
|
87 | 81 | if fp is not None or ui.canwritewithoutlabels(): |
|
82 | out = fp or ui | |
|
88 | 83 | if stat: |
|
89 | 84 | chunks = patch.diffstat(util.iterlines(chunks), width=width) |
|
90 | 85 | for chunk in util.filechunkiter(util.chunkbuffer(chunks)): |
|
91 | write(chunk) | |
|
86 | out.write(chunk) | |
|
92 | 87 | else: |
|
93 | 88 | if stat: |
|
94 | 89 | chunks = patch.diffstatui(util.iterlines(chunks), width=width) |
@@ -100,10 +95,10 b' def diffordiffstat(ui, repo, diffopts, n' | |||
|
100 | 95 | for chunk, label in chunks: |
|
101 | 96 | yield ui.label(chunk, label=label) |
|
102 | 97 | for chunk in util.filechunkiter(util.chunkbuffer(gen())): |
|
103 | write(chunk) | |
|
98 | ui.write(chunk) | |
|
104 | 99 | else: |
|
105 | 100 | for chunk, label in chunks: |
|
106 | write(chunk, label=label) | |
|
101 | ui.write(chunk, label=label) | |
|
107 | 102 | |
|
108 | 103 | if listsubrepos: |
|
109 | 104 | ctx1 = repo[node1] |
General Comments 0
You need to be logged in to leave comments.
Login now