mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-01-02 16:14:25 +00:00
Make repo's editor work when the editor is a commandline with
multiple args.
This commit is contained in:
parent
34d237fbfb
commit
8c6eef4713
@ -69,14 +69,14 @@ least one of these before using this command."""
|
|||||||
Returns:
|
Returns:
|
||||||
new value of edited text; None if editing did not succeed
|
new value of edited text; None if editing did not succeed
|
||||||
"""
|
"""
|
||||||
editor = cls._GetEditor()
|
editor = cls._GetEditor().split()
|
||||||
fd, path = tempfile.mkstemp()
|
fd, path = tempfile.mkstemp()
|
||||||
try:
|
try:
|
||||||
os.write(fd, data)
|
os.write(fd, data)
|
||||||
os.close(fd)
|
os.close(fd)
|
||||||
fd = None
|
fd = None
|
||||||
|
|
||||||
if subprocess.Popen([editor, path]).wait() != 0:
|
if subprocess.Popen(editor + [path]).wait() != 0:
|
||||||
raise EditorError()
|
raise EditorError()
|
||||||
return open(path).read()
|
return open(path).read()
|
||||||
finally:
|
finally:
|
||||||
|
Loading…
Reference in New Issue
Block a user