summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorpamg@google.com <pamg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-12 13:36:19 +0000
committerpamg@google.com <pamg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-12 13:36:19 +0000
commit212b30d4e8c264d565fedadb3c1bb8c649779299 (patch)
treebf5c0eb7109b12d768f463114e8568ebd7b19a9e /webkit
parent6cc67d7fdd6a666109bb82b411905c0f3415dce3 (diff)
downloadchromium_src-212b30d4e8c264d565fedadb3c1bb8c649779299.zip
chromium_src-212b30d4e8c264d565fedadb3c1bb8c649779299.tar.gz
chromium_src-212b30d4e8c264d565fedadb3c1bb8c649779299.tar.bz2
On Windows, find all modified files after a WebKit merge and force them
to LF. 'svn merge' saves them with CRLF otherwise, which interferes with later merges. Remove the now-obsolete code that did the same thing after a 3-way merge, which only took effect when a file had conflicts. BUG=7536 TEST=run a merge, see no CRLF in text files Review URL: http://codereview.chromium.org/20289 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9650 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rwxr-xr-xwebkit/tools/merge/diff3-wrapper.py3
-rwxr-xr-xwebkit/tools/merge/merge.py23
2 files changed, 23 insertions, 3 deletions
diff --git a/webkit/tools/merge/diff3-wrapper.py b/webkit/tools/merge/diff3-wrapper.py
index 96e0a74..aa1de4a 100755
--- a/webkit/tools/merge/diff3-wrapper.py
+++ b/webkit/tools/merge/diff3-wrapper.py
@@ -108,9 +108,6 @@ def main(args):
# Return an errorcode of 0 on successful merge, 1 if unresolved conflicts
# remain in the result. Any other errorcode will be treated as fatal.
merged_file_contents = open(mine).read()
- # Ensure that the file doesn't use CRLF, in case the diff program converted
- # line endings.
- merged_file_contents.replace('\r\n', '\n')
# For reasons I don't understand, an extra line break gets added at the end
# of the file. Strip it.
diff --git a/webkit/tools/merge/merge.py b/webkit/tools/merge/merge.py
index e5067c1..2736253 100755
--- a/webkit/tools/merge/merge.py
+++ b/webkit/tools/merge/merge.py
@@ -18,6 +18,7 @@ import optparse
import os
import re
import subprocess
+import sys
import xml.dom.minidom
import google.path_utils
@@ -68,6 +69,28 @@ class Merger(object):
if returncode != 0:
raise "Are you sure you're running SVN 1.5? svn --version to check"
+ # On Windows, find modified files and force them to LF. We trust dos2unix
+ # not to change binary files.
+ if sys.platform == 'win32':
+ command = [self._svn, "status", "--xml", directory]
+ print ' '.join(command)
+ info = subprocess.Popen(command, cwd=self._webkit_root, shell=True,
+ stdout=subprocess.PIPE).communicate()[0]
+ dom = xml.dom.minidom.parseString(info)
+ for entry in dom.getElementsByTagName("entry"):
+ file_path = entry.getAttribute("path")
+ type = os.path.splitext(file_path)[-1]
+ status = (entry.getElementsByTagName('wc-status')[0]
+ .getAttribute('item'))
+ # TODO(pamg): Is this the same in non-English svn?
+ if status == "modified":
+ command = ["dos2unix.exe", file_path]
+ if self._is_dry_run:
+ print ' '.join(command)
+ else:
+ subprocess.call(command, cwd=self._webkit_root, shell=True)
+
+
def GetCurrentRepositoryAndRevision(webkit_merge_revision_path):
""" Gets the repository and revision we're currently merged to according to
the WEBKIT_MERGE_REVISION file checked in.