Commit f1c2f43c authored by jam@chromium.org's avatar jam@chromium.org

Fix gcl sometimes stripping the new line characters when changing the issue...

Fix gcl sometimes stripping the new line characters when changing the issue description on the server. This change replaces \n with \r\n before giving the description to the editor on Windows (not through cygwin though), and then replaces \r\n with \n when saving it locally or sending it to reitveld.

BUG=95618
Review URL: http://codereview.chromium.org/7875004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@101863 0039d316-1c4b-4281-b951-d872f2087c98
parent 6ca8bf80
...@@ -1095,7 +1095,12 @@ def CMDchange(args): ...@@ -1095,7 +1095,12 @@ def CMDchange(args):
"---Repository Root: " + change_info.GetLocalRoot() + "\n" "---Repository Root: " + change_info.GetLocalRoot() + "\n"
"---Paths in this changelist (" + change_info.name + "):\n") "---Paths in this changelist (" + change_info.name + "):\n")
separator2 = "\n\n---Paths modified but not in any changelist:\n\n" separator2 = "\n\n---Paths modified but not in any changelist:\n\n"
text = (description + separator1 + '\n' +
description_to_write = description
if sys.platform == 'win32':
description_to_write = description.replace('\n', '\r\n')
text = (description_to_write + separator1 + '\n' +
'\n'.join([f[0] + f[1] for f in change_info.GetFiles()])) '\n'.join([f[0] + f[1] for f in change_info.GetFiles()]))
if change_info.Exists(): if change_info.Exists():
...@@ -1136,6 +1141,10 @@ def CMDchange(args): ...@@ -1136,6 +1141,10 @@ def CMDchange(args):
# Update the CL description if it has changed. # Update the CL description if it has changed.
new_description = split_result[0] new_description = split_result[0]
if sys.platform == 'win32':
new_description = new_description.replace('\r\n', '\n')
cl_files_text = split_result[1] cl_files_text = split_result[1]
if new_description != description or override_description: if new_description != description or override_description:
change_info.description = new_description change_info.description = new_description
......
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