Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Unified Diff: gcl.py

Issue 7875004: Fix gcl sometimes stripping the new line characters when changing the issue description on the se... (Closed) Base URL: http://src.chromium.org/svn/trunk/tools/depot_tools/
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcl.py
===================================================================
--- gcl.py (revision 100781)
+++ gcl.py (working copy)
@@ -1095,7 +1095,12 @@
"---Repository Root: " + change_info.GetLocalRoot() + "\n"
"---Paths in this changelist (" + change_info.name + "):\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()]))
if change_info.Exists():
@@ -1109,7 +1114,6 @@
handle, filename = tempfile.mkstemp(text=True)
os.write(handle, text)
os.close(handle)
-
# Open up the default editor in the system to get the CL description.
try:
if not silent:
@@ -1136,6 +1140,10 @@
# Update the CL description if it has changed.
new_description = split_result[0]
+
+ if sys.platform == 'win32':
+ new_description = new_description.replace('\r\n', '\n')
+
cl_files_text = split_result[1]
if new_description != description or override_description:
change_info.description = new_description
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698