##// END OF EJS Templates
patch: use scmutil.marktouched instead of scmutil.addremove...
Siddharth Agarwal -
r19155:0b3689a0 default
parent child Browse files
Show More
@@ -481,7 +481,7 b' class workingbackend(fsbackend):'
481
481
482 def close(self):
482 def close(self):
483 wctx = self.repo[None]
483 wctx = self.repo[None]
484 addremoved = set(self.changed)
484 changed = set(self.changed)
485 for src, dst in self.copied:
485 for src, dst in self.copied:
486 scmutil.dirstatecopy(self.ui, self.repo, wctx, src, dst)
486 scmutil.dirstatecopy(self.ui, self.repo, wctx, src, dst)
487 if self.removed:
487 if self.removed:
@@ -491,14 +491,10 b' class workingbackend(fsbackend):'
491 # File was deleted and no longer belongs to the
491 # File was deleted and no longer belongs to the
492 # dirstate, it was probably marked added then
492 # dirstate, it was probably marked added then
493 # deleted, and should not be considered by
493 # deleted, and should not be considered by
494 # addremove().
494 # marktouched().
495 addremoved.discard(f)
495 changed.discard(f)
496 if addremoved:
496 if changed:
497 cwd = self.repo.getcwd()
497 scmutil.marktouched(self.repo, changed, self.similarity)
498 if cwd:
499 addremoved = [util.pathto(self.repo.root, cwd, f)
500 for f in addremoved]
501 scmutil.addremove(self.repo, addremoved, similarity=self.similarity)
502 return sorted(self.changed)
498 return sorted(self.changed)
503
499
504 class filestore(object):
500 class filestore(object):
@@ -1397,12 +1393,7 b' def _externalpatch(ui, repo, patcher, pa'
1397 ui.warn(line + '\n')
1393 ui.warn(line + '\n')
1398 finally:
1394 finally:
1399 if files:
1395 if files:
1400 cfiles = list(files)
1396 scmutil.marktouched(repo, files, similarity)
1401 cwd = repo.getcwd()
1402 if cwd:
1403 cfiles = [util.pathto(repo.root, cwd, f)
1404 for f in cfiles]
1405 scmutil.addremove(repo, cfiles, similarity=similarity)
1406 code = fp.close()
1397 code = fp.close()
1407 if code:
1398 if code:
1408 raise PatchError(_("patch command failed: %s") %
1399 raise PatchError(_("patch command failed: %s") %
General Comments 0
You need to be logged in to leave comments. Login now