Commit 7af6c4dc authored by maruel@chromium.org's avatar maruel@chromium.org

Use universal EOL conversion when calling the text editor in gcl.

This was causing issues for windows user with notepad2.

Fix trychange.py on python2.5.

R=dpranke@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/8038028

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@102797 0039d316-1c4b-4281-b951-d872f2087c98
parent c0c424bc
...@@ -532,7 +532,7 @@ class ChangeInfo(object): ...@@ -532,7 +532,7 @@ class ChangeInfo(object):
if fail_on_not_found: if fail_on_not_found:
ErrorExit("Changelist " + changename + " not found.") ErrorExit("Changelist " + changename + " not found.")
return ChangeInfo(changename, 0, 0, '', None, local_root, None, False) return ChangeInfo(changename, 0, 0, '', None, local_root, None, False)
content = gclient_utils.FileRead(info_file, 'r') content = gclient_utils.FileRead(info_file)
save = False save = False
try: try:
values = ChangeInfo._LoadNewFormat(content) values = ChangeInfo._LoadNewFormat(content)
...@@ -1137,7 +1137,7 @@ def CMDchange(args): ...@@ -1137,7 +1137,7 @@ def CMDchange(args):
subprocess2.check_call(cmd, shell=True) subprocess2.check_call(cmd, shell=True)
except subprocess2.CalledProcessError, e: except subprocess2.CalledProcessError, e:
ErrorExit('Editor returned %d' % e.returncode) ErrorExit('Editor returned %d' % e.returncode)
result = gclient_utils.FileRead(filename, 'r') result = gclient_utils.FileRead(filename)
finally: finally:
os.remove(filename) os.remove(filename)
......
...@@ -897,9 +897,9 @@ class GetTrySlavesExecuter(object): ...@@ -897,9 +897,9 @@ class GetTrySlavesExecuter(object):
if function_name in context: if function_name in context:
get_preferred_try_slaves = context[function_name] get_preferred_try_slaves = context[function_name]
function_info = inspect.getargspec(get_preferred_try_slaves) function_info = inspect.getargspec(get_preferred_try_slaves)
if len(function_info.args) == 1: if len(function_info[0]) == 1:
result = get_preferred_try_slaves(project) result = get_preferred_try_slaves(project)
elif len(function_info.args) == 2: elif len(function_info[0]) == 2:
result = get_preferred_try_slaves(project, change) result = get_preferred_try_slaves(project, change)
else: else:
result = get_preferred_try_slaves() result = get_preferred_try_slaves()
......
...@@ -216,7 +216,7 @@ class ChangeInfoUnittest(GclTestsBase): ...@@ -216,7 +216,7 @@ class ChangeInfoUnittest(GclTestsBase):
description = ["This is some description.", "force an extra separator."] description = ["This is some description.", "force an extra separator."]
gcl.GetChangelistInfoFile('bleh').AndReturn('bleeeh') gcl.GetChangelistInfoFile('bleh').AndReturn('bleeeh')
gcl.os.path.exists('bleeeh').AndReturn(True) gcl.os.path.exists('bleeeh').AndReturn(True)
gcl.gclient_utils.FileRead('bleeeh', 'r').AndReturn( gcl.gclient_utils.FileRead('bleeeh').AndReturn(
gcl.ChangeInfo._SEPARATOR.join(["42, 53", "G b.cc"] + description)) gcl.ChangeInfo._SEPARATOR.join(["42, 53", "G b.cc"] + description))
gcl.GetCodeReviewSetting('CODE_REVIEW_SERVER').AndReturn('foo') gcl.GetCodeReviewSetting('CODE_REVIEW_SERVER').AndReturn('foo')
# Does an upgrade. # Does an upgrade.
...@@ -236,7 +236,7 @@ class ChangeInfoUnittest(GclTestsBase): ...@@ -236,7 +236,7 @@ class ChangeInfoUnittest(GclTestsBase):
self.mox.StubOutWithMock(gcl, 'GetCodeReviewSetting') self.mox.StubOutWithMock(gcl, 'GetCodeReviewSetting')
gcl.GetChangelistInfoFile('bleh').AndReturn('bleeeh') gcl.GetChangelistInfoFile('bleh').AndReturn('bleeeh')
gcl.os.path.exists('bleeeh').AndReturn(True) gcl.os.path.exists('bleeeh').AndReturn(True)
gcl.gclient_utils.FileRead('bleeeh', 'r').AndReturn( gcl.gclient_utils.FileRead('bleeeh').AndReturn(
gcl.ChangeInfo._SEPARATOR.join(["", "", ""])) gcl.ChangeInfo._SEPARATOR.join(["", "", ""]))
gcl.GetCodeReviewSetting('CODE_REVIEW_SERVER').AndReturn('foo') gcl.GetCodeReviewSetting('CODE_REVIEW_SERVER').AndReturn('foo')
# Does an upgrade. # Does an upgrade.
......
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