mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[FIX] forwardport: attempt no renamelimit & filter out messages
* a high renamelimit increases the cherrypick runtime and can apparently fail for reasons other than actual conflicts (cf odoo/odoo#36893) so first attempt to cherrypick with the default renamelimit, and fallback to renamelimit=0 if that fails * in that case, filter out the spam of "progress" messages about inexact rename detection as it's not really useful. There seems to be no built-in way to suppress these. Closes #196
This commit is contained in:
parent
0a64699070
commit
8976f9e310
@ -588,25 +588,39 @@ stderr:
|
|||||||
cmap = json.loads(self.commits_map)
|
cmap = json.loads(self.commits_map)
|
||||||
|
|
||||||
# original head so we can reset
|
# original head so we can reset
|
||||||
h = working_copy.stdout().rev_parse('HEAD').stdout
|
original_head = working_copy.stdout().rev_parse('HEAD').stdout.decode().strip()
|
||||||
|
|
||||||
commits = self.commits()
|
commits = self.commits()
|
||||||
logger.info("%s: %s commits in %s", self, len(commits), h.decode())
|
logger.info("%s: %s commits in %s", self, len(commits), original_head)
|
||||||
for c in commits:
|
for c in commits:
|
||||||
logger.debug('- %s (%s)', c['sha'], c['commit']['message'])
|
logger.debug('- %s (%s)', c['sha'], c['commit']['message'])
|
||||||
|
|
||||||
for commit in commits:
|
for commit in commits:
|
||||||
commit_sha = commit['sha']
|
commit_sha = commit['sha']
|
||||||
r = working_copy.with_params('merge.renamelimit=0').with_config(
|
conf = working_copy.with_config(stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False)
|
||||||
stdout=subprocess.PIPE,
|
# first try with default / low renamelimit
|
||||||
stderr=subprocess.PIPE,
|
r = conf.cherry_pick(commit_sha)
|
||||||
check=False,
|
_logger.debug("Cherry-picked %s: %s\n%s\n%s", commit_sha, r.returncode, r.stdout.decode(), r.stderr.decode())
|
||||||
).cherry_pick(commit_sha)
|
if r.returncode:
|
||||||
|
# if it failed, retry with high renamelimit
|
||||||
|
working_copy.reset('--hard', original_head)
|
||||||
|
r = conf.with_params('merge.renamelimit=0').cherry_pick(commit_sha)
|
||||||
|
_logger.debug("Cherry-picked %s (renamelimit=0): %s\n%s\n%s", commit_sha, r.returncode, r.stdout.decode(), r.stderr.decode())
|
||||||
|
|
||||||
if r.returncode: # pick failed, reset and bail
|
if r.returncode: # pick failed, reset and bail
|
||||||
logger.info("%s: failed", commit_sha)
|
logger.info("%s: failed", commit_sha)
|
||||||
working_copy.reset('--hard', h.decode().strip())
|
working_copy.reset('--hard', original_head)
|
||||||
raise CherrypickError(commit_sha, r.stdout.decode(), r.stderr.decode())
|
raise CherrypickError(
|
||||||
|
commit_sha,
|
||||||
|
r.stdout.decode(),
|
||||||
|
# Don't include the inexact rename detection spam in the
|
||||||
|
# feedback, it's useless. There seems to be no way to
|
||||||
|
# silence these messages.
|
||||||
|
'\n'.join(
|
||||||
|
line for line in r.stderr.decode().splitlines()
|
||||||
|
if not line.startswith('Performing inexact rename detection')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
msg = self._parse_commit_message(commit['commit']['message'])
|
msg = self._parse_commit_message(commit['commit']['message'])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user