Merge lp:~mbp/bzr/715000-more-fallbacks into lp:bzr

Proposed by Martin Pool
Status: Merged
Approved by: Martin Pool
Approved revision: no longer in the source branch.
Merged at revision: 5663
Proposed branch: lp:~mbp/bzr/715000-more-fallbacks
Merge into: lp:bzr
Diff against target: 1033 lines (+601/-96) (has conflicts)
11 files modified
bzrlib/groupcompress.py (+5/-5)
bzrlib/knit.py (+13/-13)
bzrlib/tests/blackbox/test_branch.py (+42/-0)
bzrlib/tests/blackbox/test_pull.py (+22/-0)
bzrlib/tests/per_branch/test_pull.py (+57/-0)
bzrlib/tests/per_controldir/test_controldir.py (+100/-0)
bzrlib/tests/per_repository_reference/test_graph.py (+48/-0)
bzrlib/versionedfile.py (+21/-4)
bzrlib/workingtree.py (+14/-0)
doc/en/release-notes/bzr-2.2.txt (+150/-74)
doc/en/release-notes/bzr-2.4.txt (+129/-0)
Text conflict in bzrlib/tests/blackbox/test_branch.py
Text conflict in bzrlib/tests/blackbox/test_pull.py
Text conflict in bzrlib/tests/per_branch/test_pull.py
Text conflict in bzrlib/tests/per_controldir/test_controldir.py
Text conflict in bzrlib/tests/per_repository_reference/test_graph.py
Text conflict in bzrlib/versionedfile.py
Text conflict in bzrlib/workingtree.py
Text conflict in doc/en/release-notes/bzr-2.2.txt
Text conflict in doc/en/release-notes/bzr-2.4.txt
To merge this branch: bzr merge lp:~mbp/bzr/715000-more-fallbacks
Reviewer Review Type Date Requested Status
Andrew Bennetts Approve
Review via email: mp+49028@code.launchpad.net

This proposal supersedes a proposal from 2011-02-09.

Commit message

rename _fallback_vfs to _immediate_fallback_vfs to make the meaning more clear

Description of the change

follow-through from bug 715000: rename _fallback_vfs to _immediate_fallbacks to make it clear it's not the whole stack.

To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) wrote : Posted in a previous version of this proposal

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2/9/2011 2:08 AM, Martin Pool wrote:
> Martin Pool has proposed merging lp:~mbp/bzr/715000-more-fallbacks into lp:bzr.
>
> Requested reviews:
> bzr-core (bzr-core)
>
> For more details, see:
> https://code.launchpad.net/~mbp/bzr/715000-more-fallbacks/+merge/49025
>
> follow-through from bug 715000: rename _fallback_vfs to _immediate_fallbacks to make it clear it's not the whole stack.

I'm ok with the change, but I would make it "_immediate_fallback_vfs" to
distinguish it from "_immediate_fallback_repositories".
Mostly to be easily greppable.

I don't personally find it better, mostly because the added length
doesn't add much. It seems a simple

  :ivar _fallback_vfs: Immediate fallbacks, note this is not transitive

Could be a better way to go.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1St0oACgkQJdeBCYSNAAOLHQCg0Yj/BsMKAzL4Sr5OhGQbxBoZ
9FMAnj/yOfdMjxhNnjLFiYvdnY9+ansx
=LcsQ
-----END PGP SIGNATURE-----

Revision history for this message
John A Meinel (jameinel) wrote : Posted in a previous version of this proposal

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2/9/2011 2:09 AM, Martin Pool wrote:
> Martin Pool has proposed merging lp:~mbp/bzr/715000-more-fallbacks into lp:bzr/2.2.
>
> Requested reviews:
> bzr-core (bzr-core)
>
> For more details, see:
> https://code.launchpad.net/~mbp/bzr/715000-more-fallbacks/+merge/49026
>
> follow-through from bug 715000: rename _fallback_vfs to _immediate_fallbacks to make it clear it's not the whole stack.

I don't really like changing the name of things in a stable series. Do
you feel this is really necessary?

 review: needs_information

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1St2gACgkQJdeBCYSNAAPIYwCeJ4s9T48rbxRduTts3rarhkPu
1UMAoKDzNFENu713ShbJuPiCF9zDJQdi
=F4wU
-----END PGP SIGNATURE-----

review: Needs Information
Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2/9/2011 2:16 AM, Martin Pool wrote:
> Martin Pool has proposed merging lp:~mbp/bzr/715000-more-fallbacks into lp:bzr.
>
> Requested reviews:
> bzr-core (bzr-core)
>
> For more details, see:
> https://code.launchpad.net/~mbp/bzr/715000-more-fallbacks/+merge/49028
>
> follow-through from bug 715000: rename _fallback_vfs to _immediate_fallbacks to make it clear it's not the whole stack.

I got something like 5 of these emails from you. I'm guessing some of
them were accidental, but it is unclear from the messages. Can you
clarify which ones of these you actually want reviewed?

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1St5QACgkQJdeBCYSNAAPIcgCdHZbDk8uCtmjnymDQTgv5aDck
MKYAoIQY4xBvQpWhrWUVhZqEHTW0PMCU
=9S+7
-----END PGP SIGNATURE-----

Revision history for this message
Andrew Bennetts (spiv) wrote :

Like John, I think _immediate_fallbacks_vfs (or maybe _immediate_vfs_fallbacks?) would be a little clearer, because repositories also have a fallbacks attribute. I'm ok with whatever name you decide on.

The patch itself seems to be just a mechanical rename of the variable, plus the merge of the bug 715000 fix, so that all looks good.

review: Approve
Revision history for this message
Martin Pool (mbp) wrote :

I'll update it to _immediate_fallback_vfs

Revision history for this message
Martin Pool (mbp) wrote :

On 10 February 2011 02:49, John Arbash Meinel <email address hidden> wrote:
> I got something like 5 of these emails from you. I'm guessing some of
> them were accidental, but it is unclear from the messages. Can you
> clarify which ones of these you actually want reviewed?

not my fault - see https://bugs.launchpad.net/launchpad/+bug/716169 -
it should be clear on the web pages which ones are still alive.

Revision history for this message
Martin Pool (mbp) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/branch.py'
2=== modified file 'bzrlib/builtins.py'
3=== modified file 'bzrlib/bzrdir.py'
4=== modified file 'bzrlib/groupcompress.py'
5--- bzrlib/groupcompress.py 2011-02-09 06:35:00 +0000
6+++ bzrlib/groupcompress.py 2011-02-14 03:03:52 +0000
7@@ -1186,7 +1186,7 @@
8 _unadded_refs = {}
9 self._unadded_refs = _unadded_refs
10 self._group_cache = LRUSizeCache(max_size=50*1024*1024)
11- self._fallback_vfs = []
12+ self._immediate_fallback_vfs = []
13
14 def without_fallbacks(self):
15 """Return a clone of this object without any fallbacks configured."""
16@@ -1266,7 +1266,7 @@
17
18 :param a_versioned_files: A VersionedFiles object.
19 """
20- self._fallback_vfs.append(a_versioned_files)
21+ self._immediate_fallback_vfs.append(a_versioned_files)
22
23 def annotate(self, key):
24 """See VersionedFiles.annotate."""
25@@ -1342,7 +1342,7 @@
26 and so on.
27 """
28 result = {}
29- sources = [self._index] + self._fallback_vfs
30+ sources = [self._index] + self._immediate_fallback_vfs
31 source_results = []
32 missing = set(keys)
33 for source in sources:
34@@ -1449,7 +1449,7 @@
35 parent_map = {}
36 key_to_source_map = {}
37 source_results = []
38- for source in self._fallback_vfs:
39+ for source in self._immediate_fallback_vfs:
40 if not missing:
41 break
42 source_parents = source.get_parent_map(missing)
43@@ -1832,7 +1832,7 @@
44 """See VersionedFiles.keys."""
45 if 'evil' in debug.debug_flags:
46 trace.mutter_callsite(2, "keys scales with size of history")
47- sources = [self._index] + self._fallback_vfs
48+ sources = [self._index] + self._immediate_fallback_vfs
49 result = set()
50 for source in sources:
51 result.update(source.keys())
52
53=== modified file 'bzrlib/knit.py'
54--- bzrlib/knit.py 2011-02-09 06:35:00 +0000
55+++ bzrlib/knit.py 2011-02-14 03:03:52 +0000
56@@ -883,7 +883,7 @@
57 self._factory = KnitAnnotateFactory()
58 else:
59 self._factory = KnitPlainFactory()
60- self._fallback_vfs = []
61+ self._immediate_fallback_vfs = []
62 self._reload_func = reload_func
63
64 def __repr__(self):
65@@ -897,7 +897,7 @@
66
67 :param a_versioned_files: A VersionedFiles object.
68 """
69- self._fallback_vfs.append(a_versioned_files)
70+ self._immediate_fallback_vfs.append(a_versioned_files)
71
72 def add_lines(self, key, parents, lines, parent_texts=None,
73 left_matching_blocks=None, nostore_sha=None, random_id=False,
74@@ -1070,7 +1070,7 @@
75 raise errors.KnitCorrupt(self,
76 "Missing basis parent %s for %s" % (
77 compression_parent, key))
78- for fallback_vfs in self._fallback_vfs:
79+ for fallback_vfs in self._immediate_fallback_vfs:
80 fallback_vfs.check()
81
82 def _check_add(self, key, lines, random_id, check_content):
83@@ -1226,7 +1226,7 @@
84 and so on.
85 """
86 result = {}
87- sources = [self._index] + self._fallback_vfs
88+ sources = [self._index] + self._immediate_fallback_vfs
89 source_results = []
90 missing = set(keys)
91 for source in sources:
92@@ -1526,7 +1526,7 @@
93 yield KnitContentFactory(key, global_map[key],
94 record_details, None, raw_data, self._factory.annotated, None)
95 else:
96- vf = self._fallback_vfs[parent_maps.index(source) - 1]
97+ vf = self._immediate_fallback_vfs[parent_maps.index(source) - 1]
98 for record in vf.get_record_stream(keys, ordering,
99 include_delta_closure):
100 yield record
101@@ -1542,7 +1542,7 @@
102 # record entry 2 is the 'digest'.
103 result[key] = details[2]
104 missing.difference_update(set(result))
105- for source in self._fallback_vfs:
106+ for source in self._immediate_fallback_vfs:
107 if not missing:
108 break
109 new_result = source.get_sha1s(missing)
110@@ -1619,7 +1619,7 @@
111 raise RevisionNotPresent([record.key], self)
112 elif ((record.storage_kind in knit_types)
113 and (compression_parent is None
114- or not self._fallback_vfs
115+ or not self._immediate_fallback_vfs
116 or self._index.has_key(compression_parent)
117 or not self.has_key(compression_parent))):
118 # we can insert the knit record literally if either it has no
119@@ -1797,11 +1797,11 @@
120 # vfs, and hope to find them there. Note that if the keys are found
121 # but had no changes or no content, the fallback may not return
122 # anything.
123- if keys and not self._fallback_vfs:
124+ if keys and not self._immediate_fallback_vfs:
125 # XXX: strictly the second parameter is meant to be the file id
126 # but it's not easily accessible here.
127 raise RevisionNotPresent(keys, repr(self))
128- for source in self._fallback_vfs:
129+ for source in self._immediate_fallback_vfs:
130 if not keys:
131 break
132 source_keys = set()
133@@ -2016,7 +2016,7 @@
134 """See VersionedFiles.keys."""
135 if 'evil' in debug.debug_flags:
136 trace.mutter_callsite(2, "keys scales with size of history")
137- sources = [self._index] + self._fallback_vfs
138+ sources = [self._index] + self._immediate_fallback_vfs
139 result = set()
140 for source in sources:
141 result.update(source.keys())
142@@ -2062,7 +2062,7 @@
143
144 missing_keys = set(nonlocal_keys)
145 # Read from remote versioned file instances and provide to our caller.
146- for source in self.vf._fallback_vfs:
147+ for source in self.vf._immediate_fallback_vfs:
148 if not missing_keys:
149 break
150 # Loop over fallback repositories asking them for texts - ignore
151@@ -3521,8 +3521,8 @@
152 return records, ann_keys
153
154 def _get_needed_texts(self, key, pb=None):
155- # if True or len(self._vf._fallback_vfs) > 0:
156- if len(self._vf._fallback_vfs) > 0:
157+ # if True or len(self._vf._immediate_fallback_vfs) > 0:
158+ if len(self._vf._immediate_fallback_vfs) > 0:
159 # If we have fallbacks, go to the generic path
160 for v in annotate.Annotator._get_needed_texts(self, key, pb=pb):
161 yield v
162
163=== modified file 'bzrlib/plugins/launchpad/lp_api.py'
164=== modified file 'bzrlib/repofmt/weaverepo.py'
165=== modified file 'bzrlib/repository.py'
166=== modified file 'bzrlib/tests/__init__.py'
167=== modified file 'bzrlib/tests/blackbox/test_branch.py'
168--- bzrlib/tests/blackbox/test_branch.py 2011-02-11 05:57:31 +0000
169+++ bzrlib/tests/blackbox/test_branch.py 2011-02-14 03:03:52 +0000
170@@ -28,7 +28,10 @@
171 from bzrlib.repofmt.knitrepo import RepositoryFormatKnit1
172 from bzrlib.tests import TestCaseWithTransport
173 from bzrlib.tests import (
174+<<<<<<< TREE
175 fixtures,
176+=======
177+>>>>>>> MERGE-SOURCE
178 HardlinkFeature,
179 test_server,
180 )
181@@ -269,6 +272,7 @@
182 self.run_bzr('checkout --lightweight a b')
183 self.assertLength(2, calls)
184
185+<<<<<<< TREE
186 def test_branch_fetches_all_tags(self):
187 builder = self.make_branch_builder('source')
188 source = fixtures.build_branch_with_non_ancestral_rev(builder)
189@@ -280,6 +284,22 @@
190 self.assertEqual('rev-2', new_branch.tags.lookup_tag('tag-a'))
191 new_branch.repository.get_revision('rev-2')
192
193+=======
194+ def test_branch_fetches_all_tags(self):
195+ builder = self.make_branch_builder('source')
196+ builder.build_commit(message="Rev 1", rev_id='rev-1')
197+ builder.build_commit(message="Rev 2", rev_id='rev-2')
198+ source = builder.get_branch()
199+ source.tags.set_tag('tag-a', 'rev-2')
200+ source.set_last_revision_info(1, 'rev-1')
201+ # Now source has a tag not in its ancestry. Make a branch from it.
202+ self.run_bzr('branch source new-branch')
203+ new_branch = branch.Branch.open('new-branch')
204+ # The tag is present, and so is its revision.
205+ self.assertEqual('rev-2', new_branch.tags.lookup_tag('tag-a'))
206+ new_branch.repository.get_revision('rev-2')
207+
208+>>>>>>> MERGE-SOURCE
209
210 class TestBranchStacked(TestCaseWithTransport):
211 """Tests for branch --stacked"""
212@@ -461,6 +481,7 @@
213 # upwards without agreement from bzr's network support maintainers.
214 self.assertLength(14, self.hpss_calls)
215
216+<<<<<<< TREE
217 def test_branch_from_branch_with_tags(self):
218 self.setup_smart_server_with_call_log()
219 builder = self.make_branch_builder('source')
220@@ -477,6 +498,27 @@
221 # upwards without agreement from bzr's network support maintainers.
222 self.assertLength(9, self.hpss_calls)
223
224+=======
225+ def test_branch_from_branch_with_tags(self):
226+ self.setup_smart_server_with_call_log()
227+ builder = self.make_branch_builder('source')
228+ builder.build_commit(message="Rev 1", rev_id='rev-1')
229+ builder.build_commit(message="Rev 2", rev_id='rev-2')
230+ source = builder.get_branch()
231+ source.tags.set_tag('tag-a', 'rev-2')
232+ source.tags.set_tag('tag-missing', 'missing-rev')
233+ source.set_last_revision_info(1, 'rev-1')
234+ # Now source has a tag not in its ancestry. Make a branch from it.
235+ self.reset_smart_call_log()
236+ out, err = self.run_bzr(['branch', self.get_url('source'), 'target'])
237+ # This figure represent the amount of work to perform this use case. It
238+ # is entirely ok to reduce this number if a test fails due to rpc_count
239+ # being too low. If rpc_count increases, more network roundtrips have
240+ # become necessary for this use case. Please do not adjust this number
241+ # upwards without agreement from bzr's network support maintainers.
242+ self.assertLength(9, self.hpss_calls)
243+
244+>>>>>>> MERGE-SOURCE
245
246 class TestRemoteBranch(TestCaseWithSFTPServer):
247
248
249=== modified file 'bzrlib/tests/blackbox/test_pull.py'
250--- bzrlib/tests/blackbox/test_pull.py 2011-02-11 05:57:31 +0000
251+++ bzrlib/tests/blackbox/test_pull.py 2011-02-14 03:03:52 +0000
252@@ -145,6 +145,7 @@
253 self.run_bzr('pull -r 4')
254 self.assertEqual(a.revision_history(), b.revision_history())
255
256+<<<<<<< TREE
257 def test_pull_tags(self):
258 """Tags are updated by pull, and revisions named in those tags are
259 fetched.
260@@ -160,6 +161,27 @@
261 # The tag is present, and so is its revision.
262 self.assertEqual('rev-2', target.tags.lookup_tag('tag-a'))
263 target.repository.get_revision('rev-2')
264+=======
265+ def test_pull_tags(self):
266+ """Tags are updated by pull, and revisions named in those tags are
267+ fetched.
268+ """
269+ # Make a source, sprout a target off it
270+ builder = self.make_branch_builder('source')
271+ builder.build_commit(message="Rev 1", rev_id='rev-1')
272+ source = builder.get_branch()
273+ target_bzrdir = source.bzrdir.sprout('target')
274+ # Add a non-ancestry tag to source
275+ builder.build_commit(message="Rev 2", rev_id='rev-2')
276+ source.tags.set_tag('tag-a', 'rev-2')
277+ source.set_last_revision_info(1, 'rev-1')
278+ # Pull from source
279+ self.run_bzr('pull -d target source')
280+ target = target_bzrdir.open_branch()
281+ # The tag is present, and so is its revision.
282+ self.assertEqual('rev-2', target.tags.lookup_tag('tag-a'))
283+ target.repository.get_revision('rev-2')
284+>>>>>>> MERGE-SOURCE
285
286 def test_overwrite_uptodate(self):
287 # Make sure pull --overwrite overwrites
288
289=== modified file 'bzrlib/tests/per_branch/test_pull.py'
290--- bzrlib/tests/per_branch/test_pull.py 2011-02-09 06:36:35 +0000
291+++ bzrlib/tests/per_branch/test_pull.py 2011-02-14 03:03:52 +0000
292@@ -25,11 +25,15 @@
293 memorytree,
294 revision,
295 )
296+<<<<<<< TREE
297 from bzrlib.tests import (
298 fixtures,
299 per_branch,
300 TestNotApplicable,
301 )
302+=======
303+from bzrlib.tests import per_branch, TestNotApplicable
304+>>>>>>> MERGE-SOURCE
305
306
307 class TestPull(per_branch.TestCaseWithBranch):
308@@ -139,6 +143,7 @@
309 self.assertEqual(tree_b.branch.revision_history(),
310 tree_a.branch.revision_history())
311
312+<<<<<<< TREE
313 def test_pull_merges_and_fetches_tags(self):
314 """Tags are updated by br.pull(source), and revisions named in those
315 tags are fetched.
316@@ -182,6 +187,58 @@
317 self.assertEqual('rev-2', target.tags.lookup_tag('tag-a'))
318 target.repository.get_revision('rev-2')
319
320+=======
321+ def test_pull_merges_and_fetches_tags(self):
322+ """Tags are updated by br.pull(source), and revisions named in those
323+ tags are fetched.
324+ """
325+ # Make a source, sprout a target off it
326+ try:
327+ builder = self.make_branch_builder('source')
328+ except errors.UninitializableFormat:
329+ raise TestNotApplicable('uninitializeable format')
330+ builder.build_commit(message="Rev 1", rev_id='rev-1')
331+ source = builder.get_branch()
332+ target = source.bzrdir.sprout('target').open_branch()
333+ # Add a non-ancestry tag to source
334+ builder.build_commit(message="Rev 2", rev_id='rev-2')
335+ try:
336+ source.tags.set_tag('tag-a', 'rev-2')
337+ except errors.TagsNotSupported:
338+ raise TestNotApplicable('format does not support tags.')
339+ source.set_last_revision_info(1, 'rev-1')
340+ # Pull from source
341+ target.pull(source)
342+ # The tag is present, and so is its revision.
343+ self.assertEqual('rev-2', target.tags.lookup_tag('tag-a'))
344+ target.repository.get_revision('rev-2')
345+
346+ def test_pull_stop_revision_merges_and_fetches_tags(self):
347+ """br.pull(source, stop_revision=REV) updates and fetches tags."""
348+ # Make a source, sprout a target off it
349+ try:
350+ builder = self.make_branch_builder('source')
351+ except errors.UninitializableFormat:
352+ raise TestNotApplicable('uninitializeable format')
353+ builder.build_commit(message="Rev 1", rev_id='rev-1')
354+ source = builder.get_branch()
355+ target = source.bzrdir.sprout('target').open_branch()
356+ # Add a non-ancestry tag to source
357+ builder.build_commit(message="Rev 2", rev_id='rev-2')
358+ try:
359+ source.tags.set_tag('tag-a', 'rev-2')
360+ except errors.TagsNotSupported:
361+ raise TestNotApplicable('format does not support tags.')
362+ source.set_last_revision_info(1, 'rev-1')
363+ # Add a new commit to the ancestry
364+ builder.build_commit(message="Rev 2 again", rev_id='rev-2-again')
365+ # Pull from source
366+ target.pull(source, 'rev-2-again')
367+ # The tag is present, and so is its revision.
368+ self.assertEqual('rev-2', target.tags.lookup_tag('tag-a'))
369+ target.repository.get_revision('rev-2')
370+
371+>>>>>>> MERGE-SOURCE
372
373 class TestPullHook(per_branch.TestCaseWithBranch):
374
375
376=== modified file 'bzrlib/tests/per_controldir/test_controldir.py'
377--- bzrlib/tests/per_controldir/test_controldir.py 2011-02-11 05:57:31 +0000
378+++ bzrlib/tests/per_controldir/test_controldir.py 2011-02-14 03:03:52 +0000
379@@ -673,6 +673,7 @@
380 target = dir.sprout(self.get_url('target'), revision_id='1')
381 self.assertEqual('1', target.open_branch().last_revision())
382
383+<<<<<<< TREE
384 def test_sprout_bzrdir_branch_with_tags(self):
385 # when sprouting a branch all revisions named in the tags are copied
386 # too.
387@@ -767,6 +768,105 @@
388 ['base-rev', 'rev-b1', 'rev-b2', 'rev-c1', 'rev-c2'],
389 sorted(new_branch.repository.all_revision_ids()))
390
391+=======
392+ def test_sprout_bzrdir_branch_with_tags(self):
393+ # when sprouting a branch all revisions named in the tags are copied
394+ # too.
395+ builder = self.make_branch_builder('source')
396+ builder.build_commit(message="Rev 1", rev_id='rev-1')
397+ builder.build_commit(message="Rev 2", rev_id='rev-2')
398+ source = builder.get_branch()
399+ try:
400+ source.tags.set_tag('tag-a', 'rev-2')
401+ except errors.TagsNotSupported:
402+ raise TestNotApplicable('Branch format does not support tags.')
403+ source.set_last_revision_info(1, 'rev-1')
404+ # Now source has a tag not in its ancestry. Sprout its controldir.
405+ dir = source.bzrdir
406+ target = dir.sprout(self.get_url('target'))
407+ # The tag is present, and so is its revision.
408+ new_branch = target.open_branch()
409+ self.assertEqual('rev-2', new_branch.tags.lookup_tag('tag-a'))
410+ new_branch.repository.get_revision('rev-2')
411+
412+ def test_sprout_bzrdir_branch_with_absent_tag(self):
413+ # tags referencing absent revisions are copied (and those absent
414+ # revisions do not prevent the sprout.)
415+ builder = self.make_branch_builder('source')
416+ builder.build_commit(message="Rev 1", rev_id='rev-1')
417+ source = builder.get_branch()
418+ try:
419+ source.tags.set_tag('tag-a', 'missing-rev')
420+ except errors.TagsNotSupported:
421+ raise TestNotApplicable('Branch format does not support tags.')
422+ # Now source has a tag pointing to an absent revision. Sprout its
423+ # controldir.
424+ dir = source.bzrdir
425+ target = dir.sprout(self.get_url('target'))
426+ # The tag is present in the target
427+ new_branch = target.open_branch()
428+ self.assertEqual('missing-rev', new_branch.tags.lookup_tag('tag-a'))
429+
430+ def test_sprout_bzrdir_passing_source_branch_with_absent_tag(self):
431+ # tags referencing absent revisions are copied (and those absent
432+ # revisions do not prevent the sprout.)
433+ builder = self.make_branch_builder('source')
434+ builder.build_commit(message="Rev 1", rev_id='rev-1')
435+ source = builder.get_branch()
436+ try:
437+ source.tags.set_tag('tag-a', 'missing-rev')
438+ except errors.TagsNotSupported:
439+ raise TestNotApplicable('Branch format does not support tags.')
440+ # Now source has a tag pointing to an absent revision. Sprout its
441+ # controldir.
442+ dir = source.bzrdir
443+ target = dir.sprout(self.get_url('target'), source_branch=source)
444+ # The tag is present in the target
445+ new_branch = target.open_branch()
446+ self.assertEqual('missing-rev', new_branch.tags.lookup_tag('tag-a'))
447+
448+ def test_sprout_bzrdir_passing_rev_not_source_branch_copies_tags(self):
449+ # dir.sprout(..., revision_id='rev1') copies rev1, and all the tags of
450+ # the branch at that bzrdir, the ancestry of all of those, but no other
451+ # revs (not even the tip of the source branch).
452+ builder = self.make_branch_builder('source')
453+ builder.build_commit(message="Base", rev_id='base-rev')
454+ # Make three parallel lines of ancestry off this base.
455+ source = builder.get_branch()
456+ builder.build_commit(message="Rev A1", rev_id='rev-a1')
457+ builder.build_commit(message="Rev A2", rev_id='rev-a2')
458+ builder.build_commit(message="Rev A3", rev_id='rev-a3')
459+ source.set_last_revision_info(1, 'base-rev')
460+ builder.build_commit(message="Rev B1", rev_id='rev-b1')
461+ builder.build_commit(message="Rev B2", rev_id='rev-b2')
462+ builder.build_commit(message="Rev B3", rev_id='rev-b3')
463+ source.set_last_revision_info(1, 'base-rev')
464+ builder.build_commit(message="Rev C1", rev_id='rev-c1')
465+ builder.build_commit(message="Rev C2", rev_id='rev-c2')
466+ builder.build_commit(message="Rev C3", rev_id='rev-c3')
467+ # Set the branch tip to A2
468+ source.set_last_revision_info(3, 'rev-a2')
469+ try:
470+ # Create a tag for B2, and for an absent rev
471+ source.tags.set_tag('tag-non-ancestry', 'rev-b2')
472+ source.tags.set_tag('tag-absent', 'absent-rev')
473+ except errors.TagsNotSupported:
474+ raise TestNotApplicable('Branch format does not support tags.')
475+ # And ask sprout for C2
476+ dir = source.bzrdir
477+ target = dir.sprout(self.get_url('target'), revision_id='rev-c2')
478+ # The tags are present
479+ new_branch = target.open_branch()
480+ self.assertEqual(
481+ {'tag-absent': 'absent-rev', 'tag-non-ancestry': 'rev-b2'},
482+ new_branch.tags.get_tag_dict())
483+ # And the revs for A2, B2 and C2's ancestries are present, but no
484+ # others.
485+ self.assertEqual(
486+ ['base-rev', 'rev-b1', 'rev-b2', 'rev-c1', 'rev-c2'],
487+ sorted(new_branch.repository.all_revision_ids()))
488+
489+>>>>>>> MERGE-SOURCE
490 def test_sprout_bzrdir_tree_branch_reference(self):
491 # sprouting should create a repository if needed and a sprouted branch.
492 # the tree state should not be copied.
493
494=== modified file 'bzrlib/tests/per_repository_reference/test_graph.py'
495--- bzrlib/tests/per_repository_reference/test_graph.py 2011-02-08 08:01:40 +0000
496+++ bzrlib/tests/per_repository_reference/test_graph.py 2011-02-14 03:03:52 +0000
497@@ -1,3 +1,4 @@
498+<<<<<<< TREE
499 # Copyright (C) 2011 Canonical Ltd
500 #
501 # This program is free software; you can redistribute it and/or modify
502@@ -43,3 +44,50 @@
503 branch_c.set_stacked_on_url('../b')
504 revid_1 = wt_a.commit('first commit')
505 return branch_a, branch_b, branch_c, revid_1
506+=======
507+# Copyright (C) 2011 Canonical Ltd
508+#
509+# This program is free software; you can redistribute it and/or modify
510+# it under the terms of the GNU General Public License as published by
511+# the Free Software Foundation; either version 2 of the License, or
512+# (at your option) any later version.
513+#
514+# This program is distributed in the hope that it will be useful,
515+# but WITHOUT ANY WARRANTY; without even the implied warranty of
516+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
517+# GNU General Public License for more details.
518+#
519+# You should have received a copy of the GNU General Public License
520+# along with this program; if not, write to the Free Software
521+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
522+
523+
524+"""Tests for graph operations on stacked repositories."""
525+
526+
527+from bzrlib.tests.per_repository import TestCaseWithRepository
528+
529+
530+class TestGraph(TestCaseWithRepository):
531+
532+ def test_get_known_graph_ancestry_stacked(self):
533+ """get_known_graph_ancestry works correctly on stacking.
534+
535+ See <https://bugs.launchpad.net/bugs/715000>.
536+ """
537+ branch_a, branch_b, branch_c, revid_1 = self.make_double_stacked_branches()
538+ for br in [branch_a, branch_b, branch_c]:
539+ self.assertEquals(
540+ [revid_1],
541+ br.repository.get_known_graph_ancestry([revid_1]).topo_sort())
542+
543+ def make_double_stacked_branches(self):
544+ wt_a = self.make_branch_and_tree('a')
545+ branch_a = wt_a.branch
546+ branch_b = self.make_branch('b')
547+ branch_b.set_stacked_on_url('../a')
548+ branch_c = self.make_branch('c')
549+ branch_c.set_stacked_on_url('../b')
550+ revid_1 = wt_a.commit('first commit')
551+ return branch_a, branch_b, branch_c, revid_1
552+>>>>>>> MERGE-SOURCE
553
554=== modified file 'bzrlib/tests/test_bzrdir.py'
555=== modified file 'bzrlib/tests/test_http.py'
556=== modified file 'bzrlib/tests/test_remote.py'
557=== modified file 'bzrlib/tests/test_repository.py'
558=== modified file 'bzrlib/tests/test_server.py'
559=== modified file 'bzrlib/versionedfile.py'
560--- bzrlib/versionedfile.py 2011-02-09 06:35:00 +0000
561+++ bzrlib/versionedfile.py 2011-02-14 03:03:52 +0000
562@@ -1,7 +1,4 @@
563-# Copyright (C) 2006-2010 Canonical Ltd
564-#
565-# Authors:
566-# Johan Rydberg <jrydberg@gnu.org>
567+# Copyright (C) 2006-2011 Canonical Ltd
568 #
569 # This program is free software; you can redistribute it and/or modify
570 # it under the terms of the GNU General Public License as published by
571@@ -930,6 +927,10 @@
572
573 The use of tuples allows a single code base to support several different
574 uses with only the mapping logic changing from instance to instance.
575+
576+ :ivar _immediate_fallback_vfs: For subclasses that support stacking,
577+ this is a list of other VersionedFiles immediately underneath this
578+ one. They may in turn each have further fallbacks.
579 """
580
581 def add_lines(self, key, parents, lines, parent_texts=None,
582@@ -1193,6 +1194,7 @@
583 def _extract_blocks(self, version_id, source, target):
584 return None
585
586+<<<<<<< TREE
587 def _transitive_fallbacks(self):
588 """Return the whole stack of fallback versionedfiles.
589
590@@ -1206,6 +1208,21 @@
591 all_fallbacks.extend(a_vfs._transitive_fallbacks())
592 return all_fallbacks
593
594+=======
595+ def _transitive_fallbacks(self):
596+ """Return the whole stack of fallback versionedfiles.
597+
598+ This VersionedFiles may have a list of fallbacks, but it doesn't
599+ necessarily know about the whole stack going down, and it can't know
600+ at open time because they may change after the objects are opened.
601+ """
602+ all_fallbacks = []
603+ for a_vfs in self._immediate_fallback_vfs:
604+ all_fallbacks.append(a_vfs)
605+ all_fallbacks.extend(a_vfs._transitive_fallbacks())
606+ return all_fallbacks
607+
608+>>>>>>> MERGE-SOURCE
609
610 class ThunkedVersionedFiles(VersionedFiles):
611 """Storage for many versioned files thunked onto a 'VersionedFile' class.
612
613=== modified file 'bzrlib/workingtree.py'
614--- bzrlib/workingtree.py 2011-02-11 17:58:56 +0000
615+++ bzrlib/workingtree.py 2011-02-14 03:03:52 +0000
616@@ -2889,6 +2889,7 @@
617
618 upgrade_recommended = False
619
620+<<<<<<< TREE
621 requires_normalized_unicode_filenames = False
622
623 case_sensitive_filename = "FoRMaT"
624@@ -2896,6 +2897,12 @@
625 missing_parent_conflicts = False
626 """If this format supports missing parent conflicts."""
627
628+=======
629+ requires_normalized_unicode_filenames = False
630+
631+ case_sensitive_filename = "FoRMaT"
632+
633+>>>>>>> MERGE-SOURCE
634 @classmethod
635 def find_format(klass, a_bzrdir):
636 """Return the format for the working tree object in a_bzrdir."""
637@@ -2978,12 +2985,19 @@
638
639 upgrade_recommended = True
640
641+<<<<<<< TREE
642 requires_normalized_unicode_filenames = True
643
644 case_sensitive_filename = "Branch-FoRMaT"
645
646 missing_parent_conflicts = False
647
648+=======
649+ requires_normalized_unicode_filenames = True
650+
651+ case_sensitive_filename = "Branch-FoRMaT"
652+
653+>>>>>>> MERGE-SOURCE
654 def get_format_description(self):
655 """See WorkingTreeFormat.get_format_description()."""
656 return "Working tree format 2"
657
658=== modified file 'bzrlib/workingtree_4.py'
659=== modified file 'doc/en/release-notes/bzr-2.2.txt'
660--- doc/en/release-notes/bzr-2.2.txt 2011-02-09 08:24:25 +0000
661+++ doc/en/release-notes/bzr-2.2.txt 2011-02-14 03:03:52 +0000
662@@ -2,80 +2,156 @@
663 Bazaar Release Notes
664 ####################
665
666-.. contents:: List of Releases
667- :depth: 1
668-
669-bzr 2.2.5
670-#########
671-
672-:Codename: Suggestions welcome
673-:2.2.5: NOT RELEASED YET
674-
675-Compatibility Breaks
676-********************
677-
678-New Features
679-************
680-
681-Bug Fixes
682-*********
683-
684-* Correctly handle ``bzr log`` and `get_known_graph_ancestry` on a
685- doubly-stacked branch.
686- (James Westby, Martin Pool, #715000)
687-
688-Improvements
689-************
690-
691-Documentation
692-*************
693-
694-API Changes
695-***********
696-
697-Internals
698-*********
699-
700-Testing
701-*******
702-
703-
704-bzr 2.2.4
705-#########
706-
707-:2.2.4: 2011-02-04
708-
709-This is a bugfix release. Only one bug has been fixed, a regression from 2.2.3
710-involving only certain operations with launchpad. Upgrading is recommended for
711-all users on earlier 2.2 releases.
712-
713-Bug Fixes
714-*********
715-
716-* Fix communications with the Launchpad web service when using
717- launchpadlib >= 1.5.5. This was a latent bug in bzr's communication
718- with Launchpad's production instance, which only became a problem when
719- the default instance was switched from edge to production in bzr 2.2.3.
720- (Max Bowsher, #707075)
721-
722-
723-bzr 2.2.3
724-#########
725-
726-:2.2.3: 2011-01-20
727-
728-This is a bugfix release. Upgrading is recommended for all users
729-on earlier 2.2 releases.
730-
731-Compatibility Breaks
732-********************
733-
734-* Launchpad has announced that the ``edge.launchpad.net`` instance is
735- deprecated and may be shut down in the future
736- <http://blog.launchpad.net/general/edge-is-deprecated>. Bazaar has therefore
737- been updated in this release to talk to the main (``launchpad.net``) servers,
738- rather than the ``edge`` ones. (Vincent Ladeuil, #583667)
739-
740+<<<<<<< TREE
741+.. contents:: List of Releases
742+ :depth: 1
743+
744+bzr 2.2.5
745+#########
746+
747+:Codename: Suggestions welcome
748+:2.2.5: NOT RELEASED YET
749+
750+Compatibility Breaks
751+********************
752+
753+New Features
754+************
755+
756+Bug Fixes
757+*********
758+
759+* Correctly handle ``bzr log`` and `get_known_graph_ancestry` on a
760+ doubly-stacked branch.
761+ (James Westby, Martin Pool, #715000)
762+
763+Improvements
764+************
765+
766+Documentation
767+*************
768+
769+API Changes
770+***********
771+
772+Internals
773+*********
774+
775+Testing
776+*******
777+
778+
779+bzr 2.2.4
780+#########
781+
782+:2.2.4: 2011-02-04
783+
784+This is a bugfix release. Only one bug has been fixed, a regression from 2.2.3
785+involving only certain operations with launchpad. Upgrading is recommended for
786+all users on earlier 2.2 releases.
787+
788+Bug Fixes
789+*********
790+
791+* Fix communications with the Launchpad web service when using
792+ launchpadlib >= 1.5.5. This was a latent bug in bzr's communication
793+ with Launchpad's production instance, which only became a problem when
794+ the default instance was switched from edge to production in bzr 2.2.3.
795+ (Max Bowsher, #707075)
796+
797+
798+bzr 2.2.3
799+#########
800+
801+:2.2.3: 2011-01-20
802+
803+This is a bugfix release. Upgrading is recommended for all users
804+on earlier 2.2 releases.
805+
806+Compatibility Breaks
807+********************
808+
809+* Launchpad has announced that the ``edge.launchpad.net`` instance is
810+ deprecated and may be shut down in the future
811+ <http://blog.launchpad.net/general/edge-is-deprecated>. Bazaar has therefore
812+ been updated in this release to talk to the main (``launchpad.net``) servers,
813+ rather than the ``edge`` ones. (Vincent Ladeuil, #583667)
814+
815+=======
816+.. contents:: List of Releases
817+ :depth: 1
818+
819+bzr 2.2.5
820+#########
821+
822+:Codename: Suggestions welcome
823+:2.2.5: NOT RELEASED YET
824+
825+Compatibility Breaks
826+********************
827+
828+New Features
829+************
830+
831+Bug Fixes
832+*********
833+
834+* Correctly handle ``bzr log`` and `get_known_graph_ancestry` on a
835+ doubly-stacked branch.
836+ (James Westby, Martin Pool, #715000)
837+
838+Improvements
839+************
840+
841+Documentation
842+*************
843+
844+API Changes
845+***********
846+
847+Internals
848+*********
849+
850+Testing
851+*******
852+
853+
854+bzr 2.2.4
855+#########
856+
857+:2.2.4: 2011-02-04
858+
859+This is a bugfix release. Only one bug has been fixed, a regression from 2.2.3
860+involving only certain operations with launchpad. Upgrading is recommended for
861+all users on earlier 2.2 releases.
862+
863+Bug Fixes
864+*********
865+
866+* Fix communications with the Launchpad web service when using
867+ launchpadlib >= 1.5.5. This was a latent bug in bzr's communication
868+ with Launchpad's production instance, which only became a problem when
869+ the default instance was switched from edge to production in bzr 2.2.3.
870+ (Max Bowsher, #707075)
871+
872+
873+bzr 2.2.3
874+#########
875+
876+:2.2.3: 2011-01-20
877+
878+This is a bugfix release. Upgrading is recommended for all users
879+on earlier 2.2 releases.
880+
881+Compatibility Breaks
882+********************
883+
884+* Launchpad has announced that the ``edge.launchpad.net`` instance is
885+ deprecated and may be shut down in the future
886+ <http://blog.launchpad.net/general/edge-is-deprecated>. Bazaar has therefore
887+ been updated in this release to talk to the main (``launchpad.net``) servers,
888+ rather than the ``edge`` ones. (Vincent Ladeuil, #583667)
889+>>>>>>> MERGE-SOURCE
890 bzr 2.2.4
891 #########
892
893
894=== modified file 'doc/en/release-notes/bzr-2.4.txt'
895--- doc/en/release-notes/bzr-2.4.txt 2011-02-11 17:12:35 +0000
896+++ doc/en/release-notes/bzr-2.4.txt 2011-02-14 03:03:52 +0000
897@@ -1,3 +1,4 @@
898+<<<<<<< TREE
899 ####################
900 Bazaar Release Notes
901 ####################
902@@ -147,3 +148,131 @@
903
904 ..
905 vim: tw=74 ft=rst ff=unix
906+=======
907+####################
908+Bazaar Release Notes
909+####################
910+
911+.. toctree::
912+ :maxdepth: 1
913+
914+bzr 2.4b1
915+#########
916+
917+:2.4b1: NOT RELEASED YET
918+
919+External Compatibility Breaks
920+*****************************
921+
922+.. These may require users to change the way they use Bazaar.
923+
924+New Features
925+************
926+
927+.. New commands, options, etc that users may wish to try out.
928+
929+* The ``lp:`` directory service now supports Launchpad's QA staging.
930+ (Jelmer Vernooij, #667483)
931+
932+* External merge tools can now be configured in bazaar.conf. See
933+ ``bzr help configuration`` for more information. (Gordon Tyler, #489915)
934+
935+Improvements
936+************
937+
938+.. Improvements to existing commands, especially improved performance
939+ or memory usage, or better results.
940+
941+* A new hidden command ``bzr repair-workingtree``. This is a way to force
942+ the dirstate file to be rebuilt, rather than using a ``bzr checkout``
943+ workaround. (John Arbash Meinel)
944+
945+* Branching, merging and pulling a branch now copies revisions named in
946+ tags, not just the tag metadata. (Andrew Bennetts, #309682)
947+
948+* ``bzr cat-revision`` no longer requires a working tree. (Jelmer Vernooij, #704405)
949+
950+Bug Fixes
951+*********
952+
953+.. Fixes for situations where bzr would previously crash or give incorrect
954+ or undesirable results.
955+
956+* ``bzr push --overwrite`` with an older revision specified will now correctly
957+ roll back the target branch. (Jelmer Vernooij, #386576)
958+
959+* ``bzr lp-propose`` can now propose merges against packaging branches on
960+ Launchpad without requiring the target branch to be specified.
961+ (Jelmer Vernooij, #704647)
962+
963+* ``bzr lp-propose`` no longer requires a reviewer to be specified. It will
964+ instead leave setting the reviewer up to Launchpad if it was not specified.
965+ (Jelmer Vernooij, #583772)
966+
967+* ``bzr pull`` will now exit with exit code 1 if there were tag conflicts.
968+ (Jelmer Vernooij, #213185)
969+
970+* ``bzr mv`` user errors no longer throw UnicodeEncodeError with non-ascii
971+ paths, however they may still print junk if not on a UTF-8 terminal.
972+ (Martin [gz], #707954)
973+
974+* ``bzr serve`` no longer crashes when a server_started hook is installed and
975+ IPv6 support is available on the system. (Jelmer Vernooij, #293697)
976+
977+* ``bzr whoami`` will now display an error if both a new identity and
978+ ``--email`` were specified. (Jelmer Vernooij, #680449)
979+
980+* ``launchpadlib`` doesn't provide the ``uris`` module in some old versions.
981+ (Vincent Ladeuil, #706835)
982+
983+* Empty entries in the ``NO_PROXY`` variable are no longer treated as matching
984+ every host.
985+ (Martin Pool, #586341)
986+
987+* Plugins incompatible with the current version of bzr no longer produce a
988+ warning on every command invocation. Instead, a message is shown by
989+ ``bzr plugins`` and in crash reports.
990+ (#704195, Martin Pool)
991+
992+Documentation
993+*************
994+
995+.. Improved or updated documentation.
996+
997+API Changes
998+***********
999+
1000+.. Changes that may require updates in plugins or other code that uses
1001+ bzrlib.
1002+
1003+* Added ``bzrlib.mergetools`` module with helper functions for working with
1004+ the list of external merge tools. (Gordon Tyler, #489915)
1005+
1006+* ``Branch.fetch`` implementations must now accept an optional
1007+ ``fetch_spec`` keyword argument. (Andrew Bennetts)
1008+
1009+* ``Branch.import_last_revision_info`` is deprecated. Use the
1010+ ``import_last_revision_info_and_tags`` method instead.
1011+ (Andrew Bennetts)
1012+
1013+* The ``revision_id`` parameter of
1014+ ``Repository.search_missing_revision_ids`` and
1015+ ``InterRepository.search_missing_revision_ids`` is deprecated. It is
1016+ replaced by the ``revision_ids`` parameter. (Andrew Bennetts)
1017+
1018+Internals
1019+*********
1020+
1021+.. Major internal changes, unlikely to be visible to users or plugin
1022+ developers, but interesting for bzr developers.
1023+
1024+Testing
1025+*******
1026+
1027+.. Fixes and changes that are only relevant to bzr's test framework and
1028+ suite. This can include new facilities for writing tests, fixes to
1029+ spurious test failures and changes to the way things should be tested.
1030+
1031+..
1032+ vim: tw=74 ft=rst ff=unix
1033+>>>>>>> MERGE-SOURCE