##// END OF EJS Templates
fix(git): moved certain operations into vcsserver
super-admin -
r5624:9e5bec79 default
parent child Browse files
Show More
@@ -83,6 +83,13 b' test-only:'
83 py.test -x -vv -r xw -p no:sugar \
83 py.test -x -vv -r xw -p no:sugar \
84 rhodecode/tests/database
84 rhodecode/tests/database
85
85
86 .PHONY: test-simple
87 # test-simple: Run tests only for main test suite witout coverage
88 test-simple:
89 PYTHONHASHSEED=random \
90 py.test -x -vv -r xw -p no:sugar \
91 --ignore=rhodecode/tests/vcs_operations \
92 --ignore=rhodecode/tests/database
86
93
87 # >>> Docs commands
94 # >>> Docs commands
88
95
@@ -608,8 +608,7 b' class GitRepository(BaseRepository):'
608 return commit_id1
608 return commit_id1
609
609
610 if self != repo2:
610 if self != repo2:
611 commits = self._remote.get_missing_revs(
611 commits = self._remote.get_missing_revs(commit_id1, commit_id2, repo2.path)
612 commit_id1, commit_id2, repo2.path)
613 if commits:
612 if commits:
614 commit = repo2.get_commit(commits[-1])
613 commit = repo2.get_commit(commits[-1])
615 if commit.parents:
614 if commit.parents:
@@ -620,9 +619,7 b' class GitRepository(BaseRepository):'
620 # no commits from other repo, ancestor_id is the commit_id2
619 # no commits from other repo, ancestor_id is the commit_id2
621 ancestor_id = commit_id2
620 ancestor_id = commit_id2
622 else:
621 else:
623 output, __ = self.run_git_command(
622 ancestor_id = self._remote.get_common_ancestor(commit_id1, commit_id2)
624 ['merge-base', commit_id1, commit_id2])
625 ancestor_id = self.COMMIT_ID_PAT.findall(output)[0]
626
623
627 log.debug('Found common ancestor with sha: %s', ancestor_id)
624 log.debug('Found common ancestor with sha: %s', ancestor_id)
628
625
@@ -630,23 +627,22 b' class GitRepository(BaseRepository):'
630
627
631 def compare(self, commit_id1, commit_id2, repo2, merge, pre_load=None):
628 def compare(self, commit_id1, commit_id2, repo2, merge, pre_load=None):
632 repo1 = self
629 repo1 = self
633 ancestor_id = None
634
630
635 if commit_id1 == commit_id2:
631 if commit_id1 == commit_id2:
636 commits = []
632 commits = []
637 elif repo1 != repo2:
633 elif repo1 != repo2:
638 missing_ids = self._remote.get_missing_revs(commit_id1, commit_id2,
634 missing_ids = self._remote.get_missing_revs(commit_id1, commit_id2, repo2.path)
639 repo2.path)
640 commits = [
635 commits = [
641 repo2.get_commit(commit_id=commit_id, pre_load=pre_load)
636 repo2.get_commit(commit_id=commit_id, pre_load=pre_load)
642 for commit_id in reversed(missing_ids)]
637 for commit_id in reversed(missing_ids)]
643 else:
638 else:
644 output, __ = repo1.run_git_command(
639 compare_commits = self._remote.compare_commits(
645 ['log', '--reverse', '--pretty=format: %H', '-s',
640 commit_id1, commit_id2
646 f'{commit_id1}..{commit_id2}'])
641 )
647 commits = [
642 commits = [
648 repo1.get_commit(commit_id=commit_id, pre_load=pre_load)
643 repo1.get_commit(commit_id=commit_id, pre_load=pre_load)
649 for commit_id in self.COMMIT_ID_PAT.findall(output)]
644 for commit_id in compare_commits]
645
650
646
651 return commits
647 return commits
652
648
General Comments 0
You need to be logged in to leave comments. Login now