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

Side by Side Diff: tests/git_cl_test.py

Issue 10915190: Fix git_cl diffstat to use -l100000 to match upload.py (Closed) Base URL: https://git.chromium.org/chromium/tools/depot_tools.git@master
Patch Set: Created 8 years, 3 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
« no previous file with comments | « git_cl.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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 ((['git', 'config', 'branch.master.remote'],), 'origin'), 108 ((['git', 'config', 'branch.master.remote'],), 'origin'),
109 ((['git', 'rev-parse', '--show-cdup'],), ''), 109 ((['git', 'rev-parse', '--show-cdup'],), ''),
110 ((['git', 'rev-parse', 'HEAD'],), '12345'), 110 ((['git', 'rev-parse', 'HEAD'],), '12345'),
111 ((['git', 'diff', '--name-status', '-r', 'master...', '.'],), 111 ((['git', 'diff', '--name-status', '-r', 'master...', '.'],),
112 'M\t.gitignore\n'), 112 'M\t.gitignore\n'),
113 ((['git', 'config', 'branch.master.rietveldissue'],), ''), 113 ((['git', 'config', 'branch.master.rietveldissue'],), ''),
114 ((['git', 'config', 'branch.master.rietveldpatchset'],), ''), 114 ((['git', 'config', 'branch.master.rietveldpatchset'],), ''),
115 ((['git', 'log', '--pretty=format:%s%n%n%b', 'master...'],), 'foo'), 115 ((['git', 'log', '--pretty=format:%s%n%n%b', 'master...'],), 'foo'),
116 ((['git', 'config', 'user.email'],), 'me@example.com'), 116 ((['git', 'config', 'user.email'],), 'me@example.com'),
117 ((['git', 'diff', '--no-ext-diff', '--stat', '--find-copies-harder', 117 ((['git', 'diff', '--no-ext-diff', '--stat', '--find-copies-harder',
118 'master...'],), 118 '-l100000', 'master...'],),
119 '+dat'), 119 '+dat'),
120 ((['git', 'log', '--pretty=format:%s\n\n%b', 'master..'],), 'desc\n'), 120 ((['git', 'log', '--pretty=format:%s\n\n%b', 'master..'],), 'desc\n'),
121 ] 121 ]
122 122
123 @staticmethod 123 @staticmethod
124 def _git_upload_calls(): 124 def _git_upload_calls():
125 return [ 125 return [
126 ((['git', 'config', 'rietveld.cc'],), ''), 126 ((['git', 'config', 'rietveld.cc'],), ''),
127 ((['git', 'config', 'branch.master.base-url'],), ''), 127 ((['git', 'config', 'branch.master.base-url'],), ''),
128 ((['git', 'config', '--get-regexp', '^svn-remote\\.'],), 128 ((['git', 'config', '--get-regexp', '^svn-remote\\.'],),
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 'codereview.example.com'), 186 'codereview.example.com'),
187 (('GitClHooksBypassedCommit', 187 (('GitClHooksBypassedCommit',
188 'Issue https://codereview.example.com/12345 bypassed hook when ' 188 'Issue https://codereview.example.com/12345 bypassed hook when '
189 'committing'), None), 189 'committing'), None),
190 ] 190 ]
191 191
192 @classmethod 192 @classmethod
193 def _dcommit_calls_3(cls): 193 def _dcommit_calls_3(cls):
194 return [ 194 return [
195 ((['git', 'diff', '--no-ext-diff', '--stat', '--find-copies-harder', 195 ((['git', 'diff', '--no-ext-diff', '--stat', '--find-copies-harder',
196 'refs/remotes/origin/master', 'refs/heads/working'],), 196 '-l100000', 'refs/remotes/origin/master', 'refs/heads/working'],),
197 (' PRESUBMIT.py | 2 +-\n' 197 (' PRESUBMIT.py | 2 +-\n'
198 ' 1 files changed, 1 insertions(+), 1 deletions(-)\n')), 198 ' 1 files changed, 1 insertions(+), 1 deletions(-)\n')),
199 (('About to commit; enter to confirm.',), None), 199 (('About to commit; enter to confirm.',), None),
200 ((['git', 'show-ref', '--quiet', '--verify', 200 ((['git', 'show-ref', '--quiet', '--verify',
201 'refs/heads/git-cl-commit'],), 201 'refs/heads/git-cl-commit'],),
202 (('', None), 0)), 202 (('', None), 0)),
203 ((['git', 'branch', '-D', 'git-cl-commit'],), ''), 203 ((['git', 'branch', '-D', 'git-cl-commit'],), ''),
204 ((['git', 'show-ref', '--quiet', '--verify', 204 ((['git', 'show-ref', '--quiet', '--verify',
205 'refs/heads/git-cl-cherry-pick'],), ''), 205 'refs/heads/git-cl-cherry-pick'],), ''),
206 ((['git', 'rev-parse', '--show-cdup'],), '\n'), 206 ((['git', 'rev-parse', '--show-cdup'],), '\n'),
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 ((['git', 'config', 'branch.master.remote'],), 'origin'), 347 ((['git', 'config', 'branch.master.remote'],), 'origin'),
348 ((['git', 'rev-parse', '--show-cdup'],), ''), 348 ((['git', 'rev-parse', '--show-cdup'],), ''),
349 ((['git', 'rev-parse', 'HEAD'],), '12345'), 349 ((['git', 'rev-parse', 'HEAD'],), '12345'),
350 ((['git', 'diff', '--name-status', '-r', 'master...', '.'],), 350 ((['git', 'diff', '--name-status', '-r', 'master...', '.'],),
351 'M\t.gitignore\n'), 351 'M\t.gitignore\n'),
352 ((['git', 'config', 'branch.master.rietveldissue'],), ''), 352 ((['git', 'config', 'branch.master.rietveldissue'],), ''),
353 ((['git', 'config', 'branch.master.rietveldpatchset'],), ''), 353 ((['git', 'config', 'branch.master.rietveldpatchset'],), ''),
354 ((['git', 'log', '--pretty=format:%s%n%n%b', 'master...'],), 'foo'), 354 ((['git', 'log', '--pretty=format:%s%n%n%b', 'master...'],), 'foo'),
355 ((['git', 'config', 'user.email'],), 'me@example.com'), 355 ((['git', 'config', 'user.email'],), 'me@example.com'),
356 ((['git', 'diff', '--no-ext-diff', '--stat', '--find-copies-harder', 356 ((['git', 'diff', '--no-ext-diff', '--stat', '--find-copies-harder',
357 'master...'],), 357 '-l100000', 'master...'],),
358 '+dat'), 358 '+dat'),
359 ] 359 ]
360 360
361 @staticmethod 361 @staticmethod
362 def _gerrit_upload_calls(description, reviewers): 362 def _gerrit_upload_calls(description, reviewers):
363 calls = [ 363 calls = [
364 ((['git', 'log', '--pretty=format:%s\n\n%b', 'master..'],), 364 ((['git', 'log', '--pretty=format:%s\n\n%b', 'master..'],),
365 description), 365 description),
366 ((['git', 'config', 'rietveld.cc'],), '') 366 ((['git', 'config', 'rietveld.cc'],), '')
367 ] 367 ]
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 ((['git', 'config', 'rietveld.viewvc-url'],), ''), 458 ((['git', 'config', 'rietveld.viewvc-url'],), ''),
459 (('ViewVC URL:',), ''), 459 (('ViewVC URL:',), ''),
460 # DownloadHooks(True) 460 # DownloadHooks(True)
461 ((commit_msg_path, os.X_OK,), True), 461 ((commit_msg_path, os.X_OK,), True),
462 ] 462 ]
463 git_cl.main(['config']) 463 git_cl.main(['config'])
464 464
465 465
466 if __name__ == '__main__': 466 if __name__ == '__main__':
467 unittest.main() 467 unittest.main()
OLDNEW
« no previous file with comments | « git_cl.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698