Merge lp:~dooferlad/linaro-license-protection/just_use_bzr into lp:~linaro-automation/linaro-license-protection/trunk

Proposed by James Tunnicliffe
Status: Merged
Approved by: Данило Шеган
Approved revision: 119
Merged at revision: 117
Proposed branch: lp:~dooferlad/linaro-license-protection/just_use_bzr
Merge into: lp:~linaro-automation/linaro-license-protection/trunk
Diff against target: 40 lines (+2/-21)
1 file modified
scripts/update-deployment.py (+2/-21)
To merge this branch: bzr merge lp:~dooferlad/linaro-license-protection/just_use_bzr
Reviewer Review Type Date Requested Status
Данило Шеган (community) Approve
Review via email: mp+121068@code.launchpad.net

Description of the change

Removed use of bzrlib - just using bzr commands.

To post a comment you must log in.
Revision history for this message
Данило Шеган (danilo) wrote :

Too fast:

$ scripts/update-deployment.py -vvv settings_staging_snapshots
2012-08-23 20:35:24,791 DEBUG: stdout:
Using saved parent location: http://bazaar.launchpad.net/~linaro-infrastructure/linaro-license-protection/trunk/
 Now on revision 116.
2012-08-23 20:35:24,792 DEBUG: stderr:
 M scripts/linaroscript.py
  M scripts/update-deployment.py
 All changes applied successfully.
Traceback (most recent call last):
  File "scripts/update-deployment.py", line 137, in <module>
    script.run()
  File "/home/danilo/linaro/linaro-license-protection/just_use_bzr/scripts/linaroscript.py", line 45, in run
    self.work()
  File "scripts/update-deployment.py", line 124, in work
    self.refresh_branch(code_root)
  File "scripts/update-deployment.py", line 66, in refresh_branch
    self.run_subcommand(["bzr", "up"], working_tree_dir)
NameError: global name 'working_tree_dir' is not defined

Should be s/working_tree_dir/branch_dir/.

Approved with that caveat.

review: Approve
119. By James Tunnicliffe

Fix broken name.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scripts/update-deployment.py'
2--- scripts/update-deployment.py 2012-08-23 17:13:58 +0000
3+++ scripts/update-deployment.py 2012-08-23 18:46:23 +0000
4@@ -34,8 +34,6 @@
5
6 """
7
8-import bzrlib.branch
9-import bzrlib.workingtree
10 import os
11 import subprocess
12
13@@ -64,25 +62,8 @@
14
15 def refresh_branch(self, branch_dir):
16 """Refreshes a branch checked-out to a branch_dir."""
17-
18- code_branch = bzrlib.branch.Branch.open(branch_dir)
19- parent_branch = bzrlib.branch.Branch.open(
20- code_branch.get_parent())
21- result = code_branch.pull(source=parent_branch)
22- if result.old_revno != result.new_revno:
23- self.logger.info("Updated %s from %d to %d.",
24- branch_dir, result.old_revno, result.new_revno)
25- else:
26- self.logger.info(
27- "No changes to pull from %s.", code_branch.get_parent())
28- self.logger.debug("Updating working tree in %s.", branch_dir)
29- self.update_tree(branch_dir)
30- return code_branch
31-
32- def update_tree(self, working_tree_dir):
33- """Does a checkout update."""
34- code_tree = bzrlib.workingtree.WorkingTree.open(working_tree_dir)
35- code_tree.update()
36+ self.run_subcommand(["bzr", "pull"], branch_dir)
37+ self.run_subcommand(["bzr", "up"], branch_dir)
38
39 def run_subcommand(self, arguments, cwd=None):
40 process = subprocess.Popen(arguments, cwd=cwd, stdout=subprocess.PIPE,

Subscribers

People subscribed via source and target branches