@@ -252,7 +252,7 @@ def github(self, cr, uid, ids, url, payload=None, ignore_errors=False, context=N
252252 if not repo .token :
253253 return
254254 try :
255- match_object = re .search ('([^/]+)/([^/]+)/([^/]+ )' , repo .base )
255+ match_object = re .search ('([^/]+)/([^/]+)/([^/.]+(.git)? )' , repo .base )
256256 if match_object :
257257 url = url .replace (':owner' , match_object .group (2 ))
258258 url = url .replace (':repo' , match_object .group (3 ))
@@ -584,9 +584,9 @@ def create(self, cr, uid, values, context=None):
584584
585585 # detect duplicate
586586 domain = [
587- ('repo_id' ,'=' ,build .repo_id .duplicate_id .id ),
588- ('name' , '=' , build .name ),
589- ('duplicate_id' , '=' , False ),
587+ ('repo_id' ,'=' ,build .repo_id .duplicate_id .id ),
588+ ('name' , '=' , build .name ),
589+ ('duplicate_id' , '=' , False ),
590590 '|' , ('result' , '=' , False ), ('result' , '!=' , 'skipped' )
591591 ]
592592 duplicate_ids = self .search (cr , uid , domain , context = context )
@@ -1209,7 +1209,7 @@ def repo(self, repo=None, search='', limit='100', refresh='', **post):
12091209 repo_ids = repo_obj .search (cr , uid , [])
12101210 repos = repo_obj .browse (cr , uid , repo_ids )
12111211 if not repo and repos :
1212- repo = repos [0 ]
1212+ repo = repos [0 ]
12131213
12141214 context = {
12151215 'repos' : repos ,
@@ -1243,20 +1243,20 @@ def repo(self, repo=None, search='', limit='100', refresh='', **post):
12431243 branch_ids = uniq_list (sticky_branch_ids + [br [0 ] for br in cr .fetchall ()])
12441244
12451245 build_query = """
1246- SELECT
1247- branch_id,
1246+ SELECT
1247+ branch_id,
12481248 max(case when br_bu.row = 1 then br_bu.build_id end),
12491249 max(case when br_bu.row = 2 then br_bu.build_id end),
12501250 max(case when br_bu.row = 3 then br_bu.build_id end),
12511251 max(case when br_bu.row = 4 then br_bu.build_id end)
12521252 FROM (
1253- SELECT
1254- br.id AS branch_id,
1253+ SELECT
1254+ br.id AS branch_id,
12551255 bu.id AS build_id,
12561256 row_number() OVER (PARTITION BY branch_id) AS row
1257- FROM
1258- runbot_branch br INNER JOIN runbot_build bu ON br.id=bu.branch_id
1259- WHERE
1257+ FROM
1258+ runbot_branch br INNER JOIN runbot_build bu ON br.id=bu.branch_id
1259+ WHERE
12601260 br.id in %s
12611261 GROUP BY br.id, bu.id
12621262 ORDER BY br.id, bu.id DESC
0 commit comments