Mercurial > public > mercurial-scm > hg-stable
diff mercurial/util.py @ 2865:71e78f2ca5ae
merge git patch code.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Sat, 12 Aug 2006 12:47:18 -0700 |
parents | 345bac2bc4ec 0f08f2c042ec |
children | c2932ad5476a |
line wrap: on
line diff
--- a/mercurial/util.py Sat Aug 12 12:30:02 2006 -0700 +++ b/mercurial/util.py Sat Aug 12 12:47:18 2006 -0700 @@ -95,27 +95,6 @@ return p_name return default -def patch(strip, patchname, ui, cwd=None): - """apply the patch <patchname> to the working directory. - a list of patched files is returned""" - patcher = find_in_path('gpatch', os.environ.get('PATH', ''), 'patch') - args = [] - if cwd: - args.append('-d %s' % shellquote(cwd)) - fp = os.popen('%s %s -p%d < %s' % (patcher, ' '.join(args), strip, - shellquote(patchname))) - files = {} - for line in fp: - line = line.rstrip() - ui.status("%s\n" % line) - if line.startswith('patching file '): - pf = parse_patch_output(line) - files.setdefault(pf, 1) - code = fp.close() - if code: - raise Abort(_("patch command failed: %s") % explain_exit(code)[0]) - return files.keys() - def binary(s): """return true if a string is binary data using diff's heuristic""" if s and '\0' in s[:4096]: