Show More
@@ -78,7 +78,7 b' class MercurialRepository(BaseRepository' | |||||
78 | # because sometimes we init the repos with config we need to meet |
|
78 | # because sometimes we init the repos with config we need to meet | |
79 | # special requirements |
|
79 | # special requirements | |
80 | self.config = config if config else self.get_default_config( |
|
80 | self.config = config if config else self.get_default_config( | |
81 |
default=[('extensions', 'largefiles', ' |
|
81 | default=[('extensions', 'largefiles', '')]) | |
82 | self.with_wire = with_wire or {"cache": False} # default should not use cache |
|
82 | self.with_wire = with_wire or {"cache": False} # default should not use cache | |
83 |
|
83 | |||
84 | self._init_repo(create, src_url, do_workspace_checkout) |
|
84 | self._init_repo(create, src_url, do_workspace_checkout) | |
@@ -632,6 +632,7 b' class MercurialRepository(BaseRepository' | |||||
632 | Returns the commit id of the merge and a boolean indicating if the |
|
632 | Returns the commit id of the merge and a boolean indicating if the | |
633 | commit needs to be pushed. |
|
633 | commit needs to be pushed. | |
634 | """ |
|
634 | """ | |
|
635 | ||||
635 | source_ref_commit_id = source_ref.commit_id |
|
636 | source_ref_commit_id = source_ref.commit_id | |
636 | target_ref_commit_id = target_ref.commit_id |
|
637 | target_ref_commit_id = target_ref.commit_id | |
637 |
|
638 | |||
@@ -755,6 +756,7 b' class MercurialRepository(BaseRepository' | |||||
755 |
|
756 | |||
756 | log.debug('Executing merge_repo with %s strategy, dry_run mode:%s', |
|
757 | log.debug('Executing merge_repo with %s strategy, dry_run mode:%s', | |
757 | 'rebase' if use_rebase else 'merge', dry_run) |
|
758 | 'rebase' if use_rebase else 'merge', dry_run) | |
|
759 | ||||
758 | if target_ref.commit_id not in self._heads(): |
|
760 | if target_ref.commit_id not in self._heads(): | |
759 | return MergeResponse( |
|
761 | return MergeResponse( | |
760 | False, False, None, MergeFailureReason.TARGET_IS_NOT_HEAD, |
|
762 | False, False, None, MergeFailureReason.TARGET_IS_NOT_HEAD, | |
@@ -857,6 +859,8 b' class MercurialRepository(BaseRepository' | |||||
857 | needs_push = False |
|
859 | needs_push = False | |
858 | except RepositoryError as e: |
|
860 | except RepositoryError as e: | |
859 | log.exception('Failure when doing local merge on hg shadow repo') |
|
861 | log.exception('Failure when doing local merge on hg shadow repo') | |
|
862 | metadata['unresolved_files'] = 'no unresolved files found' | |||
|
863 | ||||
860 | if isinstance(e, UnresolvedFilesInRepo): |
|
864 | if isinstance(e, UnresolvedFilesInRepo): | |
861 | all_conflicts = list(e.args[0]) |
|
865 | all_conflicts = list(e.args[0]) | |
862 | max_conflicts = 20 |
|
866 | max_conflicts = 20 |
@@ -414,12 +414,12 b' TODO: To be written...' | |||||
414 | def test_local_merge(self, vcsbackend_hg): |
|
414 | def test_local_merge(self, vcsbackend_hg): | |
415 | target_repo = vcsbackend_hg.create_repo(number_of_commits=1) |
|
415 | target_repo = vcsbackend_hg.create_repo(number_of_commits=1) | |
416 | source_repo = vcsbackend_hg.clone_repo(target_repo) |
|
416 | source_repo = vcsbackend_hg.clone_repo(target_repo) | |
417 | vcsbackend_hg.add_file(target_repo, 'README_MERGE1', 'Version 1') |
|
417 | vcsbackend_hg.add_file(target_repo, b'README_MERGE1', b'Version 1') | |
418 | target_repo = MercurialRepository(target_repo.path) |
|
418 | target_repo = MercurialRepository(target_repo.path) | |
419 | target_rev = target_repo.branches['default'] |
|
419 | target_rev = target_repo.branches['default'] | |
420 | target_ref = Reference( |
|
420 | target_ref = Reference( | |
421 | type='branch', name='default', commit_id=target_rev) |
|
421 | type='branch', name='default', commit_id=target_rev) | |
422 | vcsbackend_hg.add_file(source_repo, 'README_MERGE2', 'Version 2') |
|
422 | vcsbackend_hg.add_file(source_repo, b'README_MERGE2', b'Version 2') | |
423 | source_repo = MercurialRepository(source_repo.path) |
|
423 | source_repo = MercurialRepository(source_repo.path) | |
424 | source_rev = source_repo.branches['default'] |
|
424 | source_rev = source_repo.branches['default'] | |
425 | source_ref = Reference( |
|
425 | source_ref = Reference( | |
@@ -686,8 +686,8 b' TODO: To be written...' | |||||
686 | def test_merge_rebase_source_is_updated_bookmark(self, vcsbackend_hg): |
|
686 | def test_merge_rebase_source_is_updated_bookmark(self, vcsbackend_hg): | |
687 | target_repo = vcsbackend_hg.create_repo(number_of_commits=1) |
|
687 | target_repo = vcsbackend_hg.create_repo(number_of_commits=1) | |
688 | source_repo = vcsbackend_hg.clone_repo(target_repo) |
|
688 | source_repo = vcsbackend_hg.clone_repo(target_repo) | |
689 | vcsbackend_hg.add_file(target_repo, 'README_MERGE1', 'Version 1') |
|
689 | vcsbackend_hg.add_file(target_repo, b'README_MERGE1', b'Version 1') | |
690 | vcsbackend_hg.add_file(source_repo, 'README_MERGE2', 'Version 2') |
|
690 | vcsbackend_hg.add_file(source_repo, b'README_MERGE2', b'Version 2') | |
691 |
|
691 | |||
692 | imc = source_repo.in_memory_commit |
|
692 | imc = source_repo.in_memory_commit | |
693 | imc.add(FileNode(b'file_x', content=safe_bytes(source_repo.name))) |
|
693 | imc.add(FileNode(b'file_x', content=safe_bytes(source_repo.name))) | |
@@ -698,7 +698,7 b' TODO: To be written...' | |||||
698 | target_commit = target_repo.get_commit() |
|
698 | target_commit = target_repo.get_commit() | |
699 | source_commit = source_repo.get_commit() |
|
699 | source_commit = source_repo.get_commit() | |
700 |
|
700 | |||
701 | vcsbackend_hg.add_file(source_repo, 'LICENSE', 'LICENSE Info') |
|
701 | vcsbackend_hg.add_file(source_repo, b'LICENSE', b'LICENSE Info') | |
702 |
|
702 | |||
703 | default_branch = target_repo.DEFAULT_BRANCH_NAME |
|
703 | default_branch = target_repo.DEFAULT_BRANCH_NAME | |
704 | bookmark_name = 'bookmark' |
|
704 | bookmark_name = 'bookmark' |
General Comments 0
You need to be logged in to leave comments.
Login now