Merge lp:~jelmer/bzr-builddeb/676456-wt-relative into lp:bzr-builddeb

Proposed by Jelmer Vernooij
Status: Merged
Merged at revision: 504
Proposed branch: lp:~jelmer/bzr-builddeb/676456-wt-relative
Merge into: lp:bzr-builddeb
Diff against target: 80 lines (+13/-10)
2 files modified
cmds.py (+10/-9)
debian/changelog (+3/-1)
To merge this branch: bzr merge lp:~jelmer/bzr-builddeb/676456-wt-relative
Reviewer Review Type Date Requested Status
James Westby Approve
Review via email: mp+47948@code.launchpad.net

Description of the change

Remember the location of the working tree or branch that was originally specified for building, and use that location when determining the relative path to which to build.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

This also fixes the use of bzr-builddeb in svn working trees (which have a remote branch, but will have is_local set to True), as occurs in 605585.

Revision history for this message
James Westby (james-w) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'cmds.py'
--- cmds.py 2011-01-29 02:51:40 +0000
+++ cmds.py 2011-01-30 23:46:11 +0000
@@ -213,8 +213,9 @@
213 if location is None:213 if location is None:
214 location = "."214 location = "."
215 is_local = urlparse.urlsplit(location)[0] in ('', 'file')215 is_local = urlparse.urlsplit(location)[0] in ('', 'file')
216 tree, branch, relpath = BzrDir.open_containing_tree_or_branch(location)216 bzrdir, relpath = BzrDir.open_containing(location)
217 return tree, branch, is_local217 tree, branch = bzrdir._get_tree_branch()
218 return tree, branch, is_local, bzrdir.user_url
218219
219 def _get_build_tree(self, revision, tree, branch):220 def _get_build_tree(self, revision, tree, branch):
220 if revision is None and tree is not None:221 if revision is None and tree is not None:
@@ -256,7 +257,7 @@
256 builder += " " + " ".join(build_options)257 builder += " " + " ".join(build_options)
257 return builder258 return builder
258259
259 def _get_dirs(self, config, branch, is_local, result_dir, build_dir, orig_dir):260 def _get_dirs(self, config, location, is_local, result_dir, build_dir, orig_dir):
260 def _get_dir(supplied, if_local, if_not):261 def _get_dir(supplied, if_local, if_not):
261 if supplied is None:262 if supplied is None:
262 if is_local:263 if is_local:
@@ -266,7 +267,7 @@
266 if supplied is not None:267 if supplied is not None:
267 if is_local:268 if is_local:
268 supplied = os.path.join(269 supplied = os.path.join(
269 urlutils.local_path_from_url(branch.base),270 urlutils.local_path_from_url(location),
270 supplied)271 supplied)
271 supplied = os.path.realpath(supplied)272 supplied = os.path.realpath(supplied)
272 return supplied273 return supplied
@@ -334,9 +335,9 @@
334 source=False, revision=None, result=None, package_merge=None):335 source=False, revision=None, result=None, package_merge=None):
335 if result is not None:336 if result is not None:
336 warning("--result is deprected, use --result-dir instead")337 warning("--result is deprected, use --result-dir instead")
337 branch, build_options, source = self._branch_and_build_options(338 location, build_options, source = self._branch_and_build_options(
338 branch_or_build_options_list, source)339 branch_or_build_options_list, source)
339 tree, branch, is_local = self._get_tree_and_branch(branch)340 tree, branch, is_local, location = self._get_tree_and_branch(location)
340 tree, working_tree = self._get_build_tree(revision, tree, branch)341 tree, working_tree = self._get_build_tree(revision, tree, branch)
341342
342 if len(tree.conflicts()) > 0:343 if len(tree.conflicts()) > 0:
@@ -374,8 +375,8 @@
374 build_options.append("-sa")375 build_options.append("-sa")
375 build_cmd = self._get_build_command(config, builder, quick,376 build_cmd = self._get_build_command(config, builder, quick,
376 build_options)377 build_options)
377 result_dir, build_dir, orig_dir = self._get_dirs(config, branch,378 result_dir, build_dir, orig_dir = self._get_dirs(config,
378 is_local, result_dir or result, build_dir, orig_dir)379 location or ".", is_local, result_dir or result, build_dir, orig_dir)
379380
380 upstream_sources = [381 upstream_sources = [
381 PristineTarSource(tree, branch),382 PristineTarSource(tree, branch),
@@ -450,7 +451,7 @@
450 if is_local:451 if is_local:
451 target_dir = result_dir or default_result_dir452 target_dir = result_dir or default_result_dir
452 target_dir = os.path.join(453 target_dir = os.path.join(
453 urlutils.local_path_from_url(branch.base),454 urlutils.local_path_from_url(location),
454 target_dir)455 target_dir)
455 else:456 else:
456 target_dir = "."457 target_dir = "."
457458
=== modified file 'debian/changelog'
--- debian/changelog 2011-01-29 03:29:44 +0000
+++ debian/changelog 2011-01-30 23:46:11 +0000
@@ -35,8 +35,10 @@
35 * 'bzr merge-upstream' now also works in merge mode, and will simply35 * 'bzr merge-upstream' now also works in merge mode, and will simply
36 add a new entry for new upstream versions.36 add a new entry for new upstream versions.
37 * merge-upstream will now keep epochs around. LP: #62267837 * merge-upstream will now keep epochs around. LP: #622678
38 * 'bzr builddeb' now searches for directories relative to the working
39 tree rather than relative to the branch. Closes: #676456
3840
39 -- Jelmer Vernooij <jelmer@debian.org> Sat, 29 Jan 2011 04:29:41 +010041 -- Jelmer Vernooij <jelmer@debian.org> Sun, 30 Jan 2011 23:09:45 +0100
4042
41bzr-builddeb (2.5) unstable; urgency=low43bzr-builddeb (2.5) unstable; urgency=low
4244

Subscribers

People subscribed via source and target branches