Chromium Code Reviews| Index: webkit/tools/merge/merge.py |
| =================================================================== |
| --- webkit/tools/merge/merge.py (revision 9626) |
| +++ webkit/tools/merge/merge.py (working copy) |
| @@ -18,6 +18,7 @@ |
| import os |
| import re |
| import subprocess |
| +import sys |
| import xml.dom.minidom |
| import google.path_utils |
| @@ -68,6 +69,29 @@ |
| 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('dos2unix.exe %s' % file_path, |
|
ojan
2009/02/12 02:21:00
shouldn't this be using 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. |