Merge lp:~jelmer/bzr-builddeb/multi-tarball-pt8 into lp:bzr-builddeb

Proposed by Jelmer Vernooij
Status: Merged
Approved by: James Westby
Approved revision: 601
Merged at revision: 586
Proposed branch: lp:~jelmer/bzr-builddeb/multi-tarball-pt8
Merge into: lp:bzr-builddeb
Prerequisite: lp:~jelmer/bzr-builddeb/multi-tarball-pt7
Diff against target: 161 lines (+64/-46)
3 files modified
cmds.py (+1/-1)
import_dsc.py (+40/-42)
upstream/pristinetar.py (+23/-3)
To merge this branch: bzr merge lp:~jelmer/bzr-builddeb/multi-tarball-pt8
Reviewer Review Type Date Requested Status
James Westby Approve
Review via email: mp+68225@code.launchpad.net

This proposal supersedes a proposal from 2011-07-18.

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-06-28 08:41:44 +0000
+++ cmds.py 2011-07-18 10:01:30 +0000
@@ -964,7 +964,7 @@
964 db.extract_upstream_tree(parents[0], tempdir)964 db.extract_upstream_tree(parents[0], tempdir)
965 else:965 else:
966 db._create_empty_upstream_tree(tempdir)966 db._create_empty_upstream_tree(tempdir)
967 tree = db.get_branch_tip_revtree()967 tree = db.branch.basis_tree()
968 tree.lock_read()968 tree.lock_read()
969 dbs = DistributionBranchSet()969 dbs = DistributionBranchSet()
970 dbs.add_branch(db)970 dbs.add_branch(db)
971971
=== modified file 'import_dsc.py'
--- import_dsc.py 2011-07-18 10:01:30 +0000
+++ import_dsc.py 2011-07-18 10:01:30 +0000
@@ -818,46 +818,48 @@
818 % (version, upstream_part, str(upstream_parents)))818 % (version, upstream_part, str(upstream_parents)))
819 assert self.pristine_upstream_tree is not None, \819 assert self.pristine_upstream_tree is not None, \
820 "Can't import upstream with no tree"820 "Can't import upstream with no tree"
821 if len(upstream_parents) > 0:
822 parent_revid = upstream_parents[0]
823 else:
824 parent_revid = NULL_REVISION
825 self.pristine_upstream_tree.pull(self.pristine_upstream_tree.branch,
826 overwrite=True, stop_revision=parent_revid)
827 other_branches = self.get_other_branches()821 other_branches = self.get_other_branches()
828 upstream_trees = [o.pristine_upstream_branch.basis_tree()
829 for o in other_branches]
830 target_tree = None
831 if upstream_branch is not None:
832 if upstream_revision is None:
833 upstream_revision = upstream_branch.last_revision()
834 self.pristine_upstream_branch.fetch(upstream_branch,
835 last_revision=upstream_revision)
836 upstream_branch.tags.merge_to(self.pristine_upstream_branch.tags)
837 upstream_parents.append(upstream_revision)
838 target_tree = self.pristine_upstream_branch.repository.revision_tree(
839 upstream_revision)
840 if file_ids_from is not None:
841 upstream_trees = file_ids_from + upstream_trees
842 if self.tree:
843 self_tree = self.tree
844 self_tree.lock_write() # might also be upstream tree for dh_make
845 else:
846 self_tree = self.get_branch_tip_revtree()
847 self_tree.lock_read()
848 try:
849 import_dir(self.pristine_upstream_tree, upstream_part,
850 file_ids_from=[self_tree] + upstream_trees,
851 target_tree=target_tree)
852 finally:
853 self_tree.unlock()
854 revprops = {}
855 ret = []822 ret = []
856 for (tarball, component, md5) in upstream_tarballs:823 for (tarball, component, md5) in upstream_tarballs:
824 upstream_trees = [o.pristine_upstream_branch.basis_tree()
825 for o in other_branches]
826 target_tree = None
827 if upstream_branch is not None:
828 if upstream_revision is None:
829 upstream_revision = upstream_branch.last_revision()
830 self.pristine_upstream_branch.fetch(upstream_branch,
831 last_revision=upstream_revision)
832 upstream_branch.tags.merge_to(self.pristine_upstream_branch.tags)
833 upstream_parents.append(upstream_revision)
834 target_tree = self.pristine_upstream_branch.repository.revision_tree(
835 upstream_revision)
836 if file_ids_from is not None:
837 upstream_trees = file_ids_from + upstream_trees
838 if self.tree:
839 self_tree = self.tree
840 self_tree.lock_write() # might also be upstream tree for dh_make
841 else:
842 self_tree = self.branch.basis_tree()
843 self_tree.lock_read()
844 if len(upstream_parents) > 0:
845 parent_revid = upstream_parents[0]
846 else:
847 parent_revid = NULL_REVISION
848 self.pristine_upstream_tree.pull(self.pristine_upstream_tree.branch,
849 overwrite=True, stop_revision=parent_revid)
850 if component is None:
851 path = upstream_part
852 else:
853 path = os.path.join(upstream_part, component)
854 try:
855 import_dir(self.pristine_upstream_tree, path,
856 file_ids_from=[self_tree] + upstream_trees,
857 target_tree=target_tree)
858 finally:
859 self_tree.unlock()
857 (tag, revid) = self.pristine_upstream_source.import_component_tarball(860 (tag, revid) = self.pristine_upstream_source.import_component_tarball(
858 package, version, self.pristine_upstream_tree, component,861 package, version, self.pristine_upstream_tree, upstream_parents, component,
859 md5, tarball, author=author, timestamp=timestamp,862 md5, tarball, author=author, timestamp=timestamp)
860 parent_ids=upstream_parents)
861 ret.append((component, tag, revid))863 ret.append((component, tag, revid))
862 self.branch.fetch(self.pristine_upstream_branch)864 self.branch.fetch(self.pristine_upstream_branch)
863 self.branch.tags.set_tag(tag, revid)865 self.branch.tags.set_tag(tag, revid)
@@ -887,12 +889,8 @@
887 finally:889 finally:
888 shutil.rmtree(tarball_dir)890 shutil.rmtree(tarball_dir)
889891
890 def get_branch_tip_revtree(self):
891 return self.branch.repository.revision_tree(
892 self.branch.last_revision())
893
894 def _mark_native_config(self, native):892 def _mark_native_config(self, native):
895 poss_native_tree = self.get_branch_tip_revtree()893 poss_native_tree = self.branch.basis_tree()
896 current_native = self._is_tree_native(poss_native_tree)894 current_native = self._is_tree_native(poss_native_tree)
897 current_config = self._default_config_for_tree(poss_native_tree)895 current_config = self._default_config_for_tree(poss_native_tree)
898 dirname = os.path.join(self.tree.basedir, '.bzr-builddeb')896 dirname = os.path.join(self.tree.basedir, '.bzr-builddeb')
@@ -1292,7 +1290,7 @@
1292 if self.tree:1290 if self.tree:
1293 root_id = self.tree.path2id('')1291 root_id = self.tree.path2id('')
1294 else:1292 else:
1295 tip = self.get_branch_tip_revtree()1293 tip = self.branch.basis_tree()
1296 tip.lock_read()1294 tip.lock_read()
1297 try:1295 try:
1298 root_id = tip.path2id('')1296 root_id = tip.path2id('')
12991297
=== modified file 'upstream/pristinetar.py'
--- upstream/pristinetar.py 2011-07-18 10:01:30 +0000
+++ upstream/pristinetar.py 2011-07-18 10:01:30 +0000
@@ -156,9 +156,29 @@
156 self.branch.tags.set_tag(tag_name, revid)156 self.branch.tags.set_tag(tag_name, revid)
157 return tag_name, revid157 return tag_name, revid
158158
159 def import_component_tarball(self, package, version, tree, component=None,159 def import_tarballs(self, package, version, tree, parent_ids, tarballs,
160 md5=None, tarball=None, author=None, timestamp=None,160 timestamp=None, author=None):
161 parent_ids=None):161 """Import the upstream tarballs.
162
163 :param package: Package name
164 :param version: Package version
165 :param path: Path with tree to import
166 :param parent_ids: Parent revisions
167 :param tarballs: List of (path, component, md5)
168 :param timestamp: Optional timestamp for new commits
169 :param author: Optional author for new commits
170 :return: List of tuples with (component, tag, revid)
171 """
172 ret = []
173 for (tarball, component, md5) in tarballs:
174 (tag, revid) = self.import_component_tarball(
175 package, version, tree, parent_ids, component,
176 md5, tarball, author=author, timestamp=timestamp)
177 ret.append((component, tag, revid))
178 return ret
179
180 def import_component_tarball(self, package, version, tree, parent_ids,
181 component=None, md5=None, tarball=None, author=None, timestamp=None):
162 """Import a tarball.182 """Import a tarball.
163183
164 :param package: Package name184 :param package: Package name

Subscribers

People subscribed via source and target branches