Merge lp:~openerp-dev/openerp-tools/trunk-bzr-export into lp:openerp-tools

Proposed by Antony Lesuisse (OpenERP) on 2012-04-25
Status: Needs review
Proposed branch: lp:~openerp-dev/openerp-tools/trunk-bzr-export
Merge into: lp:openerp-tools
Diff against target: 65 lines (+20/-6)
1 file modified
openerp-runbot/openerprunbot/core.py (+20/-6)
To merge this branch: bzr merge lp:~openerp-dev/openerp-tools/trunk-bzr-export
Reviewer Review Type Date Requested Status
OpenERP R&D Team 2012-04-25 Pending
Review via email: mp+103583@code.launchpad.net

Description of the change

bzr export

To post a comment you must log in.

Unmerged revisions

182. By Antony Lesuisse (OpenERP) on 2012-04-25

runbot bzr export fix for revno

181. By Antony Lesuisse (OpenERP) on 2012-04-25

runbot use bzr export

180. By OpenERP Online on 2012-04-25

packaging 6.1 cleanup client

179. By OpenERP Online on 2012-04-19

[IMP] runbot: added favicon.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openerp-runbot/openerprunbot/core.py'
2--- openerp-runbot/openerprunbot/core.py 2012-04-19 14:46:42 +0000
3+++ openerp-runbot/openerprunbot/core.py 2012-04-25 22:55:22 +0000
4@@ -418,6 +418,7 @@
5 self.subdomain = "%s-%s-%s"%(self.team_name, self.name.replace('_','-').replace('.','-'),self.job_id)
6 self.running_path = os.path.join(g.runbot.wd,'static',self.subdomain)
7 self.json_path = g.json_path
8+ self.tmp_path = os.path.join(self.running_path,'tmp')
9 self.log_path = os.path.join(self.running_path,'logs')
10 self.flags_path = os.path.join(self.running_path,'flags')
11
12@@ -485,10 +486,11 @@
13 for b in self.repo_updates:
14 log("branch-update",branch=b.unique_name)
15 if os.path.exists(b.repo_path):
16- run(["bzr", "pull", "-d", b.repo_path, "--overwrite"])
17+ run(["bzr", "pull", "-d", b.repo_path])
18 else:
19- run(["bzr", "branch", "lp:%s"%b.unique_name, b.repo_path])
20- run(["bzr", "update", "-r", str(b.local_revision_count), b.repo_path])
21+ run(["bzr", "branch", "--no-tree", "lp:%s"%b.unique_name, b.repo_path])
22+ #run(["bzr", "update", "-r", str(b.local_revision_count), b.repo_path])
23+ # this should be passed at bzr export
24
25 committer_name, committer_xgram, committer_email = \
26 get_committer_info(b.repo_path)
27@@ -496,13 +498,19 @@
28 b.committer_xgram = committer_xgram
29 b.committer_email = committer_email
30
31+ def move_files(self,src,dest):
32+ for i in os.listdir(src):
33+ os.rename(os.path.join(src,i),os.path.join(dest,i))
34+
35 def start_rsync(self):
36 log("job-start-rsync",branch=self.name)
37 for i in [self.running_path,self.log_path,self.flags_path,self.client_web_doc_path]:
38 if not os.path.exists(i):
39 os.makedirs(i)
40 # copy server
41- run(["rsync","-a","--exclude",".bzr","--delete", "%s/"%self.server_src, self.server_path])
42+ #run(["rsync","-a","--exclude",".bzr","--delete", "%s/"%self.server_src, self.server_path])
43+ revno = str([b.local_revision_count for b in self.repo_updates if b.repo_path == self.server_src][0])
44+ run(["bzr","-r",revno,"export",self.server_path,self.server_src])
45
46 # copy addons (6.0 uses bin/addons, 6.1 and trunk use openerp/addons)
47 addons_dest = "openerp/addons"
48@@ -510,9 +518,15 @@
49 addons_dest = "bin/addons"
50 addons_path = os.path.join(self.server_path,addons_dest)
51 for a in self.addons_src:
52- run(["rsync","-a","--exclude",".bzr", "%s/"%a, addons_path])
53+ #run(["rsync","-a","--exclude",".bzr", "%s/"%a, addons_path])
54+ revno = str([b.local_revision_count for b in self.repo_updates if b.repo_path == a][0])
55+ run(["bzr","r",revno,"export",self.tmp_path,a])
56+ self.move_files(self.tmp_path,addons_path)
57 if self.web_src and self.version != '6.0':
58- run(["rsync","-a","--exclude",".bzr", "%s/addons/"%self.web_src, addons_path])
59+ #run(["rsync","-a","--exclude",".bzr", "%s/addons/"%self.web_src, addons_path])
60+ revno = str([b.local_revision_count for b in self.repo_updates if b.repo_path == self.web_src][0])
61+ run(["bzr","r",revno,"export",self.tmp_path,self.web_src])
62+ self.move_files(self.tmp_path,addons_path)
63
64 # copy web-client
65 if self.client_web_src: