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

Side by Side Diff: tests/git_common_test.py

Issue 212213004: Make mark-merge-base cap the marked merge base at the real merge-base. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: fix comments Created 6 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
« no previous file with comments | « git_common.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 2013 The Chromium Authors. All rights reserved. 2 # Copyright 2013 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_common.py""" 6 """Unit tests for git_common.py"""
7 7
8 import binascii 8 import binascii
9 import collections 9 import collections
10 import os 10 import os
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 self.repo.run(self.gc.branch_config_map, 'base')) 429 self.repo.run(self.gc.branch_config_map, 'base'))
430 430
431 self.repo.run(self.gc.remove_merge_base, 'branch_K') 431 self.repo.run(self.gc.remove_merge_base, 'branch_K')
432 self.repo.run(self.gc.remove_merge_base, 'branch_L') 432 self.repo.run(self.gc.remove_merge_base, 'branch_L')
433 433
434 self.assertEqual(None, 434 self.assertEqual(None,
435 self.repo.run(self.gc.config, 'branch.branch_K.base')) 435 self.repo.run(self.gc.config, 'branch.branch_K.base'))
436 436
437 self.assertEqual({}, self.repo.run(self.gc.branch_config_map, 'base')) 437 self.assertEqual({}, self.repo.run(self.gc.branch_config_map, 'base'))
438 438
439 # if it's too old, then it caps at merge-base
440 self.repo.run(self.gc.manual_merge_base, 'branch_K', self.repo['A'])
441
442 self.assertEqual(
443 self.repo['B'],
444 self.repo.run(self.gc.get_or_create_merge_base, 'branch_K', 'branch_G')
445 )
446
439 def testGetBranchTree(self): 447 def testGetBranchTree(self):
440 skipped, tree = self.repo.run(self.gc.get_branch_tree) 448 skipped, tree = self.repo.run(self.gc.get_branch_tree)
441 self.assertEqual(skipped, {'master', 'root_X'}) 449 self.assertEqual(skipped, {'master', 'root_X'})
442 self.assertEqual(tree, { 450 self.assertEqual(tree, {
443 'branch_G': 'root_A', 451 'branch_G': 'root_A',
444 'root_A': 'root_X', 452 'root_A': 'root_X',
445 'branch_K': 'branch_G', 453 'branch_K': 'branch_G',
446 'branch_L': 'branch_K', 454 'branch_L': 'branch_K',
447 'branch_Z': 'root_X' 455 'branch_Z': 'root_X'
448 }) 456 })
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 612
605 self.assertEquals(self.repo.git('status', '--porcelain').stdout, STATUS_1) 613 self.assertEquals(self.repo.git('status', '--porcelain').stdout, STATUS_1)
606 614
607 self.repo.run(inner) 615 self.repo.run(inner)
608 616
609 617
610 if __name__ == '__main__': 618 if __name__ == '__main__':
611 sys.exit(coverage_utils.covered_main( 619 sys.exit(coverage_utils.covered_main(
612 os.path.join(DEPOT_TOOLS_ROOT, 'git_common.py') 620 os.path.join(DEPOT_TOOLS_ROOT, 'git_common.py')
613 )) 621 ))
OLDNEW
« no previous file with comments | « git_common.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698