##// END OF EJS Templates
patch: always raise PatchError with a message, simplify handling
Patrick Mezard -
r12674:aa2fe1f5 default
parent child Browse files
Show More
@@ -499,11 +499,7 def dorecord(ui, repo, commitfunc, *pats
499 499 eolmode=None)
500 500 cmdutil.updatedir(ui, repo, pfiles)
501 501 except patch.PatchError, err:
502 s = str(err)
503 if s:
504 raise util.Abort(s)
505 else:
506 raise util.Abort(_('patch failed to apply'))
502 raise util.Abort(str(err))
507 503 del fp
508 504
509 505 # 4. We prepared working directory according to filtered patch.
@@ -1233,7 +1233,7 def internalpatch(patchobj, ui, strip, c
1233 1233 if fp != patchobj:
1234 1234 fp.close()
1235 1235 if ret < 0:
1236 raise PatchError
1236 raise PatchError(_('patch failed to apply'))
1237 1237 return ret > 0
1238 1238
1239 1239 def patch(patchname, ui, strip=1, cwd=None, files=None, eolmode='strict'):
@@ -1256,11 +1256,7 def patch(patchname, ui, strip=1, cwd=No
1256 1256 return externalpatch(patcher, patchname, ui, strip, cwd, files)
1257 1257 return internalpatch(patchname, ui, strip, cwd, files, eolmode)
1258 1258 except PatchError, err:
1259 s = str(err)
1260 if s:
1261 raise util.Abort(s)
1262 else:
1263 raise util.Abort(_('patch failed to apply'))
1259 raise util.Abort(str(err))
1264 1260
1265 1261 def b85diff(to, tn):
1266 1262 '''print base85-encoded binary diff'''
General Comments 0
You need to be logged in to leave comments. Login now