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

Side by Side Diff: tests/git_cl_test.py

Issue 16057018: Pass --no-renames to git diff (Closed) Base URL: http://src.chromium.org/svn/trunk/tools/depot_tools/
Patch Set: Created 7 years, 6 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « scm.py ('k') | 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 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Unit tests for git_cl.py.""" 6 """Unit tests for git_cl.py."""
7 7
8 import os 8 import os
9 import StringIO 9 import StringIO
10 import stat 10 import stat
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 ((['git', '--no-pager', 'update-index', '--refresh', '-q'],), ''), 155 ((['git', '--no-pager', 'update-index', '--refresh', '-q'],), ''),
156 ((['git', '--no-pager', 'diff-index', '--name-status', 'HEAD'],), ''), 156 ((['git', '--no-pager', 'diff-index', '--name-status', 'HEAD'],), ''),
157 ((['git', '--no-pager', 'symbolic-ref', 'HEAD'],), 'master'), 157 ((['git', '--no-pager', 'symbolic-ref', 'HEAD'],), 'master'),
158 ((['git', '--no-pager', 'config', 'branch.master.merge'],), 'master'), 158 ((['git', '--no-pager', 'config', 'branch.master.merge'],), 'master'),
159 ((['git', '--no-pager', 'config', 'branch.master.remote'],), 'origin'), 159 ((['git', '--no-pager', 'config', 'branch.master.remote'],), 'origin'),
160 ((['git', '--no-pager', 'merge-base', 'master', 'HEAD'],), 160 ((['git', '--no-pager', 'merge-base', 'master', 'HEAD'],),
161 'fake_ancestor_sha'), 161 'fake_ancestor_sha'),
162 ] + cls._git_sanity_checks('fake_ancestor_sha', 'master') + [ 162 ] + cls._git_sanity_checks('fake_ancestor_sha', 'master') + [
163 ((['git', '--no-pager', 'rev-parse', '--show-cdup'],), ''), 163 ((['git', '--no-pager', 'rev-parse', '--show-cdup'],), ''),
164 ((['git', '--no-pager', 'rev-parse', 'HEAD'],), '12345'), 164 ((['git', '--no-pager', 'rev-parse', 'HEAD'],), '12345'),
165 ((['git', '--no-pager', 'diff', '--name-status', '-r', 165 ((['git', '--no-pager', 'diff', '--name-status', '--no-renames', '-r',
166 'fake_ancestor_sha...', '.'],), 166 'fake_ancestor_sha...', '.'],),
167 'M\t.gitignore\n'), 167 'M\t.gitignore\n'),
168 ((['git', '--no-pager', 'config', 'branch.master.rietveldissue'],), ''), 168 ((['git', '--no-pager', 'config', 'branch.master.rietveldissue'],), ''),
169 ((['git', '--no-pager', 'config', 'branch.master.rietveldpatchset'],), 169 ((['git', '--no-pager', 'config', 'branch.master.rietveldpatchset'],),
170 ''), 170 ''),
171 ((['git', '--no-pager', 'log', '--pretty=format:%s%n%n%b', 171 ((['git', '--no-pager', 'log', '--pretty=format:%s%n%n%b',
172 'fake_ancestor_sha...'],), 172 'fake_ancestor_sha...'],),
173 'foo'), 173 'foo'),
174 ((['git', '--no-pager', 'config', 'user.email'],), 'me@example.com'), 174 ((['git', '--no-pager', 'config', 'user.email'],), 'me@example.com'),
175 stat_call, 175 stat_call,
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 'fake_ancestor_sha'), 280 'fake_ancestor_sha'),
281 ] 281 ]
282 282
283 @classmethod 283 @classmethod
284 def _dcommit_calls_normal(cls): 284 def _dcommit_calls_normal(cls):
285 return [ 285 return [
286 ((['git', '--no-pager', 'rev-parse', '--show-cdup'],), ''), 286 ((['git', '--no-pager', 'rev-parse', '--show-cdup'],), ''),
287 ((['git', '--no-pager', 'rev-parse', 'HEAD'],), 287 ((['git', '--no-pager', 'rev-parse', 'HEAD'],),
288 '00ff397798ea57439712ed7e04ab96e13969ef40'), 288 '00ff397798ea57439712ed7e04ab96e13969ef40'),
289 ((['git', '--no-pager', 289 ((['git', '--no-pager',
290 'diff', '--name-status', '-r', 'fake_ancestor_sha...', 290 'diff', '--name-status', '--no-renames', '-r', 'fake_ancestor_sha...',
291 '.'],), 291 '.'],),
292 'M\tPRESUBMIT.py'), 292 'M\tPRESUBMIT.py'),
293 ((['git', '--no-pager', 293 ((['git', '--no-pager',
294 'config', 'branch.working.rietveldissue'],), '12345'), 294 'config', 'branch.working.rietveldissue'],), '12345'),
295 ((['git', '--no-pager', 295 ((['git', '--no-pager',
296 'config', 'branch.working.rietveldpatchset'],), '31137'), 296 'config', 'branch.working.rietveldpatchset'],), '31137'),
297 ((['git', '--no-pager', 'config', 'branch.working.rietveldserver'],), 297 ((['git', '--no-pager', 'config', 'branch.working.rietveldserver'],),
298 'codereview.example.com'), 298 'codereview.example.com'),
299 ((['git', '--no-pager', 'config', 'user.email'],), 'author@example.com'), 299 ((['git', '--no-pager', 'config', 'user.email'],), 'author@example.com'),
300 ((['git', '--no-pager', 'config', 'rietveld.tree-status-url'],), ''), 300 ((['git', '--no-pager', 'config', 'rietveld.tree-status-url'],), ''),
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 ((['git', '--no-pager', 'diff-index', '--name-status', 'HEAD'],), ''), 526 ((['git', '--no-pager', 'diff-index', '--name-status', 'HEAD'],), ''),
527 ((['git', '--no-pager', 'symbolic-ref', 'HEAD'],), 'master'), 527 ((['git', '--no-pager', 'symbolic-ref', 'HEAD'],), 'master'),
528 ((['git', '--no-pager', 'config', 'branch.master.merge'],), 'master'), 528 ((['git', '--no-pager', 'config', 'branch.master.merge'],), 'master'),
529 ((['git', '--no-pager', 'config', 'branch.master.remote'],), 'origin'), 529 ((['git', '--no-pager', 'config', 'branch.master.remote'],), 'origin'),
530 ((['git', '--no-pager', 530 ((['git', '--no-pager',
531 'merge-base', 'master', 'HEAD'],), 'fake_ancestor_sha'), 531 'merge-base', 'master', 'HEAD'],), 'fake_ancestor_sha'),
532 ] + cls._git_sanity_checks('fake_ancestor_sha', 'master') + [ 532 ] + cls._git_sanity_checks('fake_ancestor_sha', 'master') + [
533 ((['git', '--no-pager', 'rev-parse', '--show-cdup'],), ''), 533 ((['git', '--no-pager', 'rev-parse', '--show-cdup'],), ''),
534 ((['git', '--no-pager', 'rev-parse', 'HEAD'],), '12345'), 534 ((['git', '--no-pager', 'rev-parse', 'HEAD'],), '12345'),
535 ((['git', '--no-pager', 535 ((['git', '--no-pager',
536 'diff', '--name-status', '-r', 'fake_ancestor_sha...', '.'],), 536 'diff', '--name-status', '--no-renames', '-r',
537 'fake_ancestor_sha...', '.'],),
537 'M\t.gitignore\n'), 538 'M\t.gitignore\n'),
538 ((['git', '--no-pager', 'config', 'branch.master.rietveldissue'],), ''), 539 ((['git', '--no-pager', 'config', 'branch.master.rietveldissue'],), ''),
539 ((['git', '--no-pager', 540 ((['git', '--no-pager',
540 'config', 'branch.master.rietveldpatchset'],), ''), 541 'config', 'branch.master.rietveldpatchset'],), ''),
541 ((['git', '--no-pager', 542 ((['git', '--no-pager',
542 'log', '--pretty=format:%s%n%n%b', 'fake_ancestor_sha...'],), 543 'log', '--pretty=format:%s%n%n%b', 'fake_ancestor_sha...'],),
543 'foo'), 544 'foo'),
544 ((['git', '--no-pager', 'config', 'user.email'],), 'me@example.com'), 545 ((['git', '--no-pager', 'config', 'user.email'],), 'me@example.com'),
545 ((['git', '--no-pager', 546 ((['git', '--no-pager',
546 'diff', '--no-ext-diff', '--stat', '--find-copies-harder', 547 'diff', '--no-ext-diff', '--stat', '--find-copies-harder',
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 obj = git_cl.ChangeDescription(orig) 712 obj = git_cl.ChangeDescription(orig)
712 obj.update_reviewers(reviewers) 713 obj.update_reviewers(reviewers)
713 actual.append(obj.description) 714 actual.append(obj.description)
714 self.assertEqual(expected, actual) 715 self.assertEqual(expected, actual)
715 716
716 717
717 if __name__ == '__main__': 718 if __name__ == '__main__':
718 git_cl.logging.basicConfig( 719 git_cl.logging.basicConfig(
719 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) 720 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR)
720 unittest.main() 721 unittest.main()
OLDNEW
« no previous file with comments | « scm.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698