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