mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[FIX] runbot_merge: a few warnings
This commit is contained in:
parent
323aa20053
commit
35f33cee6d
@ -1,11 +1,9 @@
|
|||||||
import collections
|
import collections
|
||||||
import functools
|
import functools
|
||||||
import logging
|
import logging
|
||||||
import pprint
|
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from odoo.exceptions import UserError
|
|
||||||
from . import exceptions
|
from . import exceptions
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
@ -198,7 +198,7 @@ class Repo(object):
|
|||||||
def is_ancestor(self, sha, of):
|
def is_ancestor(self, sha, of):
|
||||||
assert not git.is_ancestor(self.objects, sha, of=of)
|
assert not git.is_ancestor(self.objects, sha, of=of)
|
||||||
|
|
||||||
def _read_ref(self, r, ref):
|
def _read_ref(self, _, ref):
|
||||||
obj = self.refs.get(ref)
|
obj = self.refs.get(ref)
|
||||||
if obj is None:
|
if obj is None:
|
||||||
return (404, None)
|
return (404, None)
|
||||||
@ -282,7 +282,7 @@ class Repo(object):
|
|||||||
"tree": {"sha": body['tree']},
|
"tree": {"sha": body['tree']},
|
||||||
"parents": [{"sha": sha}],
|
"parents": [{"sha": sha}],
|
||||||
})
|
})
|
||||||
def _read_commit(self, r, sha):
|
def _read_commit(self, _, sha):
|
||||||
c = self.objects.get(sha)
|
c = self.objects.get(sha)
|
||||||
if not isinstance(c, Commit):
|
if not isinstance(c, Commit):
|
||||||
return (404, None)
|
return (404, None)
|
||||||
@ -349,7 +349,7 @@ class Repo(object):
|
|||||||
|
|
||||||
return (200, {})
|
return (200, {})
|
||||||
|
|
||||||
def _remove_label(self, r, number, label):
|
def _remove_label(self, _, number, label):
|
||||||
print('remove_label', number, label)
|
print('remove_label', number, label)
|
||||||
try:
|
try:
|
||||||
pr = self.issues[int(number)]
|
pr = self.issues[int(number)]
|
||||||
@ -384,7 +384,7 @@ class Repo(object):
|
|||||||
# get common ancestor (base) of commits
|
# get common ancestor (base) of commits
|
||||||
try:
|
try:
|
||||||
base = git.merge_base(self.objects, target, sha)
|
base = git.merge_base(self.objects, target, sha)
|
||||||
except Exception as e:
|
except Exception:
|
||||||
return (400, {'message': "No common ancestor between %(base)s and %(head)s" % body})
|
return (400, {'message': "No common ancestor between %(base)s and %(head)s" % body})
|
||||||
try:
|
try:
|
||||||
tid = git.merge_objects(
|
tid = git.merge_objects(
|
||||||
@ -534,7 +534,7 @@ class Commit(object):
|
|||||||
return git.make_commit(self.tree, self.message, self.author, self.committer, parents=self.parents)[0]
|
return git.make_commit(self.tree, self.message, self.author, self.committer, parents=self.parents)[0]
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
parents = '\n'.join('parent {p}' for p in self.parents) + '\n'
|
parents = '\n'.join('parent {}'.format(p) for p in self.parents) + '\n'
|
||||||
return """commit {}
|
return """commit {}
|
||||||
tree {}
|
tree {}
|
||||||
{}author {}
|
{}author {}
|
||||||
|
@ -40,6 +40,10 @@ def make_commit(tree, message, author, committer=None, parents=()):
|
|||||||
def walk_ancestors(store, commit, exclude_self=True):
|
def walk_ancestors(store, commit, exclude_self=True):
|
||||||
"""
|
"""
|
||||||
:param store: mapping of hashes to commit objects (w/ a parents attribute)
|
:param store: mapping of hashes to commit objects (w/ a parents attribute)
|
||||||
|
:param str commit: starting commit's hash
|
||||||
|
:param exclude_self: whether the starting commit shoudl be returned as
|
||||||
|
part of the sequence
|
||||||
|
:rtype: Iterator[(str, int)]
|
||||||
"""
|
"""
|
||||||
q = [(commit, 0)]
|
q = [(commit, 0)]
|
||||||
while q:
|
while q:
|
||||||
|
@ -48,7 +48,6 @@ import collections
|
|||||||
import configparser
|
import configparser
|
||||||
import itertools
|
import itertools
|
||||||
import re
|
import re
|
||||||
import signal
|
|
||||||
import socket
|
import socket
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
@ -4,8 +4,6 @@ import pytest
|
|||||||
|
|
||||||
import odoo
|
import odoo
|
||||||
|
|
||||||
from fake_github import git
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def repo(make_repo):
|
def repo(make_repo):
|
||||||
return make_repo('repo')
|
return make_repo('repo')
|
||||||
|
Loading…
Reference in New Issue
Block a user