[FIX] forwardport: don't keep the commit date

This is not super useful and causes issues with runbot as it uses
commit dates to decide how "old" branches are, and ignores (doesn't
create when it scans them) branches more than a month old.

So the forwardport branches will be completely ignored (not considered
let alone tested) if we happen to forward-port a PR last updated more
than a month ago. Which is somewhat inconvenient.

Closes #274
This commit is contained in:
Xavier Morel 2019-12-19 15:25:23 +01:00
parent 328ba2d9c2
commit 7d79ad8d3e
2 changed files with 4 additions and 2 deletions

View File

@ -702,6 +702,7 @@ More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port
conf = working_copy.with_config(env={
**to_dict('AUTHOR', author),
**to_dict('COMMITTER', committer),
'GIT_COMMITTER_DATE': '',
})
# squash to a single commit
conf.reset('--soft', root_commits[0]['parents'][0]['sha'])
@ -759,7 +760,6 @@ stderr:
'GIT_AUTHOR_DATE': cm['author']['date'],
'GIT_COMMITTER_NAME': cm['committer']['name'],
'GIT_COMMITTER_EMAIL': cm['committer']['email'],
'GIT_COMMITTER_DATE': cm['committer']['date'],
})
conf = configured.with_config(stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False)

View File

@ -389,7 +389,9 @@ def test_conflict(env, config, make_repo):
p = prod.commit(p_0)
c = prod.commit(pr1.head)
assert c.author == p.author
assert c.committer == p.committer
# ignore date as we're specifically not keeping the original's
without_date = itemgetter('name', 'email')
assert without_date(c.committer) == without_date(p.committer)
assert prod.read_tree(c) == {
'f': 'c',
'g': re_matches(r'''<<<\x3c<<< HEAD