Commit 8035cbd9 authored by Russ Cox's avatar Russ Cox

codereview: use hgapplydiff instead of hgpatch

Depends on https://golang.org/cl/7308067

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7312064
parent 18441e8a
...@@ -1569,24 +1569,24 @@ def clpatch_or_undo(ui, repo, clname, opts, mode): ...@@ -1569,24 +1569,24 @@ def clpatch_or_undo(ui, repo, clname, opts, mode):
return "local repository is out of date; sync to get %s" % (vers) return "local repository is out of date; sync to get %s" % (vers)
patch1, err = portPatch(repo, patch, vers, id) patch1, err = portPatch(repo, patch, vers, id)
if err != "": if err != "":
if not opts["ignore_hgpatch_failure"]: if not opts["ignore_hgapplydiff_failure"]:
return "codereview issue %s is out of date: %s (%s->%s)" % (clname, err, vers, id) return "codereview issue %s is out of date: %s (%s->%s)" % (clname, err, vers, id)
else: else:
patch = patch1 patch = patch1
argv = ["hgpatch"] argv = ["hgapplydiff"]
if opts["no_incoming"] or mode == "backport": if opts["no_incoming"] or mode == "backport":
argv += ["--checksync=false"] argv += ["--checksync=false"]
try: try:
cmd = subprocess.Popen(argv, shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=None, close_fds=sys.platform != "win32") cmd = subprocess.Popen(argv, shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=None, close_fds=sys.platform != "win32")
except: except:
return "hgpatch: " + ExceptionDetail() + "\nInstall hgpatch with:\n$ go get code.google.com/p/go.codereview/cmd/hgpatch\n" return "hgapplydiff: " + ExceptionDetail() + "\nInstall hgapplydiff with:\n$ go get code.google.com/p/go.codereview/cmd/hgapplydiff\n"
out, err = cmd.communicate(patch) out, err = cmd.communicate(patch)
if cmd.returncode != 0 and not opts["ignore_hgpatch_failure"]: if cmd.returncode != 0 and not opts["ignore_hgapplydiff_failure"]:
return "hgpatch failed" return "hgapplydiff failed"
cl.local = True cl.local = True
cl.files = out.strip().split() cl.files = out.strip().split()
if not cl.files and not opts["ignore_hgpatch_failure"]: if not cl.files and not opts["ignore_hgapplydiff_failure"]:
return "codereview issue %s has no changed files" % clname return "codereview issue %s has no changed files" % clname
files = ChangedFiles(ui, repo, []) files = ChangedFiles(ui, repo, [])
extra = Sub(cl.files, files) extra = Sub(cl.files, files)
...@@ -2099,7 +2099,7 @@ cmdtable = { ...@@ -2099,7 +2099,7 @@ cmdtable = {
"^clpatch": ( "^clpatch": (
clpatch, clpatch,
[ [
('', 'ignore_hgpatch_failure', None, 'create CL metadata even if hgpatch fails'), ('', 'ignore_hgapplydiff_failure', None, 'create CL metadata even if hgapplydiff fails'),
('', 'no_incoming', None, 'disable check for incoming changes'), ('', 'no_incoming', None, 'disable check for incoming changes'),
], ],
"change#" "change#"
...@@ -2158,7 +2158,7 @@ cmdtable = { ...@@ -2158,7 +2158,7 @@ cmdtable = {
"^release-apply": ( "^release-apply": (
release_apply, release_apply,
[ [
('', 'ignore_hgpatch_failure', None, 'create CL metadata even if hgpatch fails'), ('', 'ignore_hgapplydiff_failure', None, 'create CL metadata even if hgapplydiff fails'),
('', 'no_incoming', None, 'disable check for incoming changes'), ('', 'no_incoming', None, 'disable check for incoming changes'),
], ],
"change#" "change#"
...@@ -2181,7 +2181,7 @@ cmdtable = { ...@@ -2181,7 +2181,7 @@ cmdtable = {
"^undo": ( "^undo": (
undo, undo,
[ [
('', 'ignore_hgpatch_failure', None, 'create CL metadata even if hgpatch fails'), ('', 'ignore_hgapplydiff_failure', None, 'create CL metadata even if hgapplydiff fails'),
('', 'no_incoming', None, 'disable check for incoming changes'), ('', 'no_incoming', None, 'disable check for incoming changes'),
], ],
"change#" "change#"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment