##// END OF EJS Templates
patch: turn patch() touched files dict into a set
Patrick Mezard -
r14564:65f4512e default
parent child Browse files
Show More
@@ -617,7 +617,7 b' class queue(object):'
617 617 def patch(self, repo, patchfile):
618 618 '''Apply patchfile to the working directory.
619 619 patchfile: name of patch file'''
620 files = {}
620 files = set()
621 621 try:
622 622 fuzz = patchmod.patch(self.ui, repo, patchfile, strip=1,
623 623 files=files, eolmode=None)
@@ -227,7 +227,7 b' class transplanter(object):'
227 227 raise util.Abort(_('can only omit patchfile if merging'))
228 228 if patchfile:
229 229 try:
230 files = {}
230 files = set()
231 231 patch.patch(self.ui, repo, patchfile, files=files, eolmode=None)
232 232 files = list(files)
233 233 if not files:
@@ -3106,7 +3106,7 b' def import_(ui, repo, patch1, *patches, '
3106 3106 if opts.get('exact') or opts.get('import_branch'):
3107 3107 repo.dirstate.setbranch(branch or 'default')
3108 3108
3109 files = {}
3109 files = set()
3110 3110 patch.patch(ui, repo, tmpname, strip=strip, files=files,
3111 3111 eolmode=None, similarity=sim / 100.0)
3112 3112 files = list(files)
@@ -1223,7 +1223,7 b' def _applydiff(ui, fp, patcher, backend,'
1223 1223 continue
1224 1224 ret = current_file.apply(values)
1225 1225 if ret >= 0:
1226 changed.setdefault(current_file.fname, None)
1226 changed.add(current_file.fname)
1227 1227 if ret > 0:
1228 1228 err = 1
1229 1229 elif state == 'file':
@@ -1236,7 +1236,7 b' def _applydiff(ui, fp, patcher, backend,'
1236 1236 path = pstrip(gp.path)
1237 1237 if gp.oldpath:
1238 1238 copysource = pstrip(gp.oldpath)
1239 changed[path] = gp
1239 changed.add(path)
1240 1240 if gp.op == 'RENAME':
1241 1241 backend.unlink(copysource)
1242 1242 if not first_hunk:
@@ -1306,7 +1306,7 b' def _externalpatch(ui, repo, patcher, pa'
1306 1306 if line.startswith('patching file '):
1307 1307 pf = util.parsepatchoutput(line)
1308 1308 printed_file = False
1309 files.setdefault(pf, None)
1309 files.add(pf)
1310 1310 elif line.find('with fuzz') >= 0:
1311 1311 fuzz = True
1312 1312 if not printed_file:
@@ -1340,7 +1340,7 b' def internalpatch(ui, repo, patchobj, st'
1340 1340 returns whether patch was applied with fuzz factor."""
1341 1341
1342 1342 if files is None:
1343 files = {}
1343 files = set()
1344 1344 if eolmode is None:
1345 1345 eolmode = ui.config('patch', 'eol', 'strict')
1346 1346 if eolmode.lower() not in eolmodes:
@@ -1359,7 +1359,7 b' def internalpatch(ui, repo, patchobj, st'
1359 1359 finally:
1360 1360 if fp != patchobj:
1361 1361 fp.close()
1362 files.update(dict.fromkeys(backend.close()))
1362 files.update(backend.close())
1363 1363 store.close()
1364 1364 if ret < 0:
1365 1365 raise PatchError(_('patch failed to apply'))
@@ -1380,7 +1380,7 b' def patch(ui, repo, patchname, strip=1, '
1380 1380 """
1381 1381 patcher = ui.config('ui', 'patch')
1382 1382 if files is None:
1383 files = {}
1383 files = set()
1384 1384 try:
1385 1385 if patcher:
1386 1386 return _externalpatch(ui, repo, patcher, patchname, strip,
General Comments 0
You need to be logged in to leave comments. Login now