diff options
-rwxr-xr-x | webkit/tools/merge/diff3-wrapper.py | 3 | ||||
-rwxr-xr-x | webkit/tools/merge/merge.py | 23 |
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. |