mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Don't backport base commit of branch in the same branch (#20628)
This commit is contained in:
parent
d15bac31ff
commit
42c22475e3
@ -62,7 +62,7 @@ class Backport:
|
||||
RE_NO_BACKPORT = re.compile(r'^v(\d+\.\d+)-no-backport$')
|
||||
RE_BACKPORTED = re.compile(r'^v(\d+\.\d+)-backported$')
|
||||
|
||||
# pull-requests are sorted by ancestry from the least recent.
|
||||
# pull-requests are sorted by ancestry from the most recent.
|
||||
for pr in pull_requests:
|
||||
while repo.comparator(branches[-1][1]) >= repo.comparator(pr['mergeCommit']['oid']):
|
||||
logging.info("PR #{} is already inside {}. Dropping this branch for further PRs".format(pr['number'], branches[-1][0]))
|
||||
|
@ -6,15 +6,15 @@ import os
|
||||
import re
|
||||
|
||||
|
||||
class RepositoryBase(object):
|
||||
class RepositoryBase:
|
||||
def __init__(self, repo_path):
|
||||
import git
|
||||
|
||||
self._repo = git.Repo(repo_path, search_parent_directories=(not repo_path))
|
||||
|
||||
# commit comparator
|
||||
# comparator of commits
|
||||
def cmp(x, y):
|
||||
if x == y:
|
||||
if str(x) == str(y):
|
||||
return 0
|
||||
if self._repo.is_ancestor(x, y):
|
||||
return -1
|
||||
|
Loading…
Reference in New Issue
Block a user