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

Side by Side Diff: tests/git_cl_test.py

Issue 224863006: Abort `git cl push` if pushing into a local branch. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: restrict to non git-svn repos Created 6 years, 8 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 ((['git', 'symbolic-ref', 'HEAD'],), 'refs/heads/working'), 263 ((['git', 'symbolic-ref', 'HEAD'],), 'refs/heads/working'),
264 ((['git', 'config', '--int', '--get', 264 ((['git', 'config', '--int', '--get',
265 'branch.working.git-cl-similarity'],), ''), 265 'branch.working.git-cl-similarity'],), ''),
266 ((['git', 'symbolic-ref', 'HEAD'],), 'refs/heads/working'), 266 ((['git', 'symbolic-ref', 'HEAD'],), 'refs/heads/working'),
267 ((['git', 'config', '--int', '--get', 267 ((['git', 'config', '--int', '--get',
268 'branch.working.git-find-copies'],), ''), 268 'branch.working.git-find-copies'],), ''),
269 ((['git', 'symbolic-ref', 'HEAD'],), 'refs/heads/working'), 269 ((['git', 'symbolic-ref', 'HEAD'],), 'refs/heads/working'),
270 ((['git', 270 ((['git',
271 'config', 'branch.working.merge'],), 'refs/heads/master'), 271 'config', 'branch.working.merge'],), 'refs/heads/master'),
272 ((['git', 'config', 'branch.working.remote'],), 'origin'), 272 ((['git', 'config', 'branch.working.remote'],), 'origin'),
273 ((['git', 'config', 'branch.working.merge'],),
274 'refs/heads/master'),
275 ((['git', 'config', 'branch.working.remote'],), 'origin'),
273 ((['git', 'rev-list', '--merges', 276 ((['git', 'rev-list', '--merges',
274 '--grep=^SVN changes up to revision [0-9]*$', 277 '--grep=^SVN changes up to revision [0-9]*$',
275 'refs/remotes/origin/master^!'],), ''), 278 'refs/remotes/origin/master^!'],), ''),
276 ((['git', 'update-index', '--refresh', '-q'],), ''), 279 ((['git', 'update-index', '--refresh', '-q'],), ''),
277 ((['git', 'diff-index', '--name-status', 'HEAD'],), ''), 280 ((['git', 'diff-index', '--name-status', 'HEAD'],), ''),
278 ((['git', 'rev-list', '^refs/heads/working', 281 ((['git', 'rev-list', '^refs/heads/working',
279 'refs/remotes/origin/master'],), 282 'refs/remotes/origin/master'],),
280 ''), 283 ''),
281 ((['git', 284 ((['git',
282 'log', '--grep=^git-svn-id:', '-1', '--pretty=format:%H'],), 285 'log', '--grep=^git-svn-id:', '-1', '--pretty=format:%H'],),
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 obj = git_cl.ChangeDescription(orig) 744 obj = git_cl.ChangeDescription(orig)
742 obj.update_reviewers(reviewers) 745 obj.update_reviewers(reviewers)
743 actual.append(obj.description) 746 actual.append(obj.description)
744 self.assertEqual(expected, actual) 747 self.assertEqual(expected, actual)
745 748
746 749
747 if __name__ == '__main__': 750 if __name__ == '__main__':
748 git_cl.logging.basicConfig( 751 git_cl.logging.basicConfig(
749 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) 752 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR)
750 unittest.main() 753 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