Show More
@@ -566,7 +566,8 b' TODO: To be written...' | |||
|
566 | 566 | |
|
567 | 567 | def test_maybe_prepare_merge_workspace(self): |
|
568 | 568 | workspace = self.repo._maybe_prepare_merge_workspace( |
|
569 |
'pr2', Reference('branch', 'master', 'unused') |
|
|
569 | 'pr2', Reference('branch', 'master', 'unused'), | |
|
570 | Reference('branch', 'master', 'unused')) | |
|
570 | 571 | |
|
571 | 572 | assert os.path.isdir(workspace) |
|
572 | 573 | workspace_repo = GitRepository(workspace) |
@@ -574,12 +575,29 b' TODO: To be written...' | |||
|
574 | 575 | |
|
575 | 576 | # Calling it a second time should also succeed |
|
576 | 577 | workspace = self.repo._maybe_prepare_merge_workspace( |
|
577 |
'pr2', Reference('branch', 'master', 'unused') |
|
|
578 | 'pr2', Reference('branch', 'master', 'unused'), | |
|
579 | Reference('branch', 'master', 'unused')) | |
|
580 | assert os.path.isdir(workspace) | |
|
581 | ||
|
582 | def test_maybe_prepare_merge_workspace_different_refs(self): | |
|
583 | workspace = self.repo._maybe_prepare_merge_workspace( | |
|
584 | 'pr2', Reference('branch', 'master', 'unused'), | |
|
585 | Reference('branch', 'develop', 'unused')) | |
|
586 | ||
|
587 | assert os.path.isdir(workspace) | |
|
588 | workspace_repo = GitRepository(workspace) | |
|
589 | assert workspace_repo.branches == self.repo.branches | |
|
590 | ||
|
591 | # Calling it a second time should also succeed | |
|
592 | workspace = self.repo._maybe_prepare_merge_workspace( | |
|
593 | 'pr2', Reference('branch', 'master', 'unused'), | |
|
594 | Reference('branch', 'develop', 'unused')) | |
|
578 | 595 | assert os.path.isdir(workspace) |
|
579 | 596 | |
|
580 | 597 | def test_cleanup_merge_workspace(self): |
|
581 | 598 | workspace = self.repo._maybe_prepare_merge_workspace( |
|
582 |
'pr3', Reference('branch', 'master', 'unused') |
|
|
599 | 'pr3', Reference('branch', 'master', 'unused'), | |
|
600 | Reference('branch', 'master', 'unused')) | |
|
583 | 601 | self.repo.cleanup_merge_workspace('pr3') |
|
584 | 602 | |
|
585 | 603 | assert not os.path.exists(workspace) |
@@ -552,18 +552,21 b' TODO: To be written...' | |||
|
552 | 552 | assert commit.message == merge_message |
|
553 | 553 | |
|
554 | 554 | def test_maybe_prepare_merge_workspace(self): |
|
555 |
workspace = self.repo._maybe_prepare_merge_workspace( |
|
|
555 | workspace = self.repo._maybe_prepare_merge_workspace( | |
|
556 | 'pr2', 'unused', 'unused2') | |
|
556 | 557 | |
|
557 | 558 | assert os.path.isdir(workspace) |
|
558 | 559 | workspace_repo = MercurialRepository(workspace) |
|
559 | 560 | assert workspace_repo.branches == self.repo.branches |
|
560 | 561 | |
|
561 | 562 | # Calling it a second time should also succeed |
|
562 |
workspace = self.repo._maybe_prepare_merge_workspace( |
|
|
563 | workspace = self.repo._maybe_prepare_merge_workspace( | |
|
564 | 'pr2', 'unused', 'unused2') | |
|
563 | 565 | assert os.path.isdir(workspace) |
|
564 | 566 | |
|
565 | 567 | def test_cleanup_merge_workspace(self): |
|
566 |
workspace = self.repo._maybe_prepare_merge_workspace( |
|
|
568 | workspace = self.repo._maybe_prepare_merge_workspace( | |
|
569 | 'pr3', 'unused', 'unused2') | |
|
567 | 570 | self.repo.cleanup_merge_workspace('pr3') |
|
568 | 571 | |
|
569 | 572 | assert not os.path.exists(workspace) |
@@ -104,7 +104,7 b' class TestMercurialRemoteRepoInvalidatio' | |||
|
104 | 104 | pr = PullRequestModel() |
|
105 | 105 | workspace_id = pr._workspace_id(pull_request) |
|
106 | 106 | shadow_repository_path = target_vcs._maybe_prepare_merge_workspace( |
|
107 | workspace_id, target_ref) | |
|
107 | workspace_id, target_ref, source_ref) | |
|
108 | 108 | shadow_repo = target_vcs._get_shadow_instance(shadow_repository_path) |
|
109 | 109 | |
|
110 | 110 | # This will populate the cache of the mercurial repository object |
General Comments 0
You need to be logged in to leave comments.
Login now