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

Side by Side Diff: tests/git_cl_test.py

Issue 344013005: Allow git cl also in repos with read-only git-svn. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Git cl: Modified comment as well Created 6 years, 5 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 else: 200 else:
201 cc_call = [((['git', 'config', 'rietveld.cc'],), '')] 201 cc_call = [((['git', 'config', 'rietveld.cc'],), '')]
202 private_call = [ 202 private_call = [
203 ((['git', 'config', 'rietveld.private'],), '')] 203 ((['git', 'config', 'rietveld.private'],), '')]
204 204
205 return [ 205 return [
206 ((['git', 'config', 'core.editor'],), ''), 206 ((['git', 'config', 'core.editor'],), ''),
207 ] + cc_call + private_call + [ 207 ] + cc_call + private_call + [
208 ((['git', 'config', 'branch.master.base-url'],), ''), 208 ((['git', 'config', 'branch.master.base-url'],), ''),
209 ((['git', 209 ((['git',
210 'config', '--local', '--get-regexp', '^svn-remote\\.'],), 210 'config', '--local', '--get-regexp', '^svn-remote\\..*\\.url'],),
211 (('', None), 0)), 211 (('svn-remote.mybranch.url svn://svn.chromium.org/chrome', None), 0)),
212 ((['git', 'rev-parse', '--show-cdup'],), ''), 212 ((['git', 'rev-parse', '--show-cdup'],), ''),
213 ((['git', 'svn', 'info'],), ''), 213 ((['git', 'svn', 'info'],), ''),
214 ((['git', 'config', 'rietveld.project'],), ''), 214 ((['git', 'config', 'rietveld.project'],), ''),
215 ((['git', 215 ((['git',
216 'config', 'branch.master.rietveldissue', '1'],), ''), 216 'config', 'branch.master.rietveldissue', '1'],), ''),
217 ((['git', 'config', 'branch.master.rietveldserver', 217 ((['git', 'config', 'branch.master.rietveldserver',
218 'https://codereview.example.com'],), ''), 218 'https://codereview.example.com'],), ''),
219 ((['git', 219 ((['git',
220 'config', 'branch.master.rietveldpatchset', '2'],), ''), 220 'config', 'branch.master.rietveldpatchset', '2'],), ''),
221 ((['git', 'rev-parse', 'HEAD'],), 'hash'), 221 ((['git', 'rev-parse', 'HEAD'],), 'hash'),
(...skipping 24 matching lines...) Expand all
246 ((['git', 246 ((['git',
247 'config', 'branch.%s.remote' % working_branch],), 'origin'), 247 'config', 'branch.%s.remote' % working_branch],), 'origin'),
248 ((['git', 'rev-list', '^' + fake_ancestor, 248 ((['git', 'rev-list', '^' + fake_ancestor,
249 'refs/remotes/origin/master'],), ''), 249 'refs/remotes/origin/master'],), ''),
250 ] 250 ]
251 251
252 @classmethod 252 @classmethod
253 def _dcommit_calls_1(cls): 253 def _dcommit_calls_1(cls):
254 return [ 254 return [
255 ((['git', 255 ((['git',
256 'config', '--local', '--get-regexp', '^svn-remote\\.'],), 256 'config', '--local', '--get-regexp', '^svn-remote\\..*\\.url'],),
257 ((('svn-remote.svn.url svn://svn.chromium.org/chrome\n' 257 ((('svn-remote.svn.url svn://svn.chromium.org/chrome\n'
258 'svn-remote.svn.fetch trunk/src:refs/remotes/origin/master'), 258 'svn-remote.svn.fetch trunk/src:refs/remotes/origin/master'),
259 None), 259 None),
260 0)), 260 0)),
261 ((['git', 'config', 'rietveld.autoupdate'],), 261 ((['git', 'config', 'rietveld.autoupdate'],),
262 ''), 262 ''),
263 ((['git', 263 ((['git',
264 'config', 'rietveld.server'],), 'codereview.example.com'), 264 'config', 'rietveld.server'],), 'codereview.example.com'),
265 ((['git', 'symbolic-ref', 'HEAD'],), 'refs/heads/working'), 265 ((['git', 'symbolic-ref', 'HEAD'],), 'refs/heads/working'),
266 ((['git', 'config', '--int', '--get', 266 ((['git', 'config', '--int', '--get',
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 768
769 self.calls = [ 769 self.calls = [
770 ((['git', 'config', 'rietveld.autoupdate',],), 770 ((['git', 'config', 'rietveld.autoupdate',],),
771 ''), 771 ''),
772 ((['git', 'config', 'gerrit.host',],), 772 ((['git', 'config', 'gerrit.host',],),
773 ''), 773 ''),
774 ((['git', 'rev-parse', '--show-cdup',],), 774 ((['git', 'rev-parse', '--show-cdup',],),
775 ''), 775 ''),
776 ((['git', 'config', 'rietveld.private',],), 776 ((['git', 'config', 'rietveld.private',],),
777 ''), 777 ''),
778 ((['git', 'config', '--local', '--get-regexp', '^svn-remote\\.'],), 778 ((['git', 'config', '--local', '--get-regexp',
779 '^svn-remote\\..*\\.url',],),
779 ''), 780 ''),
780 ((['git', 'config', 'rietveld.project',],), 781 ((['git', 'config', 'rietveld.project',],),
781 ''), 782 ''),
782 ((['git', 'rev-parse', 'HEAD',],), 783 ((['git', 'rev-parse', 'HEAD',],),
783 ''), 784 ''),
784 ] 785 ]
785 786
786 stored_description = [] 787 stored_description = []
787 def check_upload(args): 788 def check_upload(args):
788 i = 0 789 i = 0
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 def AffectedFiles(self): 863 def AffectedFiles(self):
863 return [] 864 return []
864 865
865 def LocalPaths(self): 866 def LocalPaths(self):
866 return None 867 return None
867 868
868 if __name__ == '__main__': 869 if __name__ == '__main__':
869 git_cl.logging.basicConfig( 870 git_cl.logging.basicConfig(
870 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) 871 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR)
871 unittest.main() 872 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