fix(git): moved certain operations into vcsserver
This commit is contained in:
parent
104671c5e7
commit
4bd1cec615
2 changed files with 15 additions and 12 deletions
7
Makefile
7
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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue