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

Side by Side Diff: tests/git_cl_test.py

Issue 12811006: Save the GIT hash of HEAD when uploading to rietveld. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Address review comments Created 7 years, 9 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 | « 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 ((['git', 'config', 'rietveld.cc'],), ''), 159 ((['git', 'config', 'rietveld.cc'],), ''),
160 ((['git', 'config', 'branch.master.base-url'],), ''), 160 ((['git', 'config', 'branch.master.base-url'],), ''),
161 ((['git', 'config', '--get-regexp', '^svn-remote\\.'],), 161 ((['git', 'config', '--get-regexp', '^svn-remote\\.'],),
162 (('', None), 0)), 162 (('', None), 0)),
163 ((['git', 'rev-parse', '--show-cdup'],), ''), 163 ((['git', 'rev-parse', '--show-cdup'],), ''),
164 ((['git', 'svn', 'info'],), ''), 164 ((['git', 'svn', 'info'],), ''),
165 ((['git', 'config', 'branch.master.rietveldissue', '1'],), ''), 165 ((['git', 'config', 'branch.master.rietveldissue', '1'],), ''),
166 ((['git', 'config', 'branch.master.rietveldserver', 166 ((['git', 'config', 'branch.master.rietveldserver',
167 'https://codereview.example.com'],), ''), 167 'https://codereview.example.com'],), ''),
168 ((['git', 'config', 'branch.master.rietveldpatchset', '2'],), ''), 168 ((['git', 'config', 'branch.master.rietveldpatchset', '2'],), ''),
169 ((['git', 'rev-parse', 'HEAD'],), 'hash'),
170 ((['git', 'symbolic-ref', 'HEAD'],), 'hash'),
171 ((['git', 'config', 'branch.hash.last-upload-hash', 'hash'],), ''),
169 ] 172 ]
170 173
171 @staticmethod 174 @staticmethod
172 def _git_sanity_checks(diff_base, working_branch): 175 def _git_sanity_checks(diff_base, working_branch):
173 fake_ancestor = 'fake_ancestor' 176 fake_ancestor = 'fake_ancestor'
174 fake_cl = 'fake_cl_for_patch' 177 fake_cl = 'fake_cl_for_patch'
175 return [ 178 return [
176 # Calls to verify branch point is ancestor 179 # Calls to verify branch point is ancestor
177 ((['git', 'rev-parse', '--verify', diff_base],), fake_ancestor), 180 ((['git', 'rev-parse', '--verify', diff_base],), fake_ancestor),
178 ((['git', 'merge-base', fake_ancestor, 'HEAD'],), fake_ancestor), 181 ((['git', 'merge-base', fake_ancestor, 'HEAD'],), fake_ancestor),
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 ((['git', 'config', 'rietveld.viewvc-url'],), ''), 586 ((['git', 'config', 'rietveld.viewvc-url'],), ''),
584 (('ViewVC URL:',), ''), 587 (('ViewVC URL:',), ''),
585 # DownloadHooks(True) 588 # DownloadHooks(True)
586 ((commit_msg_path, os.X_OK,), True), 589 ((commit_msg_path, os.X_OK,), True),
587 ] 590 ]
588 git_cl.main(['config']) 591 git_cl.main(['config'])
589 592
590 593
591 if __name__ == '__main__': 594 if __name__ == '__main__':
592 unittest.main() 595 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