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
=== modified file 'scripts/update-deployment.py'
--- scripts/update-deployment.py 2012-08-23 17:13:58 +0000
+++ scripts/update-deployment.py 2012-08-23 18:46:23 +0000
@@ -34,8 +34,6 @@
3434
35"""35"""
3636
37import bzrlib.branch
38import bzrlib.workingtree
39import os37import os
40import subprocess38import subprocess
4139
@@ -64,25 +62,8 @@
6462
65 def refresh_branch(self, branch_dir):63 def refresh_branch(self, branch_dir):
66 """Refreshes a branch checked-out to a branch_dir."""64 """Refreshes a branch checked-out to a branch_dir."""
6765 self.run_subcommand(["bzr", "pull"], branch_dir)
68 code_branch = bzrlib.branch.Branch.open(branch_dir)66 self.run_subcommand(["bzr", "up"], branch_dir)
69 parent_branch = bzrlib.branch.Branch.open(
70 code_branch.get_parent())
71 result = code_branch.pull(source=parent_branch)
72 if result.old_revno != result.new_revno:
73 self.logger.info("Updated %s from %d to %d.",
74 branch_dir, result.old_revno, result.new_revno)
75 else:
76 self.logger.info(
77 "No changes to pull from %s.", code_branch.get_parent())
78 self.logger.debug("Updating working tree in %s.", branch_dir)
79 self.update_tree(branch_dir)
80 return code_branch
81
82 def update_tree(self, working_tree_dir):
83 """Does a checkout update."""
84 code_tree = bzrlib.workingtree.WorkingTree.open(working_tree_dir)
85 code_tree.update()
8667
87 def run_subcommand(self, arguments, cwd=None):68 def run_subcommand(self, arguments, cwd=None):
88 process = subprocess.Popen(arguments, cwd=cwd, stdout=subprocess.PIPE,69 process = subprocess.Popen(arguments, cwd=cwd, stdout=subprocess.PIPE,

Subscribers

People subscribed via source and target branches