Merge lp:~jelmer/bzr-builddeb/dep3-fixes into lp:bzr-builddeb

Proposed by Jelmer Vernooij
Status: Merged
Approved by: James Westby
Approved revision: 649
Merged at revision: 648
Proposed branch: lp:~jelmer/bzr-builddeb/dep3-fixes
Merge into: lp:bzr-builddeb
Diff against target: 134 lines (+58/-48)
3 files modified
cmds.py (+47/-47)
debian/changelog (+3/-1)
tests/blackbox/test_dep3.py (+8/-0)
To merge this branch: bzr merge lp:~jelmer/bzr-builddeb/dep3-fixes
Reviewer Review Type Date Requested Status
James Westby Approve
Review via email: mp+83481@code.launchpad.net

Description of the change

Some fixes for 'bzr dep3-patch':

 * Allow open ended revision ranges (-r-4..)
 * Support extracting patches from remote repositories

To post a comment you must log in.
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-11-10 18:44:05 +0000
+++ cmds.py 2011-11-26 15:11:23 +0000
@@ -1301,51 +1301,51 @@
1301 )1301 )
1302 packaging_tree, packaging_branch = BzrDir.open_containing_tree_or_branch(1302 packaging_tree, packaging_branch = BzrDir.open_containing_tree_or_branch(
1303 directory)[:2]1303 directory)[:2]
1304 self.add_cleanup(packaging_branch.lock_read().unlock)
1304 tree, branch = BzrDir.open_containing_tree_or_branch(location)[:2]1305 tree, branch = BzrDir.open_containing_tree_or_branch(location)[:2]
1305 branch.lock_read()1306 self.add_cleanup(branch.lock_read().unlock)
1306 try:1307 if revision is not None and len(revision) >= 1:
1307 if revision is not None and len(revision) >= 1:1308 revision_id = revision[-1].as_revision_id(branch)
1308 revision_id = revision[-1].as_revision_id(branch)1309 else:
1309 else:1310 revision_id = None
1310 revision_id = branch.last_revision()1311 if revision_id is None:
1311 graph = branch.repository.get_graph(packaging_branch.repository)1312 revision_id = branch.last_revision()
1312 if revision is not None and len(revision) == 2:1313 graph = branch.repository.get_graph(packaging_branch.repository)
1313 base_revid = revision[0].as_revision_id(branch)1314 if revision is not None and len(revision) == 2:
1314 else:1315 base_revid = revision[0].as_revision_id(branch)
1315 base_revid = graph.find_unique_lca(revision_id,1316 else:
1316 packaging_branch.last_revision())1317 base_revid = graph.find_unique_lca(revision_id,
1317 interesting_revision_ids = graph.find_unique_ancestors(revision_id,1318 packaging_branch.last_revision())
1318 [base_revid])1319 interesting_revision_ids = graph.find_unique_ancestors(revision_id,
1319 if len(interesting_revision_ids) == 0:1320 [base_revid])
1320 raise BzrCommandError("No unmerged revisions")1321 if len(interesting_revision_ids) == 0:
1321 (bugs, authors, last_update) = gather_bugs_and_authors(branch.repository,1322 raise BzrCommandError("No unmerged revisions")
1322 interesting_revision_ids)1323 (bugs, authors, last_update) = gather_bugs_and_authors(branch.repository,
1323 config = branch.get_config()1324 interesting_revision_ids)
1324 description = config.get_user_option("description")1325 config = branch.get_config()
1325 if description is None:1326 description = config.get_user_option("description")
1326 # if there's just one revision in the mainline history, use1327 if description is None:
1327 # that revisions commits message1328 # if there's just one revision in the mainline history, use
1328 lhs_history = graph.iter_lefthand_ancestry(revision_id, [base_revid])1329 # that revisions commits message
1329 rev = branch.repository.get_revision(lhs_history.next())1330 lhs_history = graph.iter_lefthand_ancestry(revision_id, [base_revid])
1330 try:1331 rev = branch.repository.get_revision(lhs_history.next())
1331 lhs_history.next()1332 try:
1332 except StopIteration:1333 lhs_history.next()
1333 description = rev.message1334 except StopIteration:
1334 origin = describe_origin(branch, revision_id)1335 description = rev.message
1335 if packaging_tree is None:1336 origin = describe_origin(branch, revision_id)
1336 packaging_tree = packaging_branch.basis_tree()1337 if packaging_tree is None:
1337 builddeb_config = debuild_config(packaging_tree, True)1338 packaging_tree = packaging_branch.basis_tree()
1338 if not no_upstream_check and builddeb_config.upstream_branch:1339 builddeb_config = debuild_config(packaging_tree, True)
1339 upstream_branch = Branch.open(builddeb_config.upstream_branch)1340 if not no_upstream_check and builddeb_config.upstream_branch:
1340 applied_upstream = determine_applied_upstream(upstream_branch, branch,1341 upstream_branch = Branch.open(builddeb_config.upstream_branch)
1341 revision_id)1342 applied_upstream = determine_applied_upstream(upstream_branch, branch,
1342 forwarded = determine_forwarded(upstream_branch, branch, revision_id)1343 revision_id)
1343 else:1344 forwarded = determine_forwarded(upstream_branch, branch, revision_id)
1344 applied_upstream = None1345 else:
1345 forwarded = None1346 applied_upstream = None
1346 write_dep3_patch(self.outf, branch, base_revid,1347 forwarded = None
1347 revision_id, bugs=bugs, authors=authors, origin=origin,1348 write_dep3_patch(self.outf, branch, base_revid,
1348 forwarded=forwarded, applied_upstream=applied_upstream,1349 revision_id, bugs=bugs, authors=authors, origin=origin,
1349 description=description, last_update=last_update)1350 forwarded=forwarded, applied_upstream=applied_upstream,
1350 finally:1351 description=description, last_update=last_update)
1351 branch.unlock()
13521352
=== modified file 'debian/changelog'
--- debian/changelog 2011-11-22 14:05:25 +0000
+++ debian/changelog 2011-11-26 15:11:23 +0000
@@ -23,8 +23,10 @@
23 * Support --revision argument to merge-package. LP: #88859023 * Support --revision argument to merge-package. LP: #888590
24 * By default, don't override the commit message from debian/changelog24 * By default, don't override the commit message from debian/changelog
25 unless 'commit-message-from-changelog' is explicitly set to True. LP: #81274925 unless 'commit-message-from-changelog' is explicitly set to True. LP: #812749
26 * Support running dep3-patch against remote repositories, and with
27 open-ended revision ranges. LP: #893608
2628
27 -- Jelmer Vernooij <jelmer@debian.org> Tue, 22 Nov 2011 12:04:47 +010029 -- Jelmer Vernooij <jelmer@debian.org> Sat, 26 Nov 2011 16:01:16 +0100
2830
29bzr-builddeb (2.7.9) unstable; urgency=low31bzr-builddeb (2.7.9) unstable; urgency=low
3032
3133
=== modified file 'tests/blackbox/test_dep3.py'
--- tests/blackbox/test_dep3.py 2011-06-21 20:55:13 +0000
+++ tests/blackbox/test_dep3.py 2011-11-26 15:11:23 +0000
@@ -126,3 +126,11 @@
126 "-bar\n"126 "-bar\n"
127 "+bla\n"127 "+bla\n"
128 "\n")128 "\n")
129
130 def test_open_ended_range(self):
131 # If there is a single revision the commit message from
132 # that revision will be used.
133 self.feature_tree.commit(message="A message", timestamp=1304850124,
134 timezone=0, authors=["Jelmer <jelmer@debian.org>"])
135 (out, err) = self.run_bzr("dep3-patch -d packaging feature -r-2..")
136 self.assertContainsRe(out, "Description: A message\n")

Subscribers

People subscribed via source and target branches