##// END OF EJS Templates
patch: simplify externalpatch() arguments
Patrick Mezard -
r12673:9ad16d1b default
parent child Browse files
Show More
@@ -1169,11 +1169,12 b' def _applydiff(ui, fp, patcher, copyfn, '
1169 1169 return -1
1170 1170 return err
1171 1171
1172 def externalpatch(patcher, args, patchname, ui, strip, cwd, files):
1172 def externalpatch(patcher, patchname, ui, strip, cwd, files):
1173 1173 """use <patcher> to apply <patchname> to the working directory.
1174 1174 returns whether patch was applied with fuzz factor."""
1175 1175
1176 1176 fuzz = False
1177 args = []
1177 1178 if cwd:
1178 1179 args.append('-d %s' % util.shellquote(cwd))
1179 1180 fp = util.popen('%s %s -p%d < %s' % (patcher, ' '.join(args), strip,
@@ -1248,13 +1249,11 b' def patch(patchname, ui, strip=1, cwd=No'
1248 1249 Returns whether patch was applied with fuzz factor.
1249 1250 """
1250 1251 patcher = ui.config('ui', 'patch')
1251 args = []
1252 1252 if files is None:
1253 1253 files = {}
1254 1254 try:
1255 1255 if patcher:
1256 return externalpatch(patcher, args, patchname, ui, strip, cwd,
1257 files)
1256 return externalpatch(patcher, patchname, ui, strip, cwd, files)
1258 1257 return internalpatch(patchname, ui, strip, cwd, files, eolmode)
1259 1258 except PatchError, err:
1260 1259 s = str(err)
General Comments 0
You need to be logged in to leave comments. Login now