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

Unified Diff: third_party/upload.py

Issue 11377139: Update upload.py at @ 41332266d718. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 8 years, 1 month 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: third_party/upload.py
diff --git a/third_party/upload.py b/third_party/upload.py
index ad819c2ab5d811fc7213ad31b0a10728cd9e6ddc..c7899c70a93dbe87f48f20286434e1910e2d773a 100755
--- a/third_party/upload.py
+++ b/third_party/upload.py
@@ -592,6 +592,9 @@ group.add_option("--git_similarity", action="store", dest="git_similarity",
metavar="SIM", type="int", default=50,
help=("Set the minimum similarity index for detecting renames "
"and copies. See `git diff -C`. (default 50)."))
+group.add_option("--git_no_find_copies", action="store_false", default=True,
+ dest="git_find_copies",
+ help=("Prevents git from looking for copies (default off)."))
# Perforce-specific
group = parser.add_option_group("Perforce-specific options "
"(overrides P4 environment variables)")
@@ -1334,9 +1337,13 @@ class GitVCS(VersionControlSystem):
diff = RunShell(
cmd + ["--no-renames", "--diff-filter=D"] + extra_args,
env=env, silent_ok=True)
+ if self.options.git_find_copies:
+ similarity_options = ["--find-copies-harder", "-l100000",
+ "-C%s" % self.options.git_similarity ]
+ else:
+ similarity_options = ["-M%s" % self.options.git_similarity ]
diff += RunShell(
- cmd + ["--find-copies-harder", "-l100000", "--diff-filter=AMCRT",
- "-C%s" % self.options.git_similarity ] + extra_args,
+ cmd + ["--diff-filter=AMCRT"] + similarity_options + extra_args,
env=env, silent_ok=True)
# The CL could be only file deletion or not. So accept silent diff for both
« 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