Commit 68f27462 authored by thomasvl@chromium.org's avatar thomasvl@chromium.org

Better revert

BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6690012

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@78029 0039d316-1c4b-4281-b951-d872f2087c98
parent ca7953a5
...@@ -711,20 +711,18 @@ def UserEditedLog(starting_text): ...@@ -711,20 +711,18 @@ def UserEditedLog(starting_text):
fileobj.close() fileobj.close()
# Open up the default editor in the system to get the CL description. # Open up the default editor in the system to get the CL description.
result = None ret = subprocess.call(editor + ' ' + filename, shell=True)
try: if ret != 0:
subprocess.check_call(['env', editor, filename], shell=True)
fileobj = open(filename)
result = fileobj.read()
fileobj.close()
finally:
os.remove(filename) os.remove(filename)
if not result:
return return
fileobj = open(filename)
text = fileobj.read()
fileobj.close()
os.remove(filename)
stripcomment_re = re.compile(r'^#.*$', re.MULTILINE) stripcomment_re = re.compile(r'^#.*$', re.MULTILINE)
return stripcomment_re.sub('', result).strip() return stripcomment_re.sub('', text).strip()
def ConvertToInteger(inputval): def ConvertToInteger(inputval):
......
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