Commit 757f64a89ba5bb04661b3f43444ca57fa6db1132
1 parent
75b3c3aa84
Exists in
v2017.01-smarct4x
and in
40 other branches
patman: Deal with 'git apply' failures correctly
This sort of failure is rare, but the code to deal with it is wrong. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
Showing 1 changed file with 4 additions and 2 deletions Side-by-side Diff
tools/patman/gitutil.py
... | ... | @@ -11,6 +11,7 @@ |
11 | 11 | import sys |
12 | 12 | import terminal |
13 | 13 | |
14 | +import checkpatch | |
14 | 15 | import settings |
15 | 16 | |
16 | 17 | |
... | ... | @@ -193,6 +194,7 @@ |
193 | 194 | Args: |
194 | 195 | fname: filename of patch file to apply |
195 | 196 | """ |
197 | + col = terminal.Color() | |
196 | 198 | cmd = ['git', 'am', fname] |
197 | 199 | pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, |
198 | 200 | stderr=subprocess.PIPE) |
... | ... | @@ -203,8 +205,8 @@ |
203 | 205 | print line |
204 | 206 | match = re_error.match(line) |
205 | 207 | if match: |
206 | - print GetWarningMsg('warning', match.group(1), int(match.group(2)), | |
207 | - 'Patch failed') | |
208 | + print checkpatch.GetWarningMsg(col, 'warning', match.group(1), | |
209 | + int(match.group(2)), 'Patch failed') | |
208 | 210 | return pipe.returncode == 0, stdout |
209 | 211 | |
210 | 212 | def ApplyPatches(verbose, args, start_point): |