equal
deleted
inserted
replaced
40 util, |
40 util, |
41 vfs as vfsmod, |
41 vfs as vfsmod, |
42 ) |
42 ) |
43 from .utils import ( |
43 from .utils import ( |
44 dateutil, |
44 dateutil, |
|
45 procutil, |
45 stringutil, |
46 stringutil, |
46 ) |
47 ) |
47 |
48 |
48 diffhelpers = policy.importmod(r'diffhelpers') |
49 diffhelpers = policy.importmod(r'diffhelpers') |
49 stringio = util.stringio |
50 stringio = util.stringio |
2098 |
2099 |
2099 fuzz = False |
2100 fuzz = False |
2100 args = [] |
2101 args = [] |
2101 cwd = repo.root |
2102 cwd = repo.root |
2102 if cwd: |
2103 if cwd: |
2103 args.append('-d %s' % util.shellquote(cwd)) |
2104 args.append('-d %s' % procutil.shellquote(cwd)) |
2104 fp = util.popen('%s %s -p%d < %s' % (patcher, ' '.join(args), strip, |
2105 fp = procutil.popen('%s %s -p%d < %s' % (patcher, ' '.join(args), strip, |
2105 util.shellquote(patchname))) |
2106 procutil.shellquote(patchname))) |
2106 try: |
2107 try: |
2107 for line in util.iterfile(fp): |
2108 for line in util.iterfile(fp): |
2108 line = line.rstrip() |
2109 line = line.rstrip() |
2109 ui.note(line + '\n') |
2110 ui.note(line + '\n') |
2110 if line.startswith('patching file '): |
2111 if line.startswith('patching file '): |
2128 if files: |
2129 if files: |
2129 scmutil.marktouched(repo, files, similarity) |
2130 scmutil.marktouched(repo, files, similarity) |
2130 code = fp.close() |
2131 code = fp.close() |
2131 if code: |
2132 if code: |
2132 raise PatchError(_("patch command failed: %s") % |
2133 raise PatchError(_("patch command failed: %s") % |
2133 util.explainexit(code)[0]) |
2134 procutil.explainexit(code)[0]) |
2134 return fuzz |
2135 return fuzz |
2135 |
2136 |
2136 def patchbackend(ui, backend, patchobj, strip, prefix, files=None, |
2137 def patchbackend(ui, backend, patchobj, strip, prefix, files=None, |
2137 eolmode='strict'): |
2138 eolmode='strict'): |
2138 if files is None: |
2139 if files is None: |