Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: upload.py

Issue 29539660: Issue 5644 - Add --binary to git diff options (Closed)
Patch Set: Created Sept. 8, 2017, 10:17 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # coding: utf-8 2 # coding: utf-8
3 # 3 #
4 # Copyright 2007 Google Inc. 4 # Copyright 2007 Google Inc.
5 # 5 #
6 # Licensed under the Apache License, Version 2.0 (the "License"); 6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License. 7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at 8 # You may obtain a copy of the License at
9 # 9 #
10 # http://www.apache.org/licenses/LICENSE-2.0 10 # http://www.apache.org/licenses/LICENSE-2.0
(...skipping 1599 matching lines...) Expand 10 before | Expand all | Expand 10 after
1610 env = os.environ.copy() 1610 env = os.environ.copy()
1611 if "GIT_EXTERNAL_DIFF" in env: 1611 if "GIT_EXTERNAL_DIFF" in env:
1612 del env["GIT_EXTERNAL_DIFF"] 1612 del env["GIT_EXTERNAL_DIFF"]
1613 # -M/-C will not print the diff for the deleted file when a file is renamed. 1613 # -M/-C will not print the diff for the deleted file when a file is renamed.
1614 # This is confusing because the original file will not be shown on the 1614 # This is confusing because the original file will not be shown on the
1615 # review when a file is renamed. So, get a diff with ONLY deletes, then 1615 # review when a file is renamed. So, get a diff with ONLY deletes, then
1616 # append a diff (with rename detection), without deletes. 1616 # append a diff (with rename detection), without deletes.
1617 cmd = [ 1617 cmd = [
1618 "git", "diff", "--no-color", "--no-ext-diff", "--full-index", 1618 "git", "diff", "--no-color", "--no-ext-diff", "--full-index",
1619 "--ignore-submodules", "--src-prefix=a/", "--dst-prefix=b/", 1619 "--ignore-submodules", "--src-prefix=a/", "--dst-prefix=b/",
1620 "--binary",
1620 ] 1621 ]
1621 diff = RunShell( 1622 diff = RunShell(
1622 cmd + ["--no-renames", "--diff-filter=D"] + extra_args, 1623 cmd + ["--no-renames", "--diff-filter=D"] + extra_args,
1623 env=env, silent_ok=True) 1624 env=env, silent_ok=True)
1624 assert 0 <= self.options.git_similarity <= 100 1625 assert 0 <= self.options.git_similarity <= 100
1625 if self.options.git_find_copies: 1626 if self.options.git_find_copies:
1626 similarity_options = ["-l100000", "-C%d%%" % self.options.git_similarity] 1627 similarity_options = ["-l100000", "-C%d%%" % self.options.git_similarity]
1627 if self.options.git_find_copies_harder: 1628 if self.options.git_find_copies_harder:
1628 similarity_options.append("--find-copies-harder") 1629 similarity_options.append("--find-copies-harder")
1629 else: 1630 else:
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after
2710 os.environ['LC_ALL'] = 'C' 2711 os.environ['LC_ALL'] = 'C'
2711 RealMain(sys.argv) 2712 RealMain(sys.argv)
2712 except KeyboardInterrupt: 2713 except KeyboardInterrupt:
2713 print 2714 print
2714 StatusUpdate("Interrupted.") 2715 StatusUpdate("Interrupted.")
2715 sys.exit(1) 2716 sys.exit(1)
2716 2717
2717 2718
2718 if __name__ == "__main__": 2719 if __name__ == "__main__":
2719 main() 2720 main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld