Merge lp:~lifeless/bzr/bug-375013 into lp:~bzr/bzr/trunk-old
- bug-375013
- Merge into trunk-old
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | not available | ||||
Proposed branch: | lp:~lifeless/bzr/bug-375013 | ||||
Merge into: | lp:~bzr/bzr/trunk-old | ||||
Diff against target: | 309 lines | ||||
To merge this branch: | bzr merge lp:~lifeless/bzr/bug-375013 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Vincent Ladeuil | Approve | ||
Review via email: mp+9967@code.launchpad.net |
This proposal supersedes a proposal from 2009-08-10.
Commit message
Description of the change
Robert Collins (lifeless) wrote : Posted in a previous version of this proposal | # |
Martin Pool (mbp) : Posted in a previous version of this proposal | # |
Vincent Ladeuil (vila) wrote : | # |
With the clarifications given on IRC, this sounds trivial enough.
John A Meinel (jameinel) wrote : | # |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Robert Collins wrote:
> Robert Collins has proposed merging lp:~lifeless/bzr/bug-375013 into lp:bzr.
>
>
>
=== modified file 'bzrlib/
- --- bzrlib/__init__.py 2009-07-20 11:27:05 +0000
+++ bzrlib/__init__.py 2009-08-11 03:02:56 +0000
@@ -50,7 +50,7 @@
# Python version 2.0 is (2, 0, 0, 'final', 0)." Additionally we use a
# releaselevel of 'dev' for unreleased under-development code.
- -version_info = (1, 18, 0, 'dev', 0)
+version_info = (2, 0, 0, 'dev', 0)
^- So is this official then?
Certainly it seems spurious to bring this in as part of the rest of the
patch.
Especially given that you didn't bump "api_minimum_
see why it is relevant.
But hey, if we are officially doing it, then it doesn't really matter.
Anyway, if we are going to be rejecting commit, then we probably should
open another bug about:
"bzr merge BUNDLE" doesn't honor stacking invariants in stacked
repository, and do a similar "reject if local repository is stacked".
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://
iEYEARECAAYFAkq
sUIAoJJC3NO/
=8TWr
-----END PGP SIGNATURE-----
John A Meinel (jameinel) wrote : | # |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
...
> -version_info = (1, 18, 0, 'dev', 0)
> +version_info = (2, 0, 0, 'dev', 0)
>
> ^- So is this official then?
>
> Certainly it seems spurious to bring this in as part of the rest of the
> patch.
>
Please ignore me. It seems it is just MAD race again. I can see that
Martin did, indeed, update to 2.0 on bzr trunk, and probably you just
got that patch before Launchpad did... *sigh*.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://
iEYEARECAAYFAkq
gqEAmgPRGSsCU5b
=s4L0
-----END PGP SIGNATURE-----
Preview Diff
1 | === modified file 'NEWS' | |||
2 | --- NEWS 2009-08-11 02:58:23 +0000 | |||
3 | +++ NEWS 2009-08-11 10:35:16 +0000 | |||
4 | @@ -12,6 +12,12 @@ | |||
5 | 12 | Compatibility Breaks | 12 | Compatibility Breaks |
6 | 13 | ******************** | 13 | ******************** |
7 | 14 | 14 | ||
8 | 15 | * Committing directly to a stacked branch from a lightweight checkout will | ||
9 | 16 | no longer work. In previous versions this would appear to work but would | ||
10 | 17 | generate repositories with insufficient data to create deltas, leading | ||
11 | 18 | to later errors when branching or reading from the repository. | ||
12 | 19 | (Robert Collins, bug #375013) | ||
13 | 20 | |||
14 | 15 | New Features | 21 | New Features |
15 | 16 | ************ | 22 | ************ |
16 | 17 | 23 | ||
17 | 18 | 24 | ||
18 | === modified file 'bzrlib/repository.py' | |||
19 | --- bzrlib/repository.py 2009-08-06 02:23:37 +0000 | |||
20 | +++ bzrlib/repository.py 2009-08-11 10:35:16 +0000 | |||
21 | @@ -1695,6 +1695,10 @@ | |||
22 | 1695 | :param revprops: Optional dictionary of revision properties. | 1695 | :param revprops: Optional dictionary of revision properties. |
23 | 1696 | :param revision_id: Optional revision id. | 1696 | :param revision_id: Optional revision id. |
24 | 1697 | """ | 1697 | """ |
25 | 1698 | if self._fallback_repositories: | ||
26 | 1699 | raise errors.BzrError("Cannot commit from a lightweight checkout " | ||
27 | 1700 | "to a stacked branch. See " | ||
28 | 1701 | "https://bugs.launchpad.net/bzr/+bug/375013 for details.") | ||
29 | 1698 | result = self._commit_builder_class(self, parents, config, | 1702 | result = self._commit_builder_class(self, parents, config, |
30 | 1699 | timestamp, timezone, committer, revprops, revision_id) | 1703 | timestamp, timezone, committer, revprops, revision_id) |
31 | 1700 | self.start_write_group() | 1704 | self.start_write_group() |
32 | 1701 | 1705 | ||
33 | === modified file 'bzrlib/tests/blackbox/test_branch.py' | |||
34 | --- bzrlib/tests/blackbox/test_branch.py 2009-08-03 04:19:03 +0000 | |||
35 | +++ bzrlib/tests/blackbox/test_branch.py 2009-08-11 10:35:16 +0000 | |||
36 | @@ -149,29 +149,6 @@ | |||
37 | 149 | class TestBranchStacked(ExternalBase): | 149 | class TestBranchStacked(ExternalBase): |
38 | 150 | """Tests for branch --stacked""" | 150 | """Tests for branch --stacked""" |
39 | 151 | 151 | ||
40 | 152 | def check_shallow_branch(self, branch_revid, stacked_on): | ||
41 | 153 | """Assert that the branch 'newbranch' has been published correctly. | ||
42 | 154 | |||
43 | 155 | :param stacked_on: url of a branch this one is stacked upon. | ||
44 | 156 | :param branch_revid: a revision id that should be the only | ||
45 | 157 | revision present in the stacked branch, and it should not be in | ||
46 | 158 | the reference branch. | ||
47 | 159 | """ | ||
48 | 160 | new_branch = branch.Branch.open('newbranch') | ||
49 | 161 | # The branch refers to the mainline | ||
50 | 162 | self.assertEqual(stacked_on, new_branch.get_stacked_on_url()) | ||
51 | 163 | # and the branch's work was pushed | ||
52 | 164 | self.assertTrue(new_branch.repository.has_revision(branch_revid)) | ||
53 | 165 | # The newly committed revision shoud be present in the stacked branch, | ||
54 | 166 | # but not in the stacked-on branch. Because stacking is set up by the | ||
55 | 167 | # branch object, if we open the stacked branch's repository directly, | ||
56 | 168 | # bypassing the branch, we see only what's in the stacked repository. | ||
57 | 169 | stacked_repo = bzrdir.BzrDir.open('newbranch').open_repository() | ||
58 | 170 | stacked_repo_revisions = set(stacked_repo.all_revision_ids()) | ||
59 | 171 | if len(stacked_repo_revisions) != 1: | ||
60 | 172 | self.fail("wrong revisions in stacked repository: %r" | ||
61 | 173 | % (stacked_repo_revisions,)) | ||
62 | 174 | |||
63 | 175 | def assertRevisionInRepository(self, repo_path, revid): | 152 | def assertRevisionInRepository(self, repo_path, revid): |
64 | 176 | """Check that a revision is in a repository, disregarding stacking.""" | 153 | """Check that a revision is in a repository, disregarding stacking.""" |
65 | 177 | repo = bzrdir.BzrDir.open(repo_path).open_repository() | 154 | repo = bzrdir.BzrDir.open(repo_path).open_repository() |
66 | @@ -198,12 +175,14 @@ | |||
67 | 198 | format='1.9') | 175 | format='1.9') |
68 | 199 | branch_tree.branch.set_stacked_on_url(trunk_tree.branch.base) | 176 | branch_tree.branch.set_stacked_on_url(trunk_tree.branch.base) |
69 | 200 | # with some work on it | 177 | # with some work on it |
71 | 201 | branch_tree.commit('moar work plz') | 178 | work_tree = trunk_tree.branch.bzrdir.sprout('local').open_workingtree() |
72 | 179 | work_tree.commit('moar work plz') | ||
73 | 180 | work_tree.branch.push(branch_tree.branch) | ||
74 | 202 | # branching our local branch gives us a new stacked branch pointing at | 181 | # branching our local branch gives us a new stacked branch pointing at |
75 | 203 | # mainline. | 182 | # mainline. |
76 | 204 | out, err = self.run_bzr(['branch', 'branch', 'newbranch']) | 183 | out, err = self.run_bzr(['branch', 'branch', 'newbranch']) |
77 | 205 | self.assertEqual('', out) | 184 | self.assertEqual('', out) |
79 | 206 | self.assertEqual('Branched 1 revision(s).\n', | 185 | self.assertEqual('Branched 2 revision(s).\n', |
80 | 207 | err) | 186 | err) |
81 | 208 | # it should have preserved the branch format, and so it should be | 187 | # it should have preserved the branch format, and so it should be |
82 | 209 | # capable of supporting stacking, but not actually have a stacked_on | 188 | # capable of supporting stacking, but not actually have a stacked_on |
83 | @@ -222,7 +201,9 @@ | |||
84 | 222 | format='1.9') | 201 | format='1.9') |
85 | 223 | branch_tree.branch.set_stacked_on_url(trunk_tree.branch.base) | 202 | branch_tree.branch.set_stacked_on_url(trunk_tree.branch.base) |
86 | 224 | # with some work on it | 203 | # with some work on it |
88 | 225 | branch_revid = branch_tree.commit('moar work plz') | 204 | work_tree = trunk_tree.branch.bzrdir.sprout('local').open_workingtree() |
89 | 205 | branch_revid = work_tree.commit('moar work plz') | ||
90 | 206 | work_tree.branch.push(branch_tree.branch) | ||
91 | 226 | # you can chain branches on from there | 207 | # you can chain branches on from there |
92 | 227 | out, err = self.run_bzr(['branch', 'branch', '--stacked', 'branch2']) | 208 | out, err = self.run_bzr(['branch', 'branch', '--stacked', 'branch2']) |
93 | 228 | self.assertEqual('', out) | 209 | self.assertEqual('', out) |
94 | @@ -231,7 +212,8 @@ | |||
95 | 231 | self.assertEqual(branch_tree.branch.base, | 212 | self.assertEqual(branch_tree.branch.base, |
96 | 232 | branch.Branch.open('branch2').get_stacked_on_url()) | 213 | branch.Branch.open('branch2').get_stacked_on_url()) |
97 | 233 | branch2_tree = WorkingTree.open('branch2') | 214 | branch2_tree = WorkingTree.open('branch2') |
99 | 234 | branch2_revid = branch2_tree.commit('work on second stacked branch') | 215 | branch2_revid = work_tree.commit('work on second stacked branch') |
100 | 216 | work_tree.branch.push(branch2_tree.branch) | ||
101 | 235 | self.assertRevisionInRepository('branch2', branch2_revid) | 217 | self.assertRevisionInRepository('branch2', branch2_revid) |
102 | 236 | self.assertRevisionsInBranchRepository( | 218 | self.assertRevisionsInBranchRepository( |
103 | 237 | [trunk_revid, branch_revid, branch2_revid], | 219 | [trunk_revid, branch_revid, branch2_revid], |
104 | @@ -250,9 +232,8 @@ | |||
105 | 250 | self.assertEqual('Created new stacked branch referring to %s.\n' % | 232 | self.assertEqual('Created new stacked branch referring to %s.\n' % |
106 | 251 | trunk_tree.branch.base, err) | 233 | trunk_tree.branch.base, err) |
107 | 252 | self.assertRevisionNotInRepository('newbranch', original_revid) | 234 | self.assertRevisionNotInRepository('newbranch', original_revid) |
111 | 253 | new_tree = WorkingTree.open('newbranch') | 235 | new_branch = branch.Branch.open('newbranch') |
112 | 254 | new_revid = new_tree.commit('new work') | 236 | self.assertEqual(trunk_tree.branch.base, new_branch.get_stacked_on_url()) |
110 | 255 | self.check_shallow_branch(new_revid, trunk_tree.branch.base) | ||
113 | 256 | 237 | ||
114 | 257 | def test_branch_stacked_from_smart_server(self): | 238 | def test_branch_stacked_from_smart_server(self): |
115 | 258 | # We can branch stacking on a smart server | 239 | # We can branch stacking on a smart server |
116 | @@ -329,7 +310,9 @@ | |||
117 | 329 | t.commit(message='commit %d' % count) | 310 | t.commit(message='commit %d' % count) |
118 | 330 | tree2 = t.branch.bzrdir.sprout('feature', stacked=True | 311 | tree2 = t.branch.bzrdir.sprout('feature', stacked=True |
119 | 331 | ).open_workingtree() | 312 | ).open_workingtree() |
121 | 332 | tree2.commit('feature change') | 313 | local_tree = t.branch.bzrdir.sprout('local-working').open_workingtree() |
122 | 314 | local_tree.commit('feature change') | ||
123 | 315 | local_tree.branch.push(tree2.branch) | ||
124 | 333 | self.reset_smart_call_log() | 316 | self.reset_smart_call_log() |
125 | 334 | out, err = self.run_bzr(['branch', self.get_url('feature'), | 317 | out, err = self.run_bzr(['branch', self.get_url('feature'), |
126 | 335 | 'local-target']) | 318 | 'local-target']) |
127 | 336 | 319 | ||
128 | === modified file 'bzrlib/tests/per_branch/test_stacking.py' | |||
129 | --- bzrlib/tests/per_branch/test_stacking.py 2009-08-05 02:30:59 +0000 | |||
130 | +++ bzrlib/tests/per_branch/test_stacking.py 2009-08-11 10:35:16 +0000 | |||
131 | @@ -150,8 +150,8 @@ | |||
132 | 150 | raise TestNotApplicable(e) | 150 | raise TestNotApplicable(e) |
133 | 151 | # stacked repository | 151 | # stacked repository |
134 | 152 | self.assertRevisionNotInRepository('newbranch', trunk_revid) | 152 | self.assertRevisionNotInRepository('newbranch', trunk_revid) |
137 | 153 | new_tree = new_dir.open_workingtree() | 153 | tree = new_dir.open_branch().create_checkout('local') |
138 | 154 | new_branch_revid = new_tree.commit('something local') | 154 | new_branch_revid = tree.commit('something local') |
139 | 155 | self.assertRevisionNotInRepository('mainline', new_branch_revid) | 155 | self.assertRevisionNotInRepository('mainline', new_branch_revid) |
140 | 156 | self.assertRevisionInRepository('newbranch', new_branch_revid) | 156 | self.assertRevisionInRepository('newbranch', new_branch_revid) |
141 | 157 | 157 | ||
142 | @@ -173,8 +173,8 @@ | |||
143 | 173 | new_dir = remote_bzrdir.sprout('newbranch', stacked=True) | 173 | new_dir = remote_bzrdir.sprout('newbranch', stacked=True) |
144 | 174 | # stacked repository | 174 | # stacked repository |
145 | 175 | self.assertRevisionNotInRepository('newbranch', trunk_revid) | 175 | self.assertRevisionNotInRepository('newbranch', trunk_revid) |
148 | 176 | new_tree = new_dir.open_workingtree() | 176 | tree = new_dir.open_branch().create_checkout('local') |
149 | 177 | new_branch_revid = new_tree.commit('something local') | 177 | new_branch_revid = tree.commit('something local') |
150 | 178 | self.assertRevisionNotInRepository('mainline', new_branch_revid) | 178 | self.assertRevisionNotInRepository('mainline', new_branch_revid) |
151 | 179 | self.assertRevisionInRepository('newbranch', new_branch_revid) | 179 | self.assertRevisionInRepository('newbranch', new_branch_revid) |
152 | 180 | 180 | ||
153 | @@ -333,7 +333,8 @@ | |||
154 | 333 | 333 | ||
155 | 334 | def test_fetch_copies_from_stacked_on_and_stacked(self): | 334 | def test_fetch_copies_from_stacked_on_and_stacked(self): |
156 | 335 | stacked, unstacked = self.prepare_stacked_on_fetch() | 335 | stacked, unstacked = self.prepare_stacked_on_fetch() |
158 | 336 | stacked.commit('second commit', rev_id='rev2') | 336 | tree = stacked.branch.create_checkout('local') |
159 | 337 | tree.commit('second commit', rev_id='rev2') | ||
160 | 337 | unstacked.fetch(stacked.branch.repository, 'rev2') | 338 | unstacked.fetch(stacked.branch.repository, 'rev2') |
161 | 338 | unstacked.get_revision('rev1') | 339 | unstacked.get_revision('rev1') |
162 | 339 | unstacked.get_revision('rev2') | 340 | unstacked.get_revision('rev2') |
163 | @@ -355,13 +356,15 @@ | |||
164 | 355 | stack_on.add('a') | 356 | stack_on.add('a') |
165 | 356 | stack_on.commit('base commit') | 357 | stack_on.commit('base commit') |
166 | 357 | stacked_dir = stack_on.bzrdir.sprout('stacked', stacked=True) | 358 | stacked_dir = stack_on.bzrdir.sprout('stacked', stacked=True) |
168 | 358 | stacked_tree = stacked_dir.open_workingtree() | 359 | stacked_branch = stacked_dir.open_branch() |
169 | 360 | local_tree = stack_on.bzrdir.sprout('local').open_workingtree() | ||
170 | 359 | for i in range(20): | 361 | for i in range(20): |
171 | 360 | text_lines[0] = 'changed in %d\n' % i | 362 | text_lines[0] = 'changed in %d\n' % i |
176 | 361 | self.build_tree_contents([('stacked/a', ''.join(text_lines))]) | 363 | self.build_tree_contents([('local/a', ''.join(text_lines))]) |
177 | 362 | stacked_tree.commit('commit %d' % i) | 364 | local_tree.commit('commit %d' % i) |
178 | 363 | stacked_tree.branch.repository.pack() | 365 | local_tree.branch.push(stacked_branch) |
179 | 364 | check.check_dwim(stacked_tree.branch.base, False, True, True) | 366 | stacked_branch.repository.pack() |
180 | 367 | check.check_dwim(stacked_branch.base, False, True, True) | ||
181 | 365 | 368 | ||
182 | 366 | def test_pull_delta_when_stacked(self): | 369 | def test_pull_delta_when_stacked(self): |
183 | 367 | if not self.branch_format.supports_stacking(): | 370 | if not self.branch_format.supports_stacking(): |
184 | @@ -470,7 +473,8 @@ | |||
185 | 470 | except errors.NoWorkingTree: | 473 | except errors.NoWorkingTree: |
186 | 471 | stacked = stacked_dir.open_branch().create_checkout( | 474 | stacked = stacked_dir.open_branch().create_checkout( |
187 | 472 | 'stacked-checkout', lightweight=True) | 475 | 'stacked-checkout', lightweight=True) |
189 | 473 | stacked.commit('second commit', rev_id='rev2') | 476 | tree = stacked.branch.create_checkout('local') |
190 | 477 | tree.commit('second commit', rev_id='rev2') | ||
191 | 474 | # Sanity check: stacked's repo should not contain rev1, otherwise this | 478 | # Sanity check: stacked's repo should not contain rev1, otherwise this |
192 | 475 | # test isn't testing what it's supposed to. | 479 | # test isn't testing what it's supposed to. |
193 | 476 | repo = stacked.branch.repository.bzrdir.open_repository() | 480 | repo = stacked.branch.repository.bzrdir.open_repository() |
194 | 477 | 481 | ||
195 | === modified file 'bzrlib/tests/per_repository/test_commit_builder.py' | |||
196 | --- bzrlib/tests/per_repository/test_commit_builder.py 2009-05-06 05:36:28 +0000 | |||
197 | +++ bzrlib/tests/per_repository/test_commit_builder.py 2009-08-11 10:35:16 +0000 | |||
198 | @@ -1267,3 +1267,19 @@ | |||
199 | 1267 | self.addCleanup(branch.repository.abort_write_group) | 1267 | self.addCleanup(branch.repository.abort_write_group) |
200 | 1268 | self.assertRaises(ValueError, builder.commit, | 1268 | self.assertRaises(ValueError, builder.commit, |
201 | 1269 | u'Invalid\r\ncommit message\r\n') | 1269 | u'Invalid\r\ncommit message\r\n') |
202 | 1270 | |||
203 | 1271 | def test_stacked_repositories_reject_commit_builder(self): | ||
204 | 1272 | # As per bug 375013, committing to stacked repositories is currently | ||
205 | 1273 | # broken, so repositories with fallbacks refuse to hand out a commit | ||
206 | 1274 | # builder. | ||
207 | 1275 | repo_basis = self.make_repository('basis') | ||
208 | 1276 | branch = self.make_branch('local') | ||
209 | 1277 | repo_local = branch.repository | ||
210 | 1278 | try: | ||
211 | 1279 | repo_local.add_fallback_repository(repo_basis) | ||
212 | 1280 | except errors.UnstackableRepositoryFormat: | ||
213 | 1281 | raise tests.TestNotApplicable("not a stackable format.") | ||
214 | 1282 | repo_local.lock_write() | ||
215 | 1283 | self.addCleanup(repo_local.unlock) | ||
216 | 1284 | self.assertRaises(errors.BzrError, repo_local.get_commit_builder, | ||
217 | 1285 | branch, [], branch.get_config()) | ||
218 | 1270 | 1286 | ||
219 | === modified file 'bzrlib/tests/per_repository_reference/test_check.py' | |||
220 | --- bzrlib/tests/per_repository_reference/test_check.py 2009-03-23 14:59:43 +0000 | |||
221 | +++ bzrlib/tests/per_repository_reference/test_check.py 2009-08-11 10:35:16 +0000 | |||
222 | @@ -33,8 +33,9 @@ | |||
223 | 33 | referring = self.make_branch_and_tree('referring') | 33 | referring = self.make_branch_and_tree('referring') |
224 | 34 | readonly_base = self.readonly_repository('base') | 34 | readonly_base = self.readonly_repository('base') |
225 | 35 | referring.branch.repository.add_fallback_repository(readonly_base) | 35 | referring.branch.repository.add_fallback_repository(readonly_base) |
228 | 36 | self.build_tree_contents([('referring/file', 'change')]) | 36 | local_tree = referring.branch.create_checkout('local') |
229 | 37 | rev2_id = referring.commit('two') | 37 | self.build_tree_contents([('local/file', 'change')]) |
230 | 38 | rev2_id = local_tree.commit('two') | ||
231 | 38 | check_result = referring.branch.repository.check( | 39 | check_result = referring.branch.repository.check( |
232 | 39 | referring.branch.repository.all_revision_ids()) | 40 | referring.branch.repository.all_revision_ids()) |
233 | 40 | check_result.report_results(verbose=False) | 41 | check_result.report_results(verbose=False) |
234 | 41 | 42 | ||
235 | === modified file 'bzrlib/tests/test_pack_repository.py' | |||
236 | --- bzrlib/tests/test_pack_repository.py 2009-07-17 10:38:41 +0000 | |||
237 | +++ bzrlib/tests/test_pack_repository.py 2009-08-11 10:35:16 +0000 | |||
238 | @@ -865,7 +865,8 @@ | |||
239 | 865 | base.commit('foo') | 865 | base.commit('foo') |
240 | 866 | referencing = self.make_branch_and_tree('repo', format=self.get_format()) | 866 | referencing = self.make_branch_and_tree('repo', format=self.get_format()) |
241 | 867 | referencing.branch.repository.add_fallback_repository(base.branch.repository) | 867 | referencing.branch.repository.add_fallback_repository(base.branch.repository) |
243 | 868 | referencing.commit('bar') | 868 | local_tree = referencing.branch.create_checkout('local') |
244 | 869 | local_tree.commit('bar') | ||
245 | 869 | new_instance = referencing.bzrdir.open_repository() | 870 | new_instance = referencing.bzrdir.open_repository() |
246 | 870 | new_instance.lock_read() | 871 | new_instance.lock_read() |
247 | 871 | self.addCleanup(new_instance.unlock) | 872 | self.addCleanup(new_instance.unlock) |
248 | @@ -884,13 +885,14 @@ | |||
249 | 884 | # and max packs policy - so we are checking the policy is honoured | 885 | # and max packs policy - so we are checking the policy is honoured |
250 | 885 | # in the test. But for now 11 commits is not a big deal in a single | 886 | # in the test. But for now 11 commits is not a big deal in a single |
251 | 886 | # test. | 887 | # test. |
252 | 888 | local_tree = tree.branch.create_checkout('local') | ||
253 | 887 | for x in range(9): | 889 | for x in range(9): |
255 | 888 | tree.commit('commit %s' % x) | 890 | local_tree.commit('commit %s' % x) |
256 | 889 | # there should be 9 packs: | 891 | # there should be 9 packs: |
257 | 890 | index = self.index_class(trans, 'pack-names', None) | 892 | index = self.index_class(trans, 'pack-names', None) |
258 | 891 | self.assertEqual(9, len(list(index.iter_all_entries()))) | 893 | self.assertEqual(9, len(list(index.iter_all_entries()))) |
259 | 892 | # committing one more should coalesce to 1 of 10. | 894 | # committing one more should coalesce to 1 of 10. |
261 | 893 | tree.commit('commit triggering pack') | 895 | local_tree.commit('commit triggering pack') |
262 | 894 | index = self.index_class(trans, 'pack-names', None) | 896 | index = self.index_class(trans, 'pack-names', None) |
263 | 895 | self.assertEqual(1, len(list(index.iter_all_entries()))) | 897 | self.assertEqual(1, len(list(index.iter_all_entries()))) |
264 | 896 | # packing should not damage data | 898 | # packing should not damage data |
265 | @@ -909,7 +911,7 @@ | |||
266 | 909 | # in the obsolete_packs directory. | 911 | # in the obsolete_packs directory. |
267 | 910 | large_pack_name = list(index.iter_all_entries())[0][1][0] | 912 | large_pack_name = list(index.iter_all_entries())[0][1][0] |
268 | 911 | # finally, committing again should not touch the large pack. | 913 | # finally, committing again should not touch the large pack. |
270 | 912 | tree.commit('commit not triggering pack') | 914 | local_tree.commit('commit not triggering pack') |
271 | 913 | index = self.index_class(trans, 'pack-names', None) | 915 | index = self.index_class(trans, 'pack-names', None) |
272 | 914 | self.assertEqual(2, len(list(index.iter_all_entries()))) | 916 | self.assertEqual(2, len(list(index.iter_all_entries()))) |
273 | 915 | pack_names = [node[1][0] for node in index.iter_all_entries()] | 917 | pack_names = [node[1][0] for node in index.iter_all_entries()] |
274 | 916 | 918 | ||
275 | === modified file 'bzrlib/tests/test_remote.py' | |||
276 | --- bzrlib/tests/test_remote.py 2009-07-30 04:27:05 +0000 | |||
277 | +++ bzrlib/tests/test_remote.py 2009-08-11 10:35:16 +0000 | |||
278 | @@ -2651,7 +2651,8 @@ | |||
279 | 2651 | tree1.commit('rev1', rev_id='rev1') | 2651 | tree1.commit('rev1', rev_id='rev1') |
280 | 2652 | tree2 = tree1.branch.bzrdir.sprout('tree2', stacked=True | 2652 | tree2 = tree1.branch.bzrdir.sprout('tree2', stacked=True |
281 | 2653 | ).open_workingtree() | 2653 | ).open_workingtree() |
283 | 2654 | tree2.commit('local changes make me feel good.') | 2654 | local_tree = tree2.branch.create_checkout('local') |
284 | 2655 | local_tree.commit('local changes make me feel good.') | ||
285 | 2655 | branch2 = Branch.open(self.get_url('tree2')) | 2656 | branch2 = Branch.open(self.get_url('tree2')) |
286 | 2656 | branch2.lock_read() | 2657 | branch2.lock_read() |
287 | 2657 | self.addCleanup(branch2.unlock) | 2658 | self.addCleanup(branch2.unlock) |
288 | @@ -2727,7 +2728,8 @@ | |||
289 | 2727 | _, stacked = self.prepare_stacked_remote_branch() | 2728 | _, stacked = self.prepare_stacked_remote_branch() |
290 | 2728 | tree = stacked.bzrdir.sprout('tree3', stacked=True | 2729 | tree = stacked.bzrdir.sprout('tree3', stacked=True |
291 | 2729 | ).open_workingtree() | 2730 | ).open_workingtree() |
293 | 2730 | tree.commit('more local changes are better') | 2731 | local_tree = tree.branch.create_checkout('local-tree3') |
294 | 2732 | local_tree.commit('more local changes are better') | ||
295 | 2731 | branch = Branch.open(self.get_url('tree3')) | 2733 | branch = Branch.open(self.get_url('tree3')) |
296 | 2732 | branch.lock_read() | 2734 | branch.lock_read() |
297 | 2733 | return None, branch | 2735 | return None, branch |
298 | @@ -2744,8 +2746,9 @@ | |||
299 | 2744 | # stacked upon sources in topological order. | 2746 | # stacked upon sources in topological order. |
300 | 2745 | rev_ord, expected_revs = self.get_ordered_revs('knit', 'topological') | 2747 | rev_ord, expected_revs = self.get_ordered_revs('knit', 'topological') |
301 | 2746 | self.assertEqual(expected_revs, rev_ord) | 2748 | self.assertEqual(expected_revs, rev_ord) |
304 | 2747 | # Getting topological sort requires VFS calls still | 2749 | # Getting topological sort requires VFS calls still - one of which is |
305 | 2748 | self.assertLength(12, self.hpss_calls) | 2750 | # pushing up from the bound branch. |
306 | 2751 | self.assertLength(13, self.hpss_calls) | ||
307 | 2749 | 2752 | ||
308 | 2750 | def test_stacked_get_stream_groupcompress(self): | 2753 | def test_stacked_get_stream_groupcompress(self): |
309 | 2751 | # Repository._get_source.get_stream() from a stacked repository with | 2754 | # Repository._get_source.get_stream() from a stacked repository with |
Fix test_branch_ from_trivial_ stacked_ branch_ streaming_ acceptance to work
with rich root formats, pending work on bug 375013.
Basically, committing to stacked branches is broken if there is any
actual content, but this test isn't trying to exercise that - and this
prevents changing the default in our test suite to a rich root format.
So I've fixed the test, and that may permit us to reduce the priority of
the bug (as its an existing defect in bzr, for any rich root format).
-Rob