diff --git a/Makefile b/Makefile index d20aca27..0ae38701 100644 --- a/Makefile +++ b/Makefile @@ -83,6 +83,13 @@ test-only: py.test -x -vv -r xw -p no:sugar \ rhodecode/tests/database +.PHONY: test-simple +# test-simple: Run tests only for main test suite witout coverage +test-simple: + PYTHONHASHSEED=random \ + py.test -x -vv -r xw -p no:sugar \ + --ignore=rhodecode/tests/vcs_operations \ + --ignore=rhodecode/tests/database # >>> Docs commands diff --git a/rhodecode/lib/vcs/backends/git/repository.py b/rhodecode/lib/vcs/backends/git/repository.py index 1ab47525..c633ccb7 100644 --- a/rhodecode/lib/vcs/backends/git/repository.py +++ b/rhodecode/lib/vcs/backends/git/repository.py @@ -608,8 +608,7 @@ class GitRepository(BaseRepository): return commit_id1 if self != repo2: - commits = self._remote.get_missing_revs( - commit_id1, commit_id2, repo2.path) + commits = self._remote.get_missing_revs(commit_id1, commit_id2, repo2.path) if commits: commit = repo2.get_commit(commits[-1]) if commit.parents: @@ -620,9 +619,7 @@ class GitRepository(BaseRepository): # no commits from other repo, ancestor_id is the commit_id2 ancestor_id = commit_id2 else: - output, __ = self.run_git_command( - ['merge-base', commit_id1, commit_id2]) - ancestor_id = self.COMMIT_ID_PAT.findall(output)[0] + ancestor_id = self._remote.get_common_ancestor(commit_id1, commit_id2) log.debug('Found common ancestor with sha: %s', ancestor_id) @@ -630,23 +627,22 @@ class GitRepository(BaseRepository): def compare(self, commit_id1, commit_id2, repo2, merge, pre_load=None): repo1 = self - ancestor_id = None if commit_id1 == commit_id2: commits = [] elif repo1 != repo2: - missing_ids = self._remote.get_missing_revs(commit_id1, commit_id2, - repo2.path) + missing_ids = self._remote.get_missing_revs(commit_id1, commit_id2, repo2.path) commits = [ repo2.get_commit(commit_id=commit_id, pre_load=pre_load) for commit_id in reversed(missing_ids)] else: - output, __ = repo1.run_git_command( - ['log', '--reverse', '--pretty=format: %H', '-s', - f'{commit_id1}..{commit_id2}']) + compare_commits = self._remote.compare_commits( + commit_id1, commit_id2 + ) commits = [ repo1.get_commit(commit_id=commit_id, pre_load=pre_load) - for commit_id in self.COMMIT_ID_PAT.findall(output)] + for commit_id in compare_commits] + return commits