Rev 6033: Fix the 11 tests that still failed. in http://bazaar.launchpad.net/~jameinel/bzr/2.4-tag-fetch-flag-771184

John Arbash Meinel john at arbash-meinel.com
Wed Aug 10 14:02:14 UTC 2011


At http://bazaar.launchpad.net/~jameinel/bzr/2.4-tag-fetch-flag-771184

------------------------------------------------------------
revno: 6033
revision-id: john at arbash-meinel.com-20110810140204-3ppg9vbeikxq5lmd
parent: john at arbash-meinel.com-20110810073828-vcxd4knnmeec0lc1
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.4-tag-fetch-flag-771184
timestamp: Wed 2011-08-10 16:02:04 +0200
message:
  Fix the 11 tests that still failed.
-------------- next part --------------
=== modified file 'bzrlib/tests/blackbox/test_pull.py'
--- a/bzrlib/tests/blackbox/test_pull.py	2011-02-11 05:57:31 +0000
+++ b/bzrlib/tests/blackbox/test_pull.py	2011-08-10 14:02:04 +0000
@@ -152,6 +152,7 @@
         # Make a source, sprout a target off it
         builder = self.make_branch_builder('source')
         source = fixtures.build_branch_with_non_ancestral_rev(builder)
+        source.get_config().set_user_option('branch.fetch_tags', 'True')
         target_bzrdir = source.bzrdir.sprout('target')
         source.tags.set_tag('tag-a', 'rev-2')
         # Pull from source
@@ -410,7 +411,7 @@
         # being too low. If rpc_count increases, more network roundtrips have
         # become necessary for this use case. Please do not adjust this number
         # upwards without agreement from bzr's network support maintainers.
-        self.assertLength(18, self.hpss_calls)
+        self.assertLength(19, self.hpss_calls)
         remote = Branch.open('stacked')
         self.assertEndsWith(remote.get_stacked_on_url(), '/parent')
     

=== modified file 'bzrlib/tests/per_controldir/test_controldir.py'
--- a/bzrlib/tests/per_controldir/test_controldir.py	2011-05-13 12:51:05 +0000
+++ b/bzrlib/tests/per_controldir/test_controldir.py	2011-08-10 14:02:04 +0000
@@ -690,6 +690,7 @@
             source.tags.set_tag('tag-a', 'rev-2')
         except errors.TagsNotSupported:
             raise TestNotApplicable('Branch format does not support tags.')
+        source.get_config().set_user_option('branch.fetch_tags', 'True')
         # Now source has a tag not in its ancestry.  Sprout its controldir.
         dir = source.bzrdir
         target = dir.sprout(self.get_url('target'))
@@ -761,6 +762,7 @@
             source.tags.set_tag('tag-absent', 'absent-rev')
         except errors.TagsNotSupported:
             raise TestNotApplicable('Branch format does not support tags.')
+        source.get_config().set_user_option('branch.fetch_tags', 'True')
         # And ask sprout for C2
         dir = source.bzrdir
         target = dir.sprout(self.get_url('target'), revision_id='rev-c2')

=== modified file 'bzrlib/tests/test_bzrdir.py'
--- a/bzrlib/tests/test_bzrdir.py	2011-05-13 12:51:05 +0000
+++ b/bzrlib/tests/test_bzrdir.py	2011-08-10 14:02:04 +0000
@@ -26,6 +26,7 @@
 from bzrlib import (
     branch,
     bzrdir,
+    config,
     controldir,
     errors,
     help_topics,
@@ -1208,7 +1209,7 @@
 
     def __init__(self, *args, **kwargs):
         super(_TestBzrDir, self).__init__(*args, **kwargs)
-        self.test_branch = _TestBranch()
+        self.test_branch = _TestBranch(self.transport)
         self.test_branch.repository = self.create_repository()
 
     def open_branch(self, unsupported=False):
@@ -1225,15 +1226,17 @@
 class _TestBranch(bzrlib.branch.Branch):
     """Test Branch implementation for TestBzrDirSprout."""
 
-    def __init__(self, *args, **kwargs):
+    def __init__(self, transport, *args, **kwargs):
         self._format = _TestBranchFormat()
+        self._transport = transport
+        self.base = transport.base
         super(_TestBranch, self).__init__(*args, **kwargs)
         self.calls = []
         self._parent = None
 
     def sprout(self, *args, **kwargs):
         self.calls.append('sprout')
-        return _TestBranch()
+        return _TestBranch(self._transport)
 
     def copy_content_into(self, destination, revision_id=None):
         self.calls.append('copy_content_into')
@@ -1244,6 +1247,9 @@
     def get_parent(self):
         return self._parent
 
+    def _get_config(self):
+        return config.TransportConfig(self._transport, 'branch.conf')
+
     def set_parent(self, parent):
         self._parent = parent
 



More information about the bazaar-commits mailing list