aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Thiago Farina <tfarina@chromium.org>2014-10-10 00:25:29 -0300
committerGravatar Thiago Farina <tfarina@chromium.org>2014-10-10 00:25:29 -0300
commit8f1f7f821c8383053bdf747b89d843bbddd84203 (patch)
tree50b87894f33b5a5e2c7ec975f801e955a2095e8c /tools
parent092dab98220110e7244ccbbb851efa8ad621ab88 (diff)
Use the function recently added to common in svndiff.py
GetModifiedFiles() function was added to common repo in https://skia.googlesource.com/common/+/af1de867422c42855ae54ed3838c62ea445ea6b4 BUG=None TEST=None R=borenet@google.com Review URL: https://codereview.chromium.org/634313006
Diffstat (limited to 'tools')
-rwxr-xr-xtools/svndiff.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/tools/svndiff.py b/tools/svndiff.py
index 716d497014..deb1b55fbd 100755
--- a/tools/svndiff.py
+++ b/tools/svndiff.py
@@ -46,6 +46,11 @@ import gm_json
import jsondiff
import svn
+CHECKOUT_ROOT = os.path.realpath(
+ os.path.join(os.path.dirname(__file__), os.pardir))
+sys.path.append(CHECKOUT_ROOT)
+from common.py.utils import git_utils
+
USAGE_STRING = 'Usage: %s [options]'
HELP_STRING = '''
@@ -185,12 +190,6 @@ def _RunCommand(args):
raise Exception('command "%s" failed: %s' % (args, stderr))
return stdout
-def _GitGetModifiedFiles():
- """Returns a list of locally modified files within the current working dir.
-
- TODO(epoger): Move this into a git utility package?
- """
- return _RunCommand(['git', 'ls-files', '-m']).splitlines()
def _GitExportBaseVersionOfFile(file_within_repo, dest_path):
"""Retrieves a copy of the base version of a file within the repository.
@@ -254,7 +253,7 @@ def SvnDiff(path_to_skdiff, dest_dir, source_dir):
modified_file_paths = svn_repo.GetFilesWithStatus(
svn.STATUS_ADDED | svn.STATUS_DELETED | svn.STATUS_MODIFIED)
else:
- modified_file_paths = _GitGetModifiedFiles()
+ modified_file_paths = git_utils.GetModifiedFiles()
# For each modified file:
# 1. copy its current contents into modified_flattened_dir