Commit 9a86cc67 authored by Russ Cox's avatar Russ Cox

codereview: do not gofmt deleted files

R=r
https://golang.org/cl/164083
parent aaa2374b
...@@ -622,6 +622,7 @@ def CheckGofmt(ui, repo, files, just_warn=False): ...@@ -622,6 +622,7 @@ def CheckGofmt(ui, repo, files, just_warn=False):
return return
cwd = os.getcwd() cwd = os.getcwd()
files = [RelativePath(repo.root + '/' + f, cwd) for f in files] files = [RelativePath(repo.root + '/' + f, cwd) for f in files]
files = [f for f in files if os.access(f, 0)]
try: try:
cmd = subprocess.Popen(["gofmt", "-l"] + files, shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True) cmd = subprocess.Popen(["gofmt", "-l"] + files, shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)
cmd.stdin.close() cmd.stdin.close()
......
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