Merge lp:~jelmer/bzr-builddeb/multiple-upstream-tarballs-pt3 into lp:bzr-builddeb
- multiple-upstream-tarballs-pt3
- Merge into trunk
Proposed by
Jelmer Vernooij
Status: | Superseded |
---|---|
Proposed branch: | lp:~jelmer/bzr-builddeb/multiple-upstream-tarballs-pt3 |
Merge into: | lp:bzr-builddeb |
Prerequisite: | lp:~jelmer/bzr-builddeb/multiple-upstream-tarballs-pt2 |
Diff against target: |
888 lines (+186/-156) 6 files modified
cmds.py (+3/-3) import_dsc.py (+49/-75) tests/test_import_dsc.py (+71/-68) tests/test_merge_package.py (+4/-4) tests/test_util.py (+46/-0) upstream/pristinetar.py (+13/-6) |
To merge this branch: | bzr merge lp:~jelmer/bzr-builddeb/multiple-upstream-tarballs-pt3 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Bzr-builddeb-hackers | Pending | ||
Review via email:
|
This proposal has been superseded by a proposal from 2011-06-15.
Commit message
Description of the change
Another step towards support for multiple upstream tarballs. This simplifies some of the code in import_dsc.
It also adds support for tarballs everywhere but the places deep down where the actual work has to happen:
* PristineTarSour
* DistributionBra
* extract_
* PristineTarSour
Except for the last, these now raise MultipleUpstrea
To post a comment you must log in.
- 585. By Jelmer Vernooij
-
Merge trunk.
Unmerged revisions
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'cmds.py' | |||
2 | --- cmds.py 2011-06-15 16:29:37 +0000 | |||
3 | +++ cmds.py 2011-06-15 16:37:25 +0000 | |||
4 | @@ -870,8 +870,8 @@ | |||
5 | 870 | '..')) | 870 | '..')) |
6 | 871 | try: | 871 | try: |
7 | 872 | if last_version is not None: | 872 | if last_version is not None: |
10 | 873 | if not db.pristine_tar_source.has_version(None, | 873 | if not db.pristine_tar_source.has_version( |
11 | 874 | last_version.upstream_version): | 874 | changelog.package, last_version.upstream_version): |
12 | 875 | raise BzrCommandError("Unable to find the tag for the " | 875 | raise BzrCommandError("Unable to find the tag for the " |
13 | 876 | "previous upstream version, %s, in the branch: %s." | 876 | "previous upstream version, %s, in the branch: %s." |
14 | 877 | " Consider importing it via import-dsc or " | 877 | " Consider importing it via import-dsc or " |
15 | @@ -879,7 +879,7 @@ | |||
16 | 879 | db.pristine_tar_source.tag_name( | 879 | db.pristine_tar_source.tag_name( |
17 | 880 | last_version.upstream_version))) | 880 | last_version.upstream_version))) |
18 | 881 | upstream_tip = db.pristine_tar_source.version_as_revision( | 881 | upstream_tip = db.pristine_tar_source.version_as_revision( |
20 | 882 | None, last_version.upstream_version) | 882 | changelog.package, last_version.upstream_version) |
21 | 883 | db.extract_upstream_tree(upstream_tip, tempdir) | 883 | db.extract_upstream_tree(upstream_tip, tempdir) |
22 | 884 | else: | 884 | else: |
23 | 885 | db._create_empty_upstream_tree(tempdir) | 885 | db._create_empty_upstream_tree(tempdir) |
24 | 886 | 886 | ||
25 | === modified file 'import_dsc.py' | |||
26 | --- import_dsc.py 2011-06-15 16:29:37 +0000 | |||
27 | +++ import_dsc.py 2011-06-15 16:37:25 +0000 | |||
28 | @@ -300,30 +300,6 @@ | |||
29 | 300 | pass | 300 | pass |
30 | 301 | return False | 301 | return False |
31 | 302 | 302 | ||
32 | 303 | def _has_upstream_version(self, branch, tag_name, tarballs=None): | ||
33 | 304 | if branch.tags.has_tag(tag_name): | ||
34 | 305 | revid = branch.tags.lookup_tag(tag_name) | ||
35 | 306 | branch.lock_read() | ||
36 | 307 | try: | ||
37 | 308 | graph = branch.repository.get_graph() | ||
38 | 309 | if not graph.is_ancestor(revid, branch.last_revision()): | ||
39 | 310 | return False | ||
40 | 311 | finally: | ||
41 | 312 | branch.unlock() | ||
42 | 313 | if tarballs is None: | ||
43 | 314 | return True | ||
44 | 315 | if len(tarballs) != 1: | ||
45 | 316 | raise MultipleUpstreamTarballsNotSupported() | ||
46 | 317 | (filename, md5) = tarballs[0] | ||
47 | 318 | rev = branch.repository.get_revision(revid) | ||
48 | 319 | try: | ||
49 | 320 | return rev.properties['deb-md5'] == md5 | ||
50 | 321 | except KeyError: | ||
51 | 322 | warning("tag %s present in branch, but there is no " | ||
52 | 323 | "associated 'deb-md5' property" % tag_name) | ||
53 | 324 | pass | ||
54 | 325 | return False | ||
55 | 326 | |||
56 | 327 | def has_version(self, version, md5=None): | 303 | def has_version(self, version, md5=None): |
57 | 328 | """Whether this branch contains the package version specified. | 304 | """Whether this branch contains the package version specified. |
58 | 329 | 305 | ||
59 | @@ -349,7 +325,7 @@ | |||
60 | 349 | return True | 325 | return True |
61 | 350 | return False | 326 | return False |
62 | 351 | 327 | ||
64 | 352 | def has_upstream_version(self, version, tarballs=None): | 328 | def has_upstream_version(self, package, version, tarballs=None): |
65 | 353 | """Whether this branch contains the upstream version specified. | 329 | """Whether this branch contains the upstream version specified. |
66 | 354 | 330 | ||
67 | 355 | The version must be judged present by having the appropriate tag | 331 | The version must be judged present by having the appropriate tag |
68 | @@ -364,11 +340,7 @@ | |||
69 | 364 | :return: True if the upstream branch contains the specified upstream | 340 | :return: True if the upstream branch contains the specified upstream |
70 | 365 | version of the package. False otherwise. | 341 | version of the package. False otherwise. |
71 | 366 | """ | 342 | """ |
77 | 367 | for tag_name in self.pristine_upstream_source.possible_tag_names(version): | 343 | return self.pristine_upstream_source.has_version(package, version, tarballs) |
73 | 368 | if self._has_upstream_version(self.pristine_upstream_branch, | ||
74 | 369 | tag_name, tarballs=tarballs): | ||
75 | 370 | return True | ||
76 | 371 | return False | ||
78 | 372 | 344 | ||
79 | 373 | def contained_versions(self, versions): | 345 | def contained_versions(self, versions): |
80 | 374 | """Splits a list of versions depending on presence in the branch. | 346 | """Splits a list of versions depending on presence in the branch. |
81 | @@ -457,20 +429,17 @@ | |||
82 | 457 | return self.branch.tags.lookup_tag(ubuntu_tag_name) | 429 | return self.branch.tags.lookup_tag(ubuntu_tag_name) |
83 | 458 | return self.branch.tags.lookup_tag(tag_name) | 430 | return self.branch.tags.lookup_tag(tag_name) |
84 | 459 | 431 | ||
86 | 460 | def revid_of_upstream_version(self, version): | 432 | def revid_of_upstream_version(self, package, version, tarballs=None): |
87 | 461 | """Returns the revision id corresponding to the upstream version. | 433 | """Returns the revision id corresponding to the upstream version. |
88 | 462 | 434 | ||
89 | 463 | :param version: the Version object to extract the upstream version | 435 | :param version: the Version object to extract the upstream version |
91 | 464 | from to retreive the revid of. The upstream version must be | 436 | from to retrieve the revid of. The upstream version must be |
92 | 465 | present in the upstream branch. | 437 | present in the upstream branch. |
93 | 466 | :return: the revision id corresponding to the upstream portion | 438 | :return: the revision id corresponding to the upstream portion |
94 | 467 | of the version | 439 | of the version |
95 | 468 | """ | 440 | """ |
101 | 469 | for tag_name in self.pristine_upstream_source.possible_tag_names(version): | 441 | return self.pristine_upstream_source.version_as_revision(package, version, |
102 | 470 | if self._has_version(self.pristine_upstream_branch, tag_name): | 442 | tarballs) |
98 | 471 | return self.pristine_upstream_branch.tags.lookup_tag(tag_name) | ||
99 | 472 | tag_name = self.pristine_upstream_source.tag_name(version) | ||
100 | 473 | return self.pristine_upstream_branch.tags.lookup_tag(tag_name) | ||
103 | 474 | 443 | ||
104 | 475 | def tag_version(self, version, revid=None): | 444 | def tag_version(self, version, revid=None): |
105 | 476 | """Tags the branch's last revision with the given version. | 445 | """Tags the branch's last revision with the given version. |
106 | @@ -614,7 +583,7 @@ | |||
107 | 614 | finally: | 583 | finally: |
108 | 615 | self.branch.unlock() | 584 | self.branch.unlock() |
109 | 616 | 585 | ||
111 | 617 | def branch_to_pull_upstream_from(self, version, upstream_tarballs): | 586 | def branch_to_pull_upstream_from(self, package, version, upstream_tarballs): |
112 | 618 | """Checks whether this upstream is a pull from a lesser branch. | 587 | """Checks whether this upstream is a pull from a lesser branch. |
113 | 619 | 588 | ||
114 | 620 | Looks in all the other upstream branches for the given | 589 | Looks in all the other upstream branches for the given |
115 | @@ -635,7 +604,8 @@ | |||
116 | 635 | up_branch.lock_read() | 604 | up_branch.lock_read() |
117 | 636 | try: | 605 | try: |
118 | 637 | for branch in reversed(self.get_lesser_branches()): | 606 | for branch in reversed(self.get_lesser_branches()): |
120 | 638 | if branch.has_upstream_version(version, tarballs=upstream_tarballs): | 607 | if branch.has_upstream_version(package, version, |
121 | 608 | tarballs=upstream_tarballs): | ||
122 | 639 | # Check that they haven't diverged | 609 | # Check that they haven't diverged |
123 | 640 | other_up_branch = branch.pristine_upstream_branch | 610 | other_up_branch = branch.pristine_upstream_branch |
124 | 641 | other_up_branch.lock_read() | 611 | other_up_branch.lock_read() |
125 | @@ -643,12 +613,13 @@ | |||
126 | 643 | graph = other_up_branch.repository.get_graph( | 613 | graph = other_up_branch.repository.get_graph( |
127 | 644 | up_branch.repository) | 614 | up_branch.repository) |
128 | 645 | if graph.is_ancestor(up_branch.last_revision(), | 615 | if graph.is_ancestor(up_branch.last_revision(), |
130 | 646 | branch.revid_of_upstream_version(version)): | 616 | branch.revid_of_upstream_version(package, version)): |
131 | 647 | return branch | 617 | return branch |
132 | 648 | finally: | 618 | finally: |
133 | 649 | other_up_branch.unlock() | 619 | other_up_branch.unlock() |
134 | 650 | for branch in self.get_greater_branches(): | 620 | for branch in self.get_greater_branches(): |
136 | 651 | if branch.has_upstream_version(version, tarballs=upstream_tarballs): | 621 | if branch.has_upstream_version(package, version, |
137 | 622 | tarballs=upstream_tarballs): | ||
138 | 652 | # Check that they haven't diverged | 623 | # Check that they haven't diverged |
139 | 653 | other_up_branch = branch.pristine_upstream_branch | 624 | other_up_branch = branch.pristine_upstream_branch |
140 | 654 | other_up_branch.lock_read() | 625 | other_up_branch.lock_read() |
141 | @@ -656,7 +627,7 @@ | |||
142 | 656 | graph = other_up_branch.repository.get_graph( | 627 | graph = other_up_branch.repository.get_graph( |
143 | 657 | up_branch.repository) | 628 | up_branch.repository) |
144 | 658 | if graph.is_ancestor(up_branch.last_revision(), | 629 | if graph.is_ancestor(up_branch.last_revision(), |
146 | 659 | branch.revid_of_upstream_version(version)): | 630 | branch.revid_of_upstream_version(package, version)): |
147 | 660 | return branch | 631 | return branch |
148 | 661 | finally: | 632 | finally: |
149 | 662 | other_up_branch.unlock() | 633 | other_up_branch.unlock() |
150 | @@ -729,7 +700,7 @@ | |||
151 | 729 | last_revision=revid) | 700 | last_revision=revid) |
152 | 730 | return parents | 701 | return parents |
153 | 731 | 702 | ||
155 | 732 | def pull_upstream_from_branch(self, pull_branch, version): | 703 | def pull_upstream_from_branch(self, pull_branch, package, version): |
156 | 733 | """Pulls an upstream version from a branch. | 704 | """Pulls an upstream version from a branch. |
157 | 734 | 705 | ||
158 | 735 | Given a DistributionBranch and a version number this method | 706 | Given a DistributionBranch and a version number this method |
159 | @@ -745,7 +716,7 @@ | |||
160 | 745 | :param version: the upstream version string | 716 | :param version: the upstream version string |
161 | 746 | """ | 717 | """ |
162 | 747 | assert isinstance(version, str) | 718 | assert isinstance(version, str) |
164 | 748 | pull_revision = pull_branch.revid_of_upstream_version(version) | 719 | pull_revision = pull_branch.revid_of_upstream_version(package, version) |
165 | 749 | mutter("Pulling upstream part of %s from revision %s" % \ | 720 | mutter("Pulling upstream part of %s from revision %s" % \ |
166 | 750 | (version, pull_revision)) | 721 | (version, pull_revision)) |
167 | 751 | up_pull_branch = pull_branch.pristine_upstream_branch | 722 | up_pull_branch = pull_branch.pristine_upstream_branch |
168 | @@ -757,7 +728,7 @@ | |||
169 | 757 | self.branch.fetch(self.pristine_upstream_branch, last_revision=pull_revision) | 728 | self.branch.fetch(self.pristine_upstream_branch, last_revision=pull_revision) |
170 | 758 | self.pristine_upstream_branch.tags.merge_to(self.branch.tags) | 729 | self.pristine_upstream_branch.tags.merge_to(self.branch.tags) |
171 | 759 | 730 | ||
173 | 760 | def pull_version_from_branch(self, pull_branch, version, native=False): | 731 | def pull_version_from_branch(self, pull_branch, package, version, native=False): |
174 | 761 | """Pull a version from a particular branch. | 732 | """Pull a version from a particular branch. |
175 | 762 | 733 | ||
176 | 763 | Given a DistributionBranch and a version number this method | 734 | Given a DistributionBranch and a version number this method |
177 | @@ -784,10 +755,10 @@ | |||
178 | 784 | assert self.tree is not None, "Can't pull branch with no tree" | 755 | assert self.tree is not None, "Can't pull branch with no tree" |
179 | 785 | self.tree.pull(pull_branch.branch, stop_revision=pull_revision) | 756 | self.tree.pull(pull_branch.branch, stop_revision=pull_revision) |
180 | 786 | self.tag_version(version, revid=pull_revision) | 757 | self.tag_version(version, revid=pull_revision) |
183 | 787 | if not native and not self.has_upstream_version(version.upstream_version): | 758 | if not native and not self.has_upstream_version(package, version.upstream_version): |
184 | 788 | if pull_branch.has_upstream_version(version.upstream_version): | 759 | if pull_branch.has_upstream_version(package, version.upstream_version): |
185 | 789 | self.pull_upstream_from_branch(pull_branch, | 760 | self.pull_upstream_from_branch(pull_branch, |
187 | 790 | version.upstream_version) | 761 | package, version.upstream_version) |
188 | 791 | else: | 762 | else: |
189 | 792 | assert False, ("Can't find the needed upstream part " | 763 | assert False, ("Can't find the needed upstream part " |
190 | 793 | "for version %s" % version) | 764 | "for version %s" % version) |
191 | @@ -803,7 +774,7 @@ | |||
192 | 803 | mutter("Not importing the upstream part as it is already " | 774 | mutter("Not importing the upstream part as it is already " |
193 | 804 | "present in the upstream branch") | 775 | "present in the upstream branch") |
194 | 805 | 776 | ||
196 | 806 | def get_parents_with_upstream(self, version, versions, | 777 | def get_parents_with_upstream(self, package, version, versions, |
197 | 807 | force_upstream_parent=False): | 778 | force_upstream_parent=False): |
198 | 808 | """Get the list of parents including any upstream parents. | 779 | """Get the list of parents including any upstream parents. |
199 | 809 | 780 | ||
200 | @@ -840,7 +811,8 @@ | |||
201 | 840 | break | 811 | break |
202 | 841 | real_parents = [p[2] for p in parents] | 812 | real_parents = [p[2] for p in parents] |
203 | 842 | if need_upstream_parent: | 813 | if need_upstream_parent: |
205 | 843 | parent_revid = self.revid_of_upstream_version(version.upstream_version) | 814 | parent_revid = self.revid_of_upstream_version(package, |
206 | 815 | version.upstream_version) | ||
207 | 844 | if len(parents) > 0: | 816 | if len(parents) > 0: |
208 | 845 | real_parents.insert(1, parent_revid) | 817 | real_parents.insert(1, parent_revid) |
209 | 846 | else: | 818 | else: |
210 | @@ -1100,7 +1072,7 @@ | |||
211 | 1100 | timezone=timezone) | 1072 | timezone=timezone) |
212 | 1101 | self.tag_version(version, revid=revid) | 1073 | self.tag_version(version, revid=revid) |
213 | 1102 | 1074 | ||
215 | 1103 | def upstream_parents(self, versions, version): | 1075 | def upstream_parents(self, package, versions, version): |
216 | 1104 | """Get the parents for importing a new upstream. | 1076 | """Get the parents for importing a new upstream. |
217 | 1105 | 1077 | ||
218 | 1106 | The upstream parents will be the last upstream version, | 1078 | The upstream parents will be the last upstream version, |
219 | @@ -1119,7 +1091,8 @@ | |||
220 | 1119 | # upstream as a non-native version (i.e. it wasn't a mistaken | 1091 | # upstream as a non-native version (i.e. it wasn't a mistaken |
221 | 1120 | # native -2 version), then we want to add an extra parent. | 1092 | # native -2 version), then we want to add an extra parent. |
222 | 1121 | if (self.is_version_native(last_contained_version) | 1093 | if (self.is_version_native(last_contained_version) |
224 | 1122 | and not self.has_upstream_version(last_contained_version.upstream_version)): | 1094 | and not self.has_upstream_version(package, |
225 | 1095 | last_contained_version.upstream_version)): | ||
226 | 1123 | revid = self.revid_of_version(last_contained_version) | 1096 | revid = self.revid_of_version(last_contained_version) |
227 | 1124 | parents.append(revid) | 1097 | parents.append(revid) |
228 | 1125 | self.pristine_upstream_branch.fetch(self.branch, | 1098 | self.pristine_upstream_branch.fetch(self.branch, |
229 | @@ -1134,16 +1107,16 @@ | |||
230 | 1134 | pull_branch = pull_parents[1][0] | 1107 | pull_branch = pull_parents[1][0] |
231 | 1135 | pull_version = pull_parents[1][1] | 1108 | pull_version = pull_parents[1][1] |
232 | 1136 | if not pull_branch.is_version_native(pull_version): | 1109 | if not pull_branch.is_version_native(pull_version): |
243 | 1137 | pull_revid = \ | 1110 | pull_revid = pull_branch.revid_of_upstream_version( |
244 | 1138 | pull_branch.revid_of_upstream_version(pull_version.upstream_version) | 1111 | package, pull_version.upstream_version) |
245 | 1139 | mutter("Initialising upstream from %s, version %s" \ | 1112 | mutter("Initialising upstream from %s, version %s", |
246 | 1140 | % (str(pull_branch), str(pull_version))) | 1113 | str(pull_branch), str(pull_version)) |
247 | 1141 | parents.append(pull_revid) | 1114 | parents.append(pull_revid) |
248 | 1142 | self.pristine_upstream_branch.fetch( | 1115 | self.pristine_upstream_branch.fetch( |
249 | 1143 | pull_branch.pristine_upstream_branch, | 1116 | pull_branch.pristine_upstream_branch, |
250 | 1144 | last_revision=pull_revid) | 1117 | last_revision=pull_revid) |
251 | 1145 | pull_branch.pristine_upstream_branch.tags.merge_to( | 1118 | pull_branch.pristine_upstream_branch.tags.merge_to( |
252 | 1146 | self.pristine_upstream_branch.tags) | 1119 | self.pristine_upstream_branch.tags) |
253 | 1147 | return parents | 1120 | return parents |
254 | 1148 | 1121 | ||
255 | 1149 | def get_changelog_from_source(self, dir): | 1122 | def get_changelog_from_source(self, dir): |
256 | @@ -1152,11 +1125,12 @@ | |||
257 | 1152 | cl.parse_changelog(open(cl_filename).read(), strict=False) | 1125 | cl.parse_changelog(open(cl_filename).read(), strict=False) |
258 | 1153 | return cl | 1126 | return cl |
259 | 1154 | 1127 | ||
261 | 1155 | def _import_normal_package(self, version, versions, debian_part, md5, | 1128 | def _import_normal_package(self, package, version, versions, debian_part, md5, |
262 | 1156 | upstream_part, upstream_tarballs, timestamp=None, author=None, | 1129 | upstream_part, upstream_tarballs, timestamp=None, author=None, |
263 | 1157 | file_ids_from=None, pull_debian=True): | 1130 | file_ids_from=None, pull_debian=True): |
264 | 1158 | """Import a source package. | 1131 | """Import a source package. |
265 | 1159 | 1132 | ||
266 | 1133 | :param package: Package name | ||
267 | 1160 | :param version: Full Debian version | 1134 | :param version: Full Debian version |
268 | 1161 | :param versions: Safe versions from changelog | 1135 | :param versions: Safe versions from changelog |
269 | 1162 | :param debian_part: Path to extracted directory with Debian changes | 1136 | :param debian_part: Path to extracted directory with Debian changes |
270 | @@ -1172,28 +1146,28 @@ | |||
271 | 1172 | if pull_debian: | 1146 | if pull_debian: |
272 | 1173 | pull_branch = self.branch_to_pull_version_from(version, md5) | 1147 | pull_branch = self.branch_to_pull_version_from(version, md5) |
273 | 1174 | if pull_branch is not None: | 1148 | if pull_branch is not None: |
276 | 1175 | if (self.branch_to_pull_upstream_from(version.upstream_version, | 1149 | if (self.branch_to_pull_upstream_from(package, |
277 | 1176 | upstream_tarballs) | 1150 | version.upstream_version, upstream_tarballs) |
278 | 1177 | is None): | 1151 | is None): |
279 | 1178 | pull_branch = None | 1152 | pull_branch = None |
280 | 1179 | if pull_branch is not None: | 1153 | if pull_branch is not None: |
282 | 1180 | self.pull_version_from_branch(pull_branch, version) | 1154 | self.pull_version_from_branch(pull_branch, package, version) |
283 | 1181 | else: | 1155 | else: |
284 | 1182 | # We need to import at least the diff, possibly upstream. | 1156 | # We need to import at least the diff, possibly upstream. |
285 | 1183 | # Work out if we need the upstream part first. | 1157 | # Work out if we need the upstream part first. |
286 | 1184 | imported_upstream = False | 1158 | imported_upstream = False |
288 | 1185 | if not self.pristine_upstream_source.has_version(None, version.upstream_version): | 1159 | if not self.pristine_upstream_source.has_version(package, version.upstream_version): |
289 | 1186 | up_pull_branch = \ | 1160 | up_pull_branch = \ |
291 | 1187 | self.branch_to_pull_upstream_from(version.upstream_version, | 1161 | self.branch_to_pull_upstream_from(package, version.upstream_version, |
292 | 1188 | upstream_tarballs) | 1162 | upstream_tarballs) |
293 | 1189 | if up_pull_branch is not None: | 1163 | if up_pull_branch is not None: |
294 | 1190 | self.pull_upstream_from_branch(up_pull_branch, | 1164 | self.pull_upstream_from_branch(up_pull_branch, |
296 | 1191 | version.upstream_version) | 1165 | package, version.upstream_version) |
297 | 1192 | else: | 1166 | else: |
298 | 1193 | imported_upstream = True | 1167 | imported_upstream = True |
299 | 1194 | # Check whether we should pull first if this initialises | 1168 | # Check whether we should pull first if this initialises |
300 | 1195 | # from another branch: | 1169 | # from another branch: |
302 | 1196 | upstream_parents = self.upstream_parents(versions, | 1170 | upstream_parents = self.upstream_parents(package, versions, |
303 | 1197 | version.upstream_version) | 1171 | version.upstream_version) |
304 | 1198 | _, new_revid = self.import_upstream(upstream_part, | 1172 | _, new_revid = self.import_upstream(upstream_part, |
305 | 1199 | version.upstream_version, | 1173 | version.upstream_version, |
306 | @@ -1204,7 +1178,7 @@ | |||
307 | 1204 | self._fetch_upstream_to_branch(new_revid) | 1178 | self._fetch_upstream_to_branch(new_revid) |
308 | 1205 | else: | 1179 | else: |
309 | 1206 | mutter("We already have the needed upstream part") | 1180 | mutter("We already have the needed upstream part") |
311 | 1207 | parents = self.get_parents_with_upstream(version, versions, | 1181 | parents = self.get_parents_with_upstream(package, version, versions, |
312 | 1208 | force_upstream_parent=imported_upstream) | 1182 | force_upstream_parent=imported_upstream) |
313 | 1209 | # Now we have the list of parents we need to import the .diff.gz | 1183 | # Now we have the list of parents we need to import the .diff.gz |
314 | 1210 | self.import_debian(debian_part, version, parents, md5, | 1184 | self.import_debian(debian_part, version, parents, md5, |
315 | @@ -1248,13 +1222,13 @@ | |||
316 | 1248 | parents.insert(0, self.branch.last_revision()) | 1222 | parents.insert(0, self.branch.last_revision()) |
317 | 1249 | return parents | 1223 | return parents |
318 | 1250 | 1224 | ||
320 | 1251 | def _import_native_package(self, version, versions, debian_part, md5, | 1225 | def _import_native_package(self, package, version, versions, debian_part, md5, |
321 | 1252 | timestamp=None, file_ids_from=None, pull_debian=True): | 1226 | timestamp=None, file_ids_from=None, pull_debian=True): |
322 | 1253 | pull_branch = None | 1227 | pull_branch = None |
323 | 1254 | if pull_debian: | 1228 | if pull_debian: |
324 | 1255 | pull_branch = self.branch_to_pull_version_from(version, md5) | 1229 | pull_branch = self.branch_to_pull_version_from(version, md5) |
325 | 1256 | if pull_branch is not None: | 1230 | if pull_branch is not None: |
327 | 1257 | self.pull_version_from_branch(pull_branch, version, native=True) | 1231 | self.pull_version_from_branch(pull_branch, package, version, native=True) |
328 | 1258 | else: | 1232 | else: |
329 | 1259 | parents = self.get_native_parents(version, versions) | 1233 | parents = self.get_native_parents(version, versions) |
330 | 1260 | self.import_debian(debian_part, version, parents, md5, | 1234 | self.import_debian(debian_part, version, parents, md5, |
331 | @@ -1308,7 +1282,7 @@ | |||
332 | 1308 | # should happen if it isn't. | 1282 | # should happen if it isn't. |
333 | 1309 | 1283 | ||
334 | 1310 | if extractor.extracted_upstream is not None: | 1284 | if extractor.extracted_upstream is not None: |
336 | 1311 | self._import_normal_package(version, versions, | 1285 | self._import_normal_package(dsc['Source'], version, versions, |
337 | 1312 | extractor.extracted_debianised, | 1286 | extractor.extracted_debianised, |
338 | 1313 | extractor.unextracted_debian_md5, | 1287 | extractor.unextracted_debian_md5, |
339 | 1314 | extractor.extracted_upstream, | 1288 | extractor.extracted_upstream, |
340 | @@ -1317,7 +1291,7 @@ | |||
341 | 1317 | file_ids_from=file_ids_from, | 1291 | file_ids_from=file_ids_from, |
342 | 1318 | pull_debian=pull_debian) | 1292 | pull_debian=pull_debian) |
343 | 1319 | else: | 1293 | else: |
345 | 1320 | self._import_native_package(version, versions, | 1294 | self._import_native_package(dsc['Source'], version, versions, |
346 | 1321 | extractor.extracted_debianised, | 1295 | extractor.extracted_debianised, |
347 | 1322 | extractor.unextracted_debian_md5, | 1296 | extractor.unextracted_debian_md5, |
348 | 1323 | timestamp=timestamp, file_ids_from=file_ids_from, | 1297 | timestamp=timestamp, file_ids_from=file_ids_from, |
349 | 1324 | 1298 | ||
350 | === modified file 'tests/test_import_dsc.py' | |||
351 | --- tests/test_import_dsc.py 2011-06-15 16:29:37 +0000 | |||
352 | +++ tests/test_import_dsc.py 2011-06-15 16:37:25 +0000 | |||
353 | @@ -47,9 +47,6 @@ | |||
354 | 47 | BuilddebTestCase, | 47 | BuilddebTestCase, |
355 | 48 | SourcePackageBuilder, | 48 | SourcePackageBuilder, |
356 | 49 | ) | 49 | ) |
357 | 50 | from bzrlib.plugins.builddeb.util import ( | ||
358 | 51 | md5sum_filename, | ||
359 | 52 | ) | ||
360 | 53 | 50 | ||
361 | 54 | 51 | ||
362 | 55 | class _PristineTarFeature(tests.Feature): | 52 | class _PristineTarFeature(tests.Feature): |
363 | @@ -174,27 +171,27 @@ | |||
364 | 174 | def test_has_upstream_version(self): | 171 | def test_has_upstream_version(self): |
365 | 175 | db = self.db1 | 172 | db = self.db1 |
366 | 176 | version = "0.1" | 173 | version = "0.1" |
369 | 177 | self.assertFalse(db.has_upstream_version(version)) | 174 | self.assertFalse(db.has_upstream_version("package", version)) |
370 | 178 | self.assertFalse(db.has_upstream_version(version, | 175 | self.assertFalse(db.has_upstream_version("package", version, |
371 | 179 | [("foo.tar.gz", self.fake_md5_1)])) | 176 | [("foo.tar.gz", self.fake_md5_1)])) |
372 | 180 | self.do_commit_with_md5(self.up_tree1, "one", self.fake_md5_1) | 177 | self.do_commit_with_md5(self.up_tree1, "one", self.fake_md5_1) |
373 | 181 | db.tag_upstream_version(version) | 178 | db.tag_upstream_version(version) |
376 | 182 | self.assertTrue(db.has_upstream_version(version)) | 179 | self.assertTrue(db.has_upstream_version("package", version)) |
377 | 183 | self.assertTrue(db.has_upstream_version( | 180 | self.assertTrue(db.has_upstream_version("package", |
378 | 184 | version, [("foo.tar.gz", self.fake_md5_1)])) | 181 | version, [("foo.tar.gz", self.fake_md5_1)])) |
380 | 185 | self.assertFalse(db.has_upstream_version(version, | 182 | self.assertFalse(db.has_upstream_version("package", version, |
381 | 186 | [("foo.tar.gz", self.fake_md5_2)])) | 183 | [("foo.tar.gz", self.fake_md5_2)])) |
382 | 187 | version = "0.1" | 184 | version = "0.1" |
385 | 188 | self.assertTrue(db.has_upstream_version(version)) | 185 | self.assertTrue(db.has_upstream_version("package", version)) |
386 | 189 | self.assertTrue(db.has_upstream_version(version, | 186 | self.assertTrue(db.has_upstream_version("package", version, |
387 | 190 | [("foo.tar.gz", self.fake_md5_1)])) | 187 | [("foo.tar.gz", self.fake_md5_1)])) |
389 | 191 | self.assertFalse(db.has_upstream_version(version, | 188 | self.assertFalse(db.has_upstream_version("package", version, |
390 | 192 | [("foo.tar.gz", self.fake_md5_2)])) | 189 | [("foo.tar.gz", self.fake_md5_2)])) |
391 | 193 | version = "0.2" | 190 | version = "0.2" |
394 | 194 | self.assertFalse(db.has_upstream_version(version)) | 191 | self.assertFalse(db.has_upstream_version("package", version)) |
395 | 195 | self.assertFalse(db.has_upstream_version(version, | 192 | self.assertFalse(db.has_upstream_version("package", version, |
396 | 196 | [("foo.tar.gz", self.fake_md5_1)])) | 193 | [("foo.tar.gz", self.fake_md5_1)])) |
398 | 197 | self.assertFalse(db.has_upstream_version(version, | 194 | self.assertFalse(db.has_upstream_version("package", version, |
399 | 198 | [("foo.tar.gz", self.fake_md5_2)])) | 195 | [("foo.tar.gz", self.fake_md5_2)])) |
400 | 199 | 196 | ||
401 | 200 | def test_revid_of_version(self): | 197 | def test_revid_of_version(self): |
402 | @@ -211,7 +208,8 @@ | |||
403 | 211 | version = "0.1" | 208 | version = "0.1" |
404 | 212 | revid = tree.commit("one") | 209 | revid = tree.commit("one") |
405 | 213 | db.tag_upstream_version(version) | 210 | db.tag_upstream_version(version) |
407 | 214 | self.assertEqual(db.revid_of_upstream_version(version), revid) | 211 | self.assertEqual( |
408 | 212 | db.revid_of_upstream_version("package", version), revid) | ||
409 | 215 | 213 | ||
410 | 216 | def test_contained_versions(self): | 214 | def test_contained_versions(self): |
411 | 217 | db = self.db1 | 215 | db = self.db1 |
412 | @@ -401,13 +399,15 @@ | |||
413 | 401 | version1 = Version("0.1-1") | 399 | version1 = Version("0.1-1") |
414 | 402 | up_revid = self.up_tree1.commit("one") | 400 | up_revid = self.up_tree1.commit("one") |
415 | 403 | db.tag_upstream_version(version1.upstream_version) | 401 | db.tag_upstream_version(version1.upstream_version) |
418 | 404 | self.assertEqual(db.get_parents_with_upstream(version1, [version1]), | 402 | self.assertEqual( |
419 | 405 | [up_revid]) | 403 | db.get_parents_with_upstream("package", version1, [version1]), |
420 | 404 | [up_revid]) | ||
421 | 406 | db = self.db2 | 405 | db = self.db2 |
422 | 407 | self.up_tree2.pull(self.up_tree1.branch) | 406 | self.up_tree2.pull(self.up_tree1.branch) |
423 | 408 | db.tag_upstream_version(version1.upstream_version) | 407 | db.tag_upstream_version(version1.upstream_version) |
426 | 409 | self.assertEqual(db.get_parents_with_upstream(version1, [version1]), | 408 | self.assertEqual( |
427 | 410 | [up_revid]) | 409 | db.get_parents_with_upstream("package", version1, [version1]), |
428 | 410 | [up_revid]) | ||
429 | 411 | 411 | ||
430 | 412 | def test_get_parents_with_upstream_second_version(self): | 412 | def test_get_parents_with_upstream_second_version(self): |
431 | 413 | db = self.db1 | 413 | db = self.db1 |
432 | @@ -418,8 +418,8 @@ | |||
433 | 418 | up_revid = self.up_tree1.commit("upstream one") | 418 | up_revid = self.up_tree1.commit("upstream one") |
434 | 419 | db.tag_upstream_version(version1.upstream_version) | 419 | db.tag_upstream_version(version1.upstream_version) |
435 | 420 | # No upstream parent | 420 | # No upstream parent |
438 | 421 | self.assertEqual(db.get_parents_with_upstream(version2, | 421 | self.assertEqual(db.get_parents_with_upstream( |
439 | 422 | [version2, version1]), [revid1]) | 422 | "package", version2, [version2, version1]), [revid1]) |
440 | 423 | 423 | ||
441 | 424 | def test_get_parents_with_upstream_merge_from_lesser(self): | 424 | def test_get_parents_with_upstream_merge_from_lesser(self): |
442 | 425 | version1 = Version("0.1-1") | 425 | version1 = Version("0.1-1") |
443 | @@ -435,8 +435,8 @@ | |||
444 | 435 | self.db2.tag_upstream_version(version2.upstream_version) | 435 | self.db2.tag_upstream_version(version2.upstream_version) |
445 | 436 | versions = [version3, version1, version2] | 436 | versions = [version3, version1, version2] |
446 | 437 | # No upstream parent | 437 | # No upstream parent |
449 | 438 | self.assertEqual(self.db2.get_parents_with_upstream(version3, | 438 | self.assertEqual(self.db2.get_parents_with_upstream( |
450 | 439 | versions), [revid2, revid1]) | 439 | "package", version3, versions), [revid2, revid1]) |
451 | 440 | 440 | ||
452 | 441 | def test_get_parents_with_upstream_merge_from_greater(self): | 441 | def test_get_parents_with_upstream_merge_from_greater(self): |
453 | 442 | version1 = Version("0.1-1") | 442 | version1 = Version("0.1-1") |
454 | @@ -452,8 +452,8 @@ | |||
455 | 452 | self.db2.tag_upstream_version(version2.upstream_version) | 452 | self.db2.tag_upstream_version(version2.upstream_version) |
456 | 453 | versions = [version3, version2, version1] | 453 | versions = [version3, version2, version1] |
457 | 454 | # No upstream parent | 454 | # No upstream parent |
460 | 455 | self.assertEqual(self.db1.get_parents_with_upstream(version3, | 455 | self.assertEqual(self.db1.get_parents_with_upstream( |
461 | 456 | versions), [revid1, revid2]) | 456 | "package", version3, versions), [revid1, revid2]) |
462 | 457 | 457 | ||
463 | 458 | def test_get_parents_with_upstream_new_upstream_import(self): | 458 | def test_get_parents_with_upstream_new_upstream_import(self): |
464 | 459 | version1 = Version("0.1-1") | 459 | version1 = Version("0.1-1") |
465 | @@ -468,8 +468,8 @@ | |||
466 | 468 | self.db2.tag_upstream_version(version2.upstream_version) | 468 | self.db2.tag_upstream_version(version2.upstream_version) |
467 | 469 | versions = [version2, version1] | 469 | versions = [version2, version1] |
468 | 470 | # Upstream parent as it is new upstream version | 470 | # Upstream parent as it is new upstream version |
471 | 471 | self.assertEqual(self.db2.get_parents_with_upstream(version2, | 471 | self.assertEqual(self.db2.get_parents_with_upstream( |
472 | 472 | versions), [revid1, up_revid2]) | 472 | "package", version2, versions), [revid1, up_revid2]) |
473 | 473 | 473 | ||
474 | 474 | def test_get_parents_merge_new_upstream_from_lesser(self): | 474 | def test_get_parents_merge_new_upstream_from_lesser(self): |
475 | 475 | version1 = Version("0.1-1") | 475 | version1 = Version("0.1-1") |
476 | @@ -492,8 +492,8 @@ | |||
477 | 492 | self.db2.tag_upstream_version(version4.upstream_version) | 492 | self.db2.tag_upstream_version(version4.upstream_version) |
478 | 493 | versions = [version4, version3, version2, version1] | 493 | versions = [version4, version3, version2, version1] |
479 | 494 | # no upstream parent as the lesser branch has already merged it | 494 | # no upstream parent as the lesser branch has already merged it |
482 | 495 | self.assertEqual(self.db2.get_parents_with_upstream(version4, | 495 | self.assertEqual(self.db2.get_parents_with_upstream( |
483 | 496 | versions), [revid2, revid3]) | 496 | "package", version4, versions), [revid2, revid3]) |
484 | 497 | 497 | ||
485 | 498 | def test_get_parents_with_upstream_force_upstream(self): | 498 | def test_get_parents_with_upstream_force_upstream(self): |
486 | 499 | version1 = Version("0.1-1") | 499 | version1 = Version("0.1-1") |
487 | @@ -507,9 +507,9 @@ | |||
488 | 507 | versions = [version2, version1] | 507 | versions = [version2, version1] |
489 | 508 | # a previous test checked that this wouldn't give an | 508 | # a previous test checked that this wouldn't give an |
490 | 509 | # upstream parent, but we are requiring one. | 509 | # upstream parent, but we are requiring one. |
494 | 510 | self.assertEqual(self.db2.get_parents_with_upstream(version2, | 510 | self.assertEqual(self.db2.get_parents_with_upstream( |
495 | 511 | versions, force_upstream_parent=True), | 511 | "package", version2, versions, force_upstream_parent=True), |
496 | 512 | [revid1, up_revid2]) | 512 | [revid1, up_revid2]) |
497 | 513 | 513 | ||
498 | 514 | def test_get_parents_with_upstream_sync_when_diverged(self): | 514 | def test_get_parents_with_upstream_sync_when_diverged(self): |
499 | 515 | version1 = Version("0.1-1") | 515 | version1 = Version("0.1-1") |
500 | @@ -528,8 +528,8 @@ | |||
501 | 528 | versions = [version3, version2, version1] | 528 | versions = [version3, version2, version1] |
502 | 529 | # This is a sync but we are diverged so we should get two | 529 | # This is a sync but we are diverged so we should get two |
503 | 530 | # parents | 530 | # parents |
506 | 531 | self.assertEqual(self.db2.get_parents_with_upstream(version3, | 531 | self.assertEqual(self.db2.get_parents_with_upstream( |
507 | 532 | versions), [revid2, revid3]) | 532 | "package", version3, versions), [revid2, revid3]) |
508 | 533 | 533 | ||
509 | 534 | def test_get_parents_with_upstream_sync_new_upstream(self): | 534 | def test_get_parents_with_upstream_sync_new_upstream(self): |
510 | 535 | version1 = Version("0.1-1") | 535 | version1 = Version("0.1-1") |
511 | @@ -551,8 +551,8 @@ | |||
512 | 551 | # This a sync, but we are diverged, so we should get two | 551 | # This a sync, but we are diverged, so we should get two |
513 | 552 | # parents. There should be no upstream as the synced | 552 | # parents. There should be no upstream as the synced |
514 | 553 | # version will already have it. | 553 | # version will already have it. |
517 | 554 | self.assertEqual(self.db2.get_parents_with_upstream(version3, | 554 | self.assertEqual(self.db2.get_parents_with_upstream( |
518 | 555 | versions), [revid2, revid3]) | 555 | "package", version3, versions), [revid2, revid3]) |
519 | 556 | 556 | ||
520 | 557 | def test_get_parents_with_upstream_sync_new_upstream_force(self): | 557 | def test_get_parents_with_upstream_sync_new_upstream_force(self): |
521 | 558 | version1 = Version("0.1-1") | 558 | version1 = Version("0.1-1") |
522 | @@ -578,8 +578,8 @@ | |||
523 | 578 | # checks that there is not normally an upstream parent | 578 | # checks that there is not normally an upstream parent |
524 | 579 | # when we fake-sync, but we are forcing one here. | 579 | # when we fake-sync, but we are forcing one here. |
525 | 580 | #TODO: should the upstream parent be second or third? | 580 | #TODO: should the upstream parent be second or third? |
528 | 581 | self.assertEqual(self.db2.get_parents_with_upstream(version3, | 581 | self.assertEqual(self.db2.get_parents_with_upstream( |
529 | 582 | versions, force_upstream_parent=True), | 582 | "package", version3, versions, force_upstream_parent=True), |
530 | 583 | [revid2, up_revid3, revid3]) | 583 | [revid2, up_revid3, revid3]) |
531 | 584 | 584 | ||
532 | 585 | def test_branch_to_pull_version_from(self): | 585 | def test_branch_to_pull_version_from(self): |
533 | @@ -639,46 +639,48 @@ | |||
534 | 639 | version1 = Version("0.1-1") | 639 | version1 = Version("0.1-1") |
535 | 640 | version2 = Version("0.2-1") | 640 | version2 = Version("0.2-1") |
536 | 641 | # With no versions tagged everything is None | 641 | # With no versions tagged everything is None |
538 | 642 | branch = self.db2.branch_to_pull_upstream_from( | 642 | branch = self.db2.branch_to_pull_upstream_from("package", |
539 | 643 | version1.upstream_version, [("foo.tar.gz", self.fake_md5_1)]) | 643 | version1.upstream_version, [("foo.tar.gz", self.fake_md5_1)]) |
540 | 644 | self.assertEqual(branch, None) | 644 | self.assertEqual(branch, None) |
542 | 645 | branch = self.db2.branch_to_pull_upstream_from( | 645 | branch = self.db2.branch_to_pull_upstream_from("package", |
543 | 646 | version1.upstream_version, [("foo.tar.gz", self.fake_md5_2)]) | 646 | version1.upstream_version, [("foo.tar.gz", self.fake_md5_2)]) |
544 | 647 | self.assertEqual(branch, None) | 647 | self.assertEqual(branch, None) |
546 | 648 | branch = self.db1.branch_to_pull_upstream_from( | 648 | branch = self.db1.branch_to_pull_upstream_from("package", |
547 | 649 | version1.upstream_version, [("foo.tar.gz", self.fake_md5_1)]) | 649 | version1.upstream_version, [("foo.tar.gz", self.fake_md5_1)]) |
548 | 650 | self.assertEqual(branch, None) | 650 | self.assertEqual(branch, None) |
549 | 651 | self.do_commit_with_md5(self.up_tree1, "one", self.fake_md5_1) | 651 | self.do_commit_with_md5(self.up_tree1, "one", self.fake_md5_1) |
550 | 652 | self.db1.tag_upstream_version(version1.upstream_version) | 652 | self.db1.tag_upstream_version(version1.upstream_version) |
551 | 653 | # Version and md5 available, so we get the correct branch. | 653 | # Version and md5 available, so we get the correct branch. |
553 | 654 | branch = self.db2.branch_to_pull_upstream_from( | 654 | branch = self.db2.branch_to_pull_upstream_from("package", |
554 | 655 | version1.upstream_version, [("foo.tar.gz", self.fake_md5_1)]) | 655 | version1.upstream_version, [("foo.tar.gz", self.fake_md5_1)]) |
555 | 656 | self.assertEqual(branch, self.db1) | 656 | self.assertEqual(branch, self.db1) |
556 | 657 | # Otherwise (different version or md5) then we get None | 657 | # Otherwise (different version or md5) then we get None |
558 | 658 | branch = self.db2.branch_to_pull_upstream_from( | 658 | branch = self.db2.branch_to_pull_upstream_from("package", |
559 | 659 | version1.upstream_version, [("foo.tar.gz", self.fake_md5_2)]) | 659 | version1.upstream_version, [("foo.tar.gz", self.fake_md5_2)]) |
560 | 660 | self.assertEqual(branch, None) | 660 | self.assertEqual(branch, None) |
562 | 661 | branch = self.db2.branch_to_pull_upstream_from(version2.upstream_version, | 661 | branch = self.db2.branch_to_pull_upstream_from("package", |
563 | 662 | version2.upstream_version, | ||
564 | 662 | [("foo.tar.gz", self.fake_md5_1)]) | 663 | [("foo.tar.gz", self.fake_md5_1)]) |
565 | 663 | self.assertEqual(branch, None) | 664 | self.assertEqual(branch, None) |
567 | 664 | branch = self.db2.branch_to_pull_upstream_from(version2.upstream_version, | 665 | branch = self.db2.branch_to_pull_upstream_from("package", |
568 | 666 | version2.upstream_version, | ||
569 | 665 | [("foo.tar.gz", self.fake_md5_2)]) | 667 | [("foo.tar.gz", self.fake_md5_2)]) |
570 | 666 | self.assertEqual(branch, None) | 668 | self.assertEqual(branch, None) |
571 | 667 | # And we don't get a branch for the one that already has | 669 | # And we don't get a branch for the one that already has |
572 | 668 | # the version | 670 | # the version |
574 | 669 | branch = self.db1.branch_to_pull_upstream_from( | 671 | branch = self.db1.branch_to_pull_upstream_from("package", |
575 | 670 | version1.upstream_version, [("foo.tar.gz", self.fake_md5_1)]) | 672 | version1.upstream_version, [("foo.tar.gz", self.fake_md5_1)]) |
576 | 671 | self.assertEqual(branch, None) | 673 | self.assertEqual(branch, None) |
577 | 672 | self.up_tree2.pull(self.up_tree1.branch) | 674 | self.up_tree2.pull(self.up_tree1.branch) |
578 | 673 | self.db2.tag_upstream_version(version1.upstream_version) | 675 | self.db2.tag_upstream_version(version1.upstream_version) |
579 | 674 | # And we get the greatest branch when two lesser branches | 676 | # And we get the greatest branch when two lesser branches |
580 | 675 | # have what we are looking for. | 677 | # have what we are looking for. |
582 | 676 | branch = self.db3.branch_to_pull_upstream_from( | 678 | branch = self.db3.branch_to_pull_upstream_from("package", |
583 | 677 | version1.upstream_version, [("foo.tar.gz", self.fake_md5_1)]) | 679 | version1.upstream_version, [("foo.tar.gz", self.fake_md5_1)]) |
584 | 678 | self.assertEqual(branch, self.db2) | 680 | self.assertEqual(branch, self.db2) |
585 | 679 | # If the branches have diverged then we don't get a branch. | 681 | # If the branches have diverged then we don't get a branch. |
586 | 680 | self.up_tree3.commit("three") | 682 | self.up_tree3.commit("three") |
588 | 681 | branch = self.db3.branch_to_pull_upstream_from( | 683 | branch = self.db3.branch_to_pull_upstream_from("package", |
589 | 682 | version1.upstream_version, [("foo.tar.gz", self.fake_md5_1)]) | 684 | version1.upstream_version, [("foo.tar.gz", self.fake_md5_1)]) |
590 | 683 | self.assertEqual(branch, None) | 685 | self.assertEqual(branch, None) |
591 | 684 | 686 | ||
592 | @@ -693,12 +695,12 @@ | |||
593 | 693 | revid = self.do_commit_with_md5(self.tree1, "one", self.fake_md5_2) | 695 | revid = self.do_commit_with_md5(self.tree1, "one", self.fake_md5_2) |
594 | 694 | self.db1.tag_version(version) | 696 | self.db1.tag_version(version) |
595 | 695 | self.assertNotEqual(self.tree2.branch.last_revision(), revid) | 697 | self.assertNotEqual(self.tree2.branch.last_revision(), revid) |
597 | 696 | self.db2.pull_version_from_branch(self.db1, version) | 698 | self.db2.pull_version_from_branch(self.db1, "package", version) |
598 | 697 | self.assertEqual(self.tree2.branch.last_revision(), revid) | 699 | self.assertEqual(self.tree2.branch.last_revision(), revid) |
599 | 698 | self.assertEqual(self.up_tree2.branch.last_revision(), up_revid) | 700 | self.assertEqual(self.up_tree2.branch.last_revision(), up_revid) |
600 | 699 | self.assertEqual(self.db2.revid_of_version(version), revid) | 701 | self.assertEqual(self.db2.revid_of_version(version), revid) |
601 | 700 | self.assertEqual(self.db2.revid_of_upstream_version( | 702 | self.assertEqual(self.db2.revid_of_upstream_version( |
603 | 701 | version.upstream_version), up_revid) | 703 | "package", version.upstream_version), up_revid) |
604 | 702 | 704 | ||
605 | 703 | def test_pull_from_lesser_branch_with_upstream(self): | 705 | def test_pull_from_lesser_branch_with_upstream(self): |
606 | 704 | version = Version("0.1-1") | 706 | version = Version("0.1-1") |
607 | @@ -709,12 +711,12 @@ | |||
608 | 709 | self.db1.tag_version(version) | 711 | self.db1.tag_version(version) |
609 | 710 | self.assertNotEqual(self.tree2.branch.last_revision(), revid) | 712 | self.assertNotEqual(self.tree2.branch.last_revision(), revid) |
610 | 711 | self.assertNotEqual(self.up_tree2.branch.last_revision(), up_revid) | 713 | self.assertNotEqual(self.up_tree2.branch.last_revision(), up_revid) |
612 | 712 | self.db2.pull_version_from_branch(self.db1, version) | 714 | self.db2.pull_version_from_branch(self.db1, "package", version) |
613 | 713 | self.assertEqual(self.tree2.branch.last_revision(), revid) | 715 | self.assertEqual(self.tree2.branch.last_revision(), revid) |
614 | 714 | self.assertEqual(self.up_tree2.branch.last_revision(), up_revid) | 716 | self.assertEqual(self.up_tree2.branch.last_revision(), up_revid) |
615 | 715 | self.assertEqual(self.db2.revid_of_version(version), revid) | 717 | self.assertEqual(self.db2.revid_of_version(version), revid) |
616 | 716 | self.assertEqual(self.db2.revid_of_upstream_version( | 718 | self.assertEqual(self.db2.revid_of_upstream_version( |
618 | 717 | version.upstream_version), up_revid) | 719 | "package", version.upstream_version), up_revid) |
619 | 718 | 720 | ||
620 | 719 | def test_pull_upstream_from_branch(self): | 721 | def test_pull_upstream_from_branch(self): |
621 | 720 | version = "0.1" | 722 | version = "0.1" |
622 | @@ -722,9 +724,9 @@ | |||
623 | 722 | self.fake_md5_1) | 724 | self.fake_md5_1) |
624 | 723 | self.db1.tag_upstream_version(version) | 725 | self.db1.tag_upstream_version(version) |
625 | 724 | self.assertNotEqual(self.up_tree2.branch.last_revision(), up_revid) | 726 | self.assertNotEqual(self.up_tree2.branch.last_revision(), up_revid) |
627 | 725 | self.db2.pull_upstream_from_branch(self.db1, version) | 727 | self.db2.pull_upstream_from_branch(self.db1, "package", version) |
628 | 726 | self.assertEqual(self.up_tree2.branch.last_revision(), up_revid) | 728 | self.assertEqual(self.up_tree2.branch.last_revision(), up_revid) |
630 | 727 | self.assertEqual(self.db2.revid_of_upstream_version(version), | 729 | self.assertEqual(self.db2.revid_of_upstream_version("package", version), |
631 | 728 | up_revid) | 730 | up_revid) |
632 | 729 | 731 | ||
633 | 730 | def check_changes(self, changes, added=[], removed=[], modified=[], | 732 | def check_changes(self, changes, added=[], removed=[], modified=[], |
634 | @@ -781,7 +783,7 @@ | |||
635 | 781 | rh = branch.revision_history() | 783 | rh = branch.revision_history() |
636 | 782 | self.assertEqual(len(rh), 1) | 784 | self.assertEqual(len(rh), 1) |
637 | 783 | self.assertEqual(self.db1.revid_of_upstream_version( | 785 | self.assertEqual(self.db1.revid_of_upstream_version( |
639 | 784 | version.upstream_version), rh[0]) | 786 | "package", version.upstream_version), rh[0]) |
640 | 785 | rev = branch.repository.get_revision(rh[0]) | 787 | rev = branch.repository.get_revision(rh[0]) |
641 | 786 | self.assertEqual(rev.message, | 788 | self.assertEqual(rev.message, |
642 | 787 | "Import upstream version %s" % str(version.upstream_version)) | 789 | "Import upstream version %s" % str(version.upstream_version)) |
643 | @@ -817,7 +819,8 @@ | |||
644 | 817 | branch = tree.branch | 819 | branch = tree.branch |
645 | 818 | rh = branch.revision_history() | 820 | rh = branch.revision_history() |
646 | 819 | self.assertEqual(len(rh), 2) | 821 | self.assertEqual(len(rh), 2) |
648 | 820 | self.assertEqual(self.db1.revid_of_upstream_version(version2.upstream_version), rh[1]) | 822 | self.assertEqual( |
649 | 823 | self.db1.revid_of_upstream_version("package", version2.upstream_version), rh[1]) | ||
650 | 821 | rev = branch.repository.get_revision(rh[1]) | 824 | rev = branch.repository.get_revision(rh[1]) |
651 | 822 | self.assertEqual(rev.message, | 825 | self.assertEqual(rev.message, |
652 | 823 | "Import upstream version %s" % str(version2.upstream_version)) | 826 | "Import upstream version %s" % str(version2.upstream_version)) |
653 | @@ -849,7 +852,7 @@ | |||
654 | 849 | rh = branch.revision_history() | 852 | rh = branch.revision_history() |
655 | 850 | self.assertEqual(len(rh), 1) | 853 | self.assertEqual(len(rh), 1) |
656 | 851 | self.assertEqual(self.db1.revid_of_upstream_version( | 854 | self.assertEqual(self.db1.revid_of_upstream_version( |
658 | 852 | version.upstream_version), rh[0]) | 855 | "package", version.upstream_version), rh[0]) |
659 | 853 | rev = branch.repository.get_revision(rh[0]) | 856 | rev = branch.repository.get_revision(rh[0]) |
660 | 854 | self.assertEqual(rev.message, | 857 | self.assertEqual(rev.message, |
661 | 855 | "Import upstream version %s" % str(version.upstream_version)) | 858 | "Import upstream version %s" % str(version.upstream_version)) |
662 | @@ -877,7 +880,7 @@ | |||
663 | 877 | rh = branch.revision_history() | 880 | rh = branch.revision_history() |
664 | 878 | self.assertEqual(len(rh), 1) | 881 | self.assertEqual(len(rh), 1) |
665 | 879 | self.assertEqual(self.db1.revid_of_upstream_version( | 882 | self.assertEqual(self.db1.revid_of_upstream_version( |
667 | 880 | version.upstream_version), rh[0]) | 883 | "package", version.upstream_version), rh[0]) |
668 | 881 | rev = branch.repository.get_revision(rh[0]) | 884 | rev = branch.repository.get_revision(rh[0]) |
669 | 882 | self.assertEqual(rev.message, | 885 | self.assertEqual(rev.message, |
670 | 883 | "Import upstream version %s" % str(version.upstream_version)) | 886 | "Import upstream version %s" % str(version.upstream_version)) |
671 | @@ -1316,8 +1319,8 @@ | |||
672 | 1316 | self.assertEqual(self.db1.revid_of_version(version2), rh1[2]) | 1319 | self.assertEqual(self.db1.revid_of_version(version2), rh1[2]) |
673 | 1317 | self.assertEqual(self.db1.revid_of_version(version3), rh1[3]) | 1320 | self.assertEqual(self.db1.revid_of_version(version3), rh1[3]) |
674 | 1318 | self.assertEqual( | 1321 | self.assertEqual( |
677 | 1319 | self.db1.revid_of_upstream_version(version1.upstream_version), | 1322 | self.db1.revid_of_upstream_version("package", version1.upstream_version), |
678 | 1320 | up_rh1[0]) | 1323 | up_rh1[0]) |
679 | 1321 | self.tree1.lock_read() | 1324 | self.tree1.lock_read() |
680 | 1322 | self.addCleanup(self.tree1.unlock) | 1325 | self.addCleanup(self.tree1.unlock) |
681 | 1323 | self.assertFalse(self.db1.is_version_native(version1)) | 1326 | self.assertFalse(self.db1.is_version_native(version1)) |
682 | @@ -1369,11 +1372,11 @@ | |||
683 | 1369 | self.assertEqual(self.db1.revid_of_version(version2), rh1[2]) | 1372 | self.assertEqual(self.db1.revid_of_version(version2), rh1[2]) |
684 | 1370 | self.assertEqual(self.db1.revid_of_version(version3), rh1[3]) | 1373 | self.assertEqual(self.db1.revid_of_version(version3), rh1[3]) |
685 | 1371 | self.assertEqual( | 1374 | self.assertEqual( |
688 | 1372 | self.db1.revid_of_upstream_version(version1.upstream_version), | 1375 | self.db1.revid_of_upstream_version("package", version1.upstream_version), |
689 | 1373 | up_rh1[0]) | 1376 | up_rh1[0]) |
690 | 1374 | self.assertEqual( | 1377 | self.assertEqual( |
693 | 1375 | self.db1.revid_of_upstream_version(version3.upstream_version), | 1378 | self.db1.revid_of_upstream_version("package", version3.upstream_version), |
694 | 1376 | up_rh1[1]) | 1379 | up_rh1[1]) |
695 | 1377 | self.tree1.lock_read() | 1380 | self.tree1.lock_read() |
696 | 1378 | self.addCleanup(self.tree1.unlock) | 1381 | self.addCleanup(self.tree1.unlock) |
697 | 1379 | self.assertFalse(self.db1.is_version_native(version1)) | 1382 | self.assertFalse(self.db1.is_version_native(version1)) |
698 | @@ -1424,11 +1427,11 @@ | |||
699 | 1424 | self.assertEqual(self.db1.revid_of_version(version2), rh1[2]) | 1427 | self.assertEqual(self.db1.revid_of_version(version2), rh1[2]) |
700 | 1425 | self.assertEqual(self.db1.revid_of_version(version3), rh1[3]) | 1428 | self.assertEqual(self.db1.revid_of_version(version3), rh1[3]) |
701 | 1426 | self.assertEqual( | 1429 | self.assertEqual( |
704 | 1427 | self.db1.revid_of_upstream_version(version1.upstream_version), | 1430 | self.db1.revid_of_upstream_version("package", version1.upstream_version), |
705 | 1428 | up_rh1[0]) | 1431 | up_rh1[0]) |
706 | 1429 | self.assertEqual( | 1432 | self.assertEqual( |
709 | 1430 | self.db1.revid_of_upstream_version(version3.upstream_version), | 1433 | self.db1.revid_of_upstream_version("package", version3.upstream_version), |
710 | 1431 | up_rh1[1]) | 1434 | up_rh1[1]) |
711 | 1432 | self.tree1.lock_read() | 1435 | self.tree1.lock_read() |
712 | 1433 | self.addCleanup(self.tree1.unlock) | 1436 | self.addCleanup(self.tree1.unlock) |
713 | 1434 | self.assertFalse(self.db1.is_version_native(version1)) | 1437 | self.assertFalse(self.db1.is_version_native(version1)) |
714 | 1435 | 1438 | ||
715 | === modified file 'tests/test_merge_package.py' | |||
716 | --- tests/test_merge_package.py 2011-06-13 23:01:14 +0000 | |||
717 | +++ tests/test_merge_package.py 2011-06-15 16:37:25 +0000 | |||
718 | @@ -120,10 +120,10 @@ | |||
719 | 120 | v3 = "1.2" | 120 | v3 = "1.2" |
720 | 121 | v4 = "1.10" | 121 | v4 = "1.10" |
721 | 122 | db1 = DistributionBranch(ubup.branch, ubup.branch) | 122 | db1 = DistributionBranch(ubup.branch, ubup.branch) |
723 | 123 | self.assertEqual(db1.has_upstream_version(v3), True) | 123 | self.assertEqual(db1.has_upstream_version("package", v3), True) |
724 | 124 | # This version is in the diverged debian upstream tree and will | 124 | # This version is in the diverged debian upstream tree and will |
725 | 125 | # hence not be present in the target ubuntu packaging branch. | 125 | # hence not be present in the target ubuntu packaging branch. |
727 | 126 | self.assertEqual(db1.has_upstream_version(v4), False) | 126 | self.assertEqual(db1.has_upstream_version("package", v4), False) |
728 | 127 | 127 | ||
729 | 128 | # The ubuntu upstream branch tip. | 128 | # The ubuntu upstream branch tip. |
730 | 129 | ubuu_tip = ubuu.branch.revision_history()[-1] | 129 | ubuu_tip = ubuu.branch.revision_history()[-1] |
731 | @@ -143,11 +143,11 @@ | |||
732 | 143 | 143 | ||
733 | 144 | # Check the versions present in the tree with the fixed ancestry. | 144 | # Check the versions present in the tree with the fixed ancestry. |
734 | 145 | db2 = DistributionBranch(ubup.branch, ubup.branch) | 145 | db2 = DistributionBranch(ubup.branch, ubup.branch) |
736 | 146 | self.assertEqual(db2.has_upstream_version(v3), True) | 146 | self.assertEqual(db2.has_upstream_version("package", v3), True) |
737 | 147 | # The ancestry has been fixed and the missing debian upstream | 147 | # The ancestry has been fixed and the missing debian upstream |
738 | 148 | # version should now be present in the target ubuntu packaging | 148 | # version should now be present in the target ubuntu packaging |
739 | 149 | # branch. | 149 | # branch. |
741 | 150 | self.assertEqual(db2.has_upstream_version(v4), True) | 150 | self.assertEqual(db2.has_upstream_version("package", v4), True) |
742 | 151 | 151 | ||
743 | 152 | # Now let's take a look at the fixed ubuntu packaging branch. | 152 | # Now let's take a look at the fixed ubuntu packaging branch. |
744 | 153 | ubup_tip_post_fix = ubup.branch.revision_history()[-1] | 153 | ubup_tip_post_fix = ubup.branch.revision_history()[-1] |
745 | 154 | 154 | ||
746 | === modified file 'tests/test_util.py' | |||
747 | --- tests/test_util.py 2011-06-13 23:01:14 +0000 | |||
748 | +++ tests/test_util.py 2011-06-15 16:37:25 +0000 | |||
749 | @@ -24,6 +24,7 @@ | |||
750 | 24 | import md5 | 24 | import md5 |
751 | 25 | import os | 25 | import os |
752 | 26 | import shutil | 26 | import shutil |
753 | 27 | import tarfile | ||
754 | 27 | 28 | ||
755 | 28 | try: | 29 | try: |
756 | 29 | from debian.changelog import Changelog, Version | 30 | from debian.changelog import Changelog, Version |
757 | @@ -40,6 +41,7 @@ | |||
758 | 40 | from bzrlib.plugins.builddeb.errors import (MissingChangelogError, | 41 | from bzrlib.plugins.builddeb.errors import (MissingChangelogError, |
759 | 41 | AddChangelogError, | 42 | AddChangelogError, |
760 | 42 | InconsistentSourceFormatError, | 43 | InconsistentSourceFormatError, |
761 | 44 | MultipleUpstreamTarballsNotSupported, | ||
762 | 43 | NoPreviousUpload, | 45 | NoPreviousUpload, |
763 | 44 | ) | 46 | ) |
764 | 45 | from bzrlib.plugins.builddeb.tests import ( | 47 | from bzrlib.plugins.builddeb.tests import ( |
765 | @@ -50,6 +52,7 @@ | |||
766 | 50 | from bzrlib.plugins.builddeb.util import ( | 52 | from bzrlib.plugins.builddeb.util import ( |
767 | 51 | dget, | 53 | dget, |
768 | 52 | dget_changes, | 54 | dget_changes, |
769 | 55 | extract_orig_tarballs, | ||
770 | 53 | find_bugs_fixed, | 56 | find_bugs_fixed, |
771 | 54 | find_changelog, | 57 | find_changelog, |
772 | 55 | find_extra_authors, | 58 | find_extra_authors, |
773 | @@ -837,3 +840,46 @@ | |||
774 | 837 | self.assertEquals( | 840 | self.assertEquals( |
775 | 838 | "Inconsistency between source format and version: version is not native, " | 841 | "Inconsistency between source format and version: version is not native, " |
776 | 839 | "format is native.", str(e)) | 842 | "format is native.", str(e)) |
777 | 843 | |||
778 | 844 | |||
779 | 845 | class TestExtractOrigTarballs(TestCaseInTempDir): | ||
780 | 846 | |||
781 | 847 | def create_tarball(self, package, version, compression, part=None): | ||
782 | 848 | basedir = "%s-%s" % (package, version) | ||
783 | 849 | os.mkdir(basedir) | ||
784 | 850 | try: | ||
785 | 851 | f = open(os.path.join(basedir, "README"), 'w') | ||
786 | 852 | try: | ||
787 | 853 | f.write("Hi\n") | ||
788 | 854 | finally: | ||
789 | 855 | f.close() | ||
790 | 856 | tar_path = os.path.abspath("%s_%s.orig.tar.%s" % (package, version, | ||
791 | 857 | compression)) | ||
792 | 858 | tf = tarfile.open(tar_path, 'w:%s' % compression) | ||
793 | 859 | try: | ||
794 | 860 | tf.add(basedir) | ||
795 | 861 | finally: | ||
796 | 862 | tf.close() | ||
797 | 863 | finally: | ||
798 | 864 | shutil.rmtree(basedir) | ||
799 | 865 | return tar_path | ||
800 | 866 | |||
801 | 867 | def test_single_orig_tar_gz(self): | ||
802 | 868 | tar_path = self.create_tarball("package", "0.1", "gz") | ||
803 | 869 | os.mkdir("target") | ||
804 | 870 | extract_orig_tarballs([tar_path], "target", strip_components=1) | ||
805 | 871 | self.assertEquals(os.listdir("target"), ["README"]) | ||
806 | 872 | |||
807 | 873 | def test_single_orig_tar_bz2(self): | ||
808 | 874 | tar_path = self.create_tarball("package", "0.1", "bz2") | ||
809 | 875 | os.mkdir("target") | ||
810 | 876 | extract_orig_tarballs([tar_path], "target", strip_components=1) | ||
811 | 877 | self.assertEquals(os.listdir("target"), ["README"]) | ||
812 | 878 | |||
813 | 879 | def test_multiple_tarballs(self): | ||
814 | 880 | base_tar_path = self.create_tarball("package", "0.1", "bz2") | ||
815 | 881 | tar_path_extra = self.create_tarball("package", "0.1", "bz2", part="extra") | ||
816 | 882 | os.mkdir("target") | ||
817 | 883 | self.assertRaises(MultipleUpstreamTarballsNotSupported, | ||
818 | 884 | extract_orig_tarballs, | ||
819 | 885 | [base_tar_path, tar_path_extra], "target") | ||
820 | 840 | 886 | ||
821 | === modified file 'upstream/pristinetar.py' | |||
822 | --- upstream/pristinetar.py 2011-06-14 12:26:21 +0000 | |||
823 | +++ upstream/pristinetar.py 2011-06-15 16:37:25 +0000 | |||
824 | @@ -29,6 +29,7 @@ | |||
825 | 29 | import tempfile | 29 | import tempfile |
826 | 30 | 30 | ||
827 | 31 | from bzrlib.plugins.builddeb.errors import ( | 31 | from bzrlib.plugins.builddeb.errors import ( |
828 | 32 | MultipleUpstreamTarballsNotSupported, | ||
829 | 32 | PackageVersionNotPresent, | 33 | PackageVersionNotPresent, |
830 | 33 | PerFileTimestampsNotSupported, | 34 | PerFileTimestampsNotSupported, |
831 | 34 | ) | 35 | ) |
832 | @@ -114,6 +115,9 @@ | |||
833 | 114 | self.branch = branch | 115 | self.branch = branch |
834 | 115 | self.tree = tree | 116 | self.tree = tree |
835 | 116 | 117 | ||
836 | 118 | def __repr__(self): | ||
837 | 119 | return "<%s at %s>" % (self.__class__.__name__, self.branch.base) | ||
838 | 120 | |||
839 | 117 | def tag_name(self, version, distro=None): | 121 | def tag_name(self, version, distro=None): |
840 | 118 | """Gets the tag name for the upstream part of version. | 122 | """Gets the tag name for the upstream part of version. |
841 | 119 | 123 | ||
842 | @@ -147,7 +151,7 @@ | |||
843 | 147 | raise PackageVersionNotPresent(package, version, self) | 151 | raise PackageVersionNotPresent(package, version, self) |
844 | 148 | return [target_filename] | 152 | return [target_filename] |
845 | 149 | 153 | ||
847 | 150 | def _has_version(self, tag_name, md5=None): | 154 | def _has_version(self, tag_name, tarballs=None): |
848 | 151 | if not self.branch.tags.has_tag(tag_name): | 155 | if not self.branch.tags.has_tag(tag_name): |
849 | 152 | return False | 156 | return False |
850 | 153 | revid = self.branch.tags.lookup_tag(tag_name) | 157 | revid = self.branch.tags.lookup_tag(tag_name) |
851 | @@ -158,8 +162,11 @@ | |||
852 | 158 | return False | 162 | return False |
853 | 159 | finally: | 163 | finally: |
854 | 160 | self.branch.unlock() | 164 | self.branch.unlock() |
856 | 161 | if md5 is None: | 165 | if tarballs is None: |
857 | 162 | return True | 166 | return True |
858 | 167 | if len(tarballs) != 1: | ||
859 | 168 | raise MultipleUpstreamTarballsNotSupported() | ||
860 | 169 | (filename, md5) = tarballs[0] | ||
861 | 163 | rev = self.branch.repository.get_revision(revid) | 170 | rev = self.branch.repository.get_revision(revid) |
862 | 164 | try: | 171 | try: |
863 | 165 | return rev.properties['deb-md5'] == md5 | 172 | return rev.properties['deb-md5'] == md5 |
864 | @@ -168,10 +175,10 @@ | |||
865 | 168 | "associated 'deb-md5' property" % tag_name) | 175 | "associated 'deb-md5' property" % tag_name) |
866 | 169 | return True | 176 | return True |
867 | 170 | 177 | ||
869 | 171 | def version_as_revision(self, package, version): | 178 | def version_as_revision(self, package, version, tarballs=None): |
870 | 172 | assert isinstance(version, str) | 179 | assert isinstance(version, str) |
871 | 173 | for tag_name in self.possible_tag_names(version): | 180 | for tag_name in self.possible_tag_names(version): |
873 | 174 | if self._has_version(tag_name): | 181 | if self._has_version(tag_name, tarballs): |
874 | 175 | return self.branch.tags.lookup_tag(tag_name) | 182 | return self.branch.tags.lookup_tag(tag_name) |
875 | 176 | tag_name = self.tag_name(version) | 183 | tag_name = self.tag_name(version) |
876 | 177 | try: | 184 | try: |
877 | @@ -179,10 +186,10 @@ | |||
878 | 179 | except NoSuchTag: | 186 | except NoSuchTag: |
879 | 180 | raise PackageVersionNotPresent(package, version, self) | 187 | raise PackageVersionNotPresent(package, version, self) |
880 | 181 | 188 | ||
882 | 182 | def has_version(self, package, version, md5=None): | 189 | def has_version(self, package, version, tarballs=None): |
883 | 183 | assert isinstance(version, str), str(type(version)) | 190 | assert isinstance(version, str), str(type(version)) |
884 | 184 | for tag_name in self.possible_tag_names(version): | 191 | for tag_name in self.possible_tag_names(version): |
886 | 185 | if self._has_version(tag_name, md5=md5): | 192 | if self._has_version(tag_name, tarballs=tarballs): |
887 | 186 | return True | 193 | return True |
888 | 187 | return False | 194 | return False |
889 | 188 | 195 |