Rev 3542: (mbp) post-merge review cleanups for stacking in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Wed Jul 16 08:54:29 BST 2008


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 3542
revision-id:pqm at pqm.ubuntu.com-20080716075418-xbachkqt622m73v1
parent: pqm at pqm.ubuntu.com-20080716013256-ws10ogzi9ya941vk
parent: mbp at sourcefrog.net-20080716073018-2oroz41151smfbym
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2008-07-16 08:54:18 +0100
message:
  (mbp) post-merge review cleanups for stacking
modified:
  bzrlib/branch.py               branch.py-20050309040759-e4baf4e0d046576e
  bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
  bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
  bzrlib/info.py                 info.py-20050323235939-6bbfe7d9700b0b9b
  bzrlib/push.py                 push.py-20080606021927-5fe39050e8xne9un-1
  bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
  bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
  bzrlib/tests/blackbox/test_branch.py test_branch.py-20060524161337-noms9gmcwqqrfi8y-1
  bzrlib/tests/blackbox/test_push.py test_push.py-20060329002750-929af230d5d22663
  bzrlib/tests/branch_implementations/test_stacking.py test_stacking.py-20080214020755-msjlkb7urobwly0f-1
  bzrlib/tests/test_branch.py    test_branch.py-20060116013032-97819aa07b8ab3b5
  bzrlib/tests/test_bzrdir.py    test_bzrdir.py-20060131065654-deba40eef51cf220
    ------------------------------------------------------------
    revno: 3537.3.5
    revision-id:mbp at sourcefrog.net-20080716073018-2oroz41151smfbym
    parent: mbp at sourcefrog.net-20080716032558-ppa2yvezv9gj98uu
    parent: pqm at pqm.ubuntu.com-20080716013256-ws10ogzi9ya941vk
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: stacking
    timestamp: Wed 2008-07-16 17:30:18 +1000
    message:
      merge trunk including stacking policy
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/branch.py               branch.py-20050309040759-e4baf4e0d046576e
      bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
      bzrlib/config.py               config.py-20051011043216-070c74f4e9e338e8
      bzrlib/errors.py               errors.py-20050309040759-20512168c4e14fbd
      bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
      bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
      bzrlib/tests/blackbox/test_push.py test_push.py-20060329002750-929af230d5d22663
      bzrlib/tests/branch_implementations/test_stacking.py test_stacking.py-20080214020755-msjlkb7urobwly0f-1
      bzrlib/tests/bzrdir_implementations/test_bzrdir.py test_bzrdir.py-20060131065642-0ebeca5e30e30866
      bzrlib/tests/repository_implementations/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
      bzrlib/tests/test_branch.py    test_branch.py-20060116013032-97819aa07b8ab3b5
      bzrlib/tests/test_bzrdir.py    test_bzrdir.py-20060131065654-deba40eef51cf220
      bzrlib/tests/test_config.py    testconfig.py-20051011041908-742d0c15d8d8c8eb
      bzrlib/tests/test_http_response.py test_http_response.py-20060628233143-950b2a482a32505d
      bzrlib/tests/test_urlutils.py  test_urlutils.py-20060502192900-46b1f9579987cf9c
      bzrlib/transport/http/response.py _response.py-20060613154423-a2ci7hd4iw5c7fnt-1
      bzrlib/urlutils.py             urlutils.py-20060502195429-e8a161ecf8fac004
      doc/developers/HACKING.txt     HACKING-20050805200004-2a5dc975d870f78c
      doc/en/user-guide/browsing_history.txt browsing_history.txt-20071121073725-0corxykv5irjal00-2
    ------------------------------------------------------------
    revno: 3537.3.4
    revision-id:mbp at sourcefrog.net-20080716032558-ppa2yvezv9gj98uu
    parent: mbp at sourcefrog.net-20080715051831-t18m22ffrmbn9lj2
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: stacking
    timestamp: Wed 2008-07-16 13:25:58 +1000
    message:
      Improved branch stacking tests
    modified:
      bzrlib/tests/branch_implementations/test_stacking.py test_stacking.py-20080214020755-msjlkb7urobwly0f-1
    ------------------------------------------------------------
    revno: 3537.3.3
    revision-id:mbp at sourcefrog.net-20080715051831-t18m22ffrmbn9lj2
    parent: mbp at sourcefrog.net-20080715051117-l8xf1iw1nxgqx815
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: stacking
    timestamp: Tue 2008-07-15 15:18:31 +1000
    message:
      Rename Branch.set_stacked_on to set_stacked_on_url
    modified:
      bzrlib/branch.py               branch.py-20050309040759-e4baf4e0d046576e
      bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
      bzrlib/push.py                 push.py-20080606021927-5fe39050e8xne9un-1
      bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
      bzrlib/tests/blackbox/test_branch.py test_branch.py-20060524161337-noms9gmcwqqrfi8y-1
      bzrlib/tests/branch_implementations/test_stacking.py test_stacking.py-20080214020755-msjlkb7urobwly0f-1
      bzrlib/tests/test_branch.py    test_branch.py-20060116013032-97819aa07b8ab3b5
    ------------------------------------------------------------
    revno: 3537.3.2
    revision-id:mbp at sourcefrog.net-20080715051117-l8xf1iw1nxgqx815
    parent: mbp at sourcefrog.net-20080715044319-wy26hdr8kvrb0ne9
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: stacking
    timestamp: Tue 2008-07-15 15:11:17 +1000
    message:
      Use repository's get_parent_map directly rather than through get_graph (jam)
    modified:
      bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
    ------------------------------------------------------------
    revno: 3537.3.1
    revision-id:mbp at sourcefrog.net-20080715044319-wy26hdr8kvrb0ne9
    parent: pqm at pqm.ubuntu.com-20080714082119-ju6qe5weo8pp7f1c
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: stacking
    timestamp: Tue 2008-07-15 14:43:19 +1000
    message:
      Rename branch.get_stacked_on to get_stacked_on_url
    modified:
      bzrlib/branch.py               branch.py-20050309040759-e4baf4e0d046576e
      bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
      bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
      bzrlib/info.py                 info.py-20050323235939-6bbfe7d9700b0b9b
      bzrlib/push.py                 push.py-20080606021927-5fe39050e8xne9un-1
      bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
      bzrlib/tests/blackbox/test_branch.py test_branch.py-20060524161337-noms9gmcwqqrfi8y-1
      bzrlib/tests/blackbox/test_push.py test_push.py-20060329002750-929af230d5d22663
      bzrlib/tests/branch_implementations/test_stacking.py test_stacking.py-20080214020755-msjlkb7urobwly0f-1
      bzrlib/tests/test_branch.py    test_branch.py-20060116013032-97819aa07b8ab3b5
=== modified file 'bzrlib/branch.py'
--- a/bzrlib/branch.py	2008-07-14 16:16:48 +0000
+++ b/bzrlib/branch.py	2008-07-16 07:30:18 +0000
@@ -331,14 +331,14 @@
             raise errors.InvalidRevisionNumber(revno)
         return self.repository.get_revision_delta(rh[revno-1])
 
-    def get_stacked_on(self):
+    def get_stacked_on_url(self):
         """Get the URL this branch is stacked against.
 
         :raises NotStacked: If the branch is not stacked.
         :raises UnstackableBranchFormat: If the branch does not support
             stacking.
         """
-        raise NotImplementedError(self.get_stacked_on)
+        raise NotImplementedError(self.get_stacked_on_url)
 
     def print_file(self, file, revision_id):
         """Print `file` to stdout."""
@@ -347,7 +347,7 @@
     def set_revision_history(self, rev_history):
         raise NotImplementedError(self.set_revision_history)
 
-    def set_stacked_on(self, url):
+    def set_stacked_on_url(self, url):
         """Set the URL this branch is stacked against.
 
         :raises UnstackableBranchFormat: If the branch does not support
@@ -355,7 +355,7 @@
         :raises UnstackableRepositoryFormat: If the repository does not support
             stacking.
         """
-        raise NotImplementedError(self.set_stacked_on)
+        raise NotImplementedError(self.set_stacked_on_url)
 
     def _cache_revision_history(self, rev_history):
         """Set the cached revision history to rev_history.
@@ -1837,7 +1837,7 @@
         except errors.InvalidURLJoin, e:
             raise errors.InaccessibleParent(parent, self.base)
 
-    def get_stacked_on(self):
+    def get_stacked_on_url(self):
         raise errors.UnstackableBranchFormat(self._format, self.base)
 
     def set_push_location(self, location):
@@ -1871,7 +1871,7 @@
             self._transport.put_bytes('parent', url + '\n',
                 mode=self.bzrdir._get_file_mode())
 
-    def set_stacked_on(self, url):
+    def set_stacked_on_url(self, url):
         raise errors.UnstackableBranchFormat(self._format, self.base)
 
 
@@ -2017,7 +2017,7 @@
 
     def _open_hook(self):
         try:
-            url = self.get_stacked_on()
+            url = self.get_stacked_on_url()
         except (errors.UnstackableRepositoryFormat, errors.NotStacked,
             errors.UnstackableBranchFormat):
             pass
@@ -2179,7 +2179,7 @@
         """See Branch.get_old_bound_location"""
         return self._get_bound_location(False)
 
-    def get_stacked_on(self):
+    def get_stacked_on_url(self):
         self._check_stackable_repo()
         stacked_url = self._get_config_location('stacked_on_location')
         if stacked_url is None:
@@ -2194,11 +2194,11 @@
         self.get_config().set_user_option('append_revisions_only', value,
             warn_masked=True)
 
-    def set_stacked_on(self, url):
+    def set_stacked_on_url(self, url):
         self._check_stackable_repo()
         if not url:
             try:
-                old_url = self.get_stacked_on()
+                old_url = self.get_stacked_on_url()
             except (errors.NotStacked, errors.UnstackableBranchFormat,
                 errors.UnstackableRepositoryFormat):
                 return
@@ -2307,10 +2307,10 @@
     i.e. stacking.
     """
 
-    def get_stacked_on(self):
+    def get_stacked_on_url(self):
         raise errors.UnstackableBranchFormat(self._format, self.base)
 
-    def set_stacked_on(self, url):
+    def set_stacked_on_url(self, url):
         raise errors.UnstackableBranchFormat(self._format, self.base)
 
 

=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2008-07-14 07:47:45 +0000
+++ b/bzrlib/builtins.py	2008-07-15 04:43:19 +0000
@@ -862,7 +862,7 @@
             # We therefore need a try/except here and not just 'if stacked:'
             try:
                 note('Created new stacked branch referring to %s.' %
-                    branch.get_stacked_on())
+                    branch.get_stacked_on_url())
             except (errors.NotStacked, errors.UnstackableBranchFormat,
                 errors.UnstackableRepositoryFormat), e:
                 note('Branched %d revision(s).' % branch.revno())

=== modified file 'bzrlib/bzrdir.py'
--- a/bzrlib/bzrdir.py	2008-07-14 21:09:51 +0000
+++ b/bzrlib/bzrdir.py	2008-07-16 07:30:18 +0000
@@ -208,7 +208,7 @@
                 local_repo = local_branch.repository
             if preserve_stacking:
                 try:
-                    stack_on = local_branch.get_stacked_on()
+                    stack_on = local_branch.get_stacked_on_url()
                 except (errors.UnstackableBranchFormat,
                         errors.UnstackableRepositoryFormat,
                         errors.NotStacked):
@@ -1060,7 +1060,7 @@
                 stacked_branch_url = self.root_transport.base
             else:
                 try:
-                    stacked_branch_url = source_branch.get_stacked_on()
+                    stacked_branch_url = source_branch.get_stacked_on_url()
                 except (errors.NotStacked, errors.UnstackableBranchFormat,
                     errors.UnstackableRepositoryFormat):
                     stacked_branch_url = None
@@ -2797,7 +2797,7 @@
             except errors.InvalidRebaseURLs:
                 stack_on = self._get_full_stack_on()
         try:
-            branch.set_stacked_on(stack_on)
+            branch.set_stacked_on_url(stack_on)
         except errors.UnstackableBranchFormat:
             if self._require_stacking:
                 raise

=== modified file 'bzrlib/info.py'
--- a/bzrlib/info.py	2008-06-03 05:19:26 +0000
+++ b/bzrlib/info.py	2008-07-15 04:43:19 +0000
@@ -142,7 +142,7 @@
     locs.add_url('parent branch', branch.get_parent())
     locs.add_url('submit branch', branch.get_submit_branch())
     try:
-        locs.add_url('stacked on', branch.get_stacked_on())
+        locs.add_url('stacked on', branch.get_stacked_on_url())
     except (errors.UnstackableBranchFormat, errors.UnstackableRepositoryFormat,
         errors.NotStacked):
         pass

=== modified file 'bzrlib/push.py'
--- a/bzrlib/push.py	2008-06-10 05:02:30 +0000
+++ b/bzrlib/push.py	2008-07-15 05:18:31 +0000
@@ -107,14 +107,14 @@
                 # if the from format is stackable, this will either work or
                 # trigger NotStacked. If it's not, an error will be given to
                 # the user.
-                br_from.get_stacked_on()
+                br_from.get_stacked_on_url()
             except errors.NotStacked:
                 pass
             # now we need to sprout the repository,
             dir_to = br_from.bzrdir._format.initialize_on_transport(to_transport)
             br_from.repository._format.initialize(dir_to)
             br_to = br_from._format.initialize(dir_to)
-            br_to.set_stacked_on(reference)
+            br_to.set_stacked_on_url(reference)
             # and copy the data up.
             br_from.push(br_to)
         else:

=== modified file 'bzrlib/remote.py'
--- a/bzrlib/remote.py	2008-07-14 16:16:48 +0000
+++ b/bzrlib/remote.py	2008-07-16 07:30:18 +0000
@@ -1324,7 +1324,7 @@
         self._ensure_real()
         return self._real_branch.get_physical_lock_status()
 
-    def get_stacked_on(self):
+    def get_stacked_on_url(self):
         """Get the URL this branch is stacked against.
 
         :raises NotStacked: If the branch is not stacked.
@@ -1334,7 +1334,7 @@
             stacking.
         """
         self._ensure_real()
-        return self._real_branch.get_stacked_on()
+        return self._real_branch.get_stacked_on_url()
 
     def lock_read(self):
         if not self._lock_mode:
@@ -1542,7 +1542,7 @@
         self._ensure_real()
         return self._real_branch.set_parent(url)
         
-    def set_stacked_on(self, stacked_location):
+    def set_stacked_on_url(self, stacked_location):
         """Set the URL this branch is stacked against.
 
         :raises UnstackableBranchFormat: If the branch does not support
@@ -1551,7 +1551,7 @@
             stacking.
         """
         self._ensure_real()
-        return self._real_branch.set_stacked_on(stacked_location)
+        return self._real_branch.set_stacked_on_url(stacked_location)
 
     def sprout(self, to_bzrdir, revision_id=None):
         # Like Branch.sprout, except that it sprouts a branch in the default

=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2008-07-14 16:16:48 +0000
+++ b/bzrlib/repository.py	2008-07-16 07:30:18 +0000
@@ -2786,7 +2786,7 @@
             # Double query here: should be able to avoid this by changing the
             # graph api further.
             result_set = found_ids - frozenset(
-                self.target.get_graph().get_parent_map(found_ids))
+                self.target.get_parent_map(found_ids))
         else:
             source_ids = self.source.all_revision_ids()
             # source_ids is the worst possible case we may need to pull.

=== modified file 'bzrlib/tests/blackbox/test_branch.py'
--- a/bzrlib/tests/blackbox/test_branch.py	2008-07-11 05:59:06 +0000
+++ b/bzrlib/tests/blackbox/test_branch.py	2008-07-15 05:18:31 +0000
@@ -107,7 +107,7 @@
         """
         new_branch = branch.Branch.open('newbranch')
         # The branch refers to the mainline
-        self.assertEqual(stacked_on, new_branch.get_stacked_on())
+        self.assertEqual(stacked_on, new_branch.get_stacked_on_url())
         # and the branch's work was pushed
         self.assertTrue(new_branch.repository.has_revision(branch_revid))
         # The newly committed revision shoud be present in the stacked branch,
@@ -138,7 +138,7 @@
         # and a branch from it which is stacked
         branch_tree = self.make_branch_and_tree('branch',
             format='development')
-        branch_tree.branch.set_stacked_on(trunk_tree.branch.base)
+        branch_tree.branch.set_stacked_on_url(trunk_tree.branch.base)
         # with some work on it
         branch_tree.commit('moar work plz')
         # branching our local branch gives us a new stacked branch pointing at

=== modified file 'bzrlib/tests/blackbox/test_push.py'
--- a/bzrlib/tests/blackbox/test_push.py	2008-06-19 17:06:04 +0000
+++ b/bzrlib/tests/blackbox/test_push.py	2008-07-16 07:30:18 +0000
@@ -285,7 +285,7 @@
         """Assert that the branch 'published' has been published correctly."""
         published_branch = Branch.open('published')
         # The published branch refers to the mainline
-        self.assertEqual(stacked_on, published_branch.get_stacked_on())
+        self.assertEqual(stacked_on, published_branch.get_stacked_on_url())
         # and the branch's work was pushed
         self.assertTrue(published_branch.repository.has_revision(branch_revid))
 

=== modified file 'bzrlib/tests/branch_implementations/test_stacking.py'
--- a/bzrlib/tests/branch_implementations/test_stacking.py	2008-07-14 21:09:51 +0000
+++ b/bzrlib/tests/branch_implementations/test_stacking.py	2008-07-16 07:30:18 +0000
@@ -14,7 +14,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-"""Tests for Branch.get_stacked_on and set_stacked_on."""
+"""Tests for Branch.get_stacked_on_url and set_stacked_on_url."""
 
 from bzrlib import (
     bzrdir,
@@ -27,7 +27,7 @@
 
 class TestStacking(TestCaseWithBranch):
 
-    def test_get_set_stacked_on(self):
+    def test_get_set_stacked_on_url(self):
         # branches must either:
         # raise UnstackableBranchFormat or
         # raise UnstackableRepositoryFormat or
@@ -39,15 +39,15 @@
             errors.UnstackableRepositoryFormat,
             )
         try:
-            branch.set_stacked_on(target.base)
+            branch.set_stacked_on_url(target.base)
         except old_format_errors:
             # if the set failed, so must the get
-            self.assertRaises(old_format_errors, branch.get_stacked_on)
+            self.assertRaises(old_format_errors, branch.get_stacked_on_url)
             return
         # now we have a stacked branch:
-        self.assertEqual(target.base, branch.get_stacked_on())
-        branch.set_stacked_on(None)
-        self.assertRaises(errors.NotStacked, branch.get_stacked_on)
+        self.assertEqual(target.base, branch.get_stacked_on_url())
+        branch.set_stacked_on_url(None)
+        self.assertRaises(errors.NotStacked, branch.get_stacked_on_url)
 
     def test_get_set_stacked_on_relative(self):
         # Branches can be stacked on other branches using relative paths.
@@ -58,12 +58,12 @@
             errors.UnstackableRepositoryFormat,
             )
         try:
-            branch.set_stacked_on('../target')
+            branch.set_stacked_on_url('../target')
         except old_format_errors:
             # if the set failed, so must the get
-            self.assertRaises(old_format_errors, branch.get_stacked_on)
+            self.assertRaises(old_format_errors, branch.get_stacked_on_url)
             return
-        self.assertEqual('../target', branch.get_stacked_on())
+        self.assertEqual('../target', branch.get_stacked_on_url())
 
     def assertRevisionInRepository(self, repo_path, revid):
         """Check that a revision is in a repository, disregarding stacking."""
@@ -84,7 +84,7 @@
         # it would cause a false pass of this test.
         new_branch = self.make_branch('new_branch')
         try:
-            new_branch.set_stacked_on(trunk_tree.branch.base)
+            new_branch.set_stacked_on_url(trunk_tree.branch.base)
         except (errors.UnstackableBranchFormat,
             errors.UnstackableRepositoryFormat), e:
             raise TestNotApplicable(e)
@@ -111,7 +111,33 @@
         # stacked repository
         self.assertRevisionNotInRepository('newbranch', trunk_revid)
         new_tree = new_dir.open_workingtree()
-        new_tree.commit('something local')
+        new_branch_revid = new_tree.commit('something local')
+        self.assertRevisionNotInRepository('mainline', new_branch_revid)
+        self.assertRevisionInRepository('newbranch', new_branch_revid)
+
+    def test_unstack_fetches(self):
+        """Removing the stacked-on branch pulls across all data"""
+        # We have a mainline
+        trunk_tree = self.make_branch_and_tree('mainline')
+        trunk_revid = trunk_tree.commit('revision on mainline')
+        # and make branch from it which is stacked
+        try:
+            new_dir = trunk_tree.bzrdir.sprout('newbranch', stacked=True)
+        except (errors.UnstackableBranchFormat,
+            errors.UnstackableRepositoryFormat), e:
+            raise TestNotApplicable(e)
+        # stacked repository
+        self.assertRevisionNotInRepository('newbranch', trunk_revid)
+        # now when we unstack that should implicitly fetch, to make sure that
+        # the branch will still work
+        new_branch = new_dir.open_branch()
+        new_branch.set_stacked_on_url(None)
+        self.assertRevisionInRepository('newbranch', trunk_revid)
+        # of course it's still in the mainline
+        self.assertRevisionInRepository('mainline', trunk_revid)
+        # and now we're no longer stacked
+        self.assertRaises(errors.NotStacked,
+            new_branch.get_stacked_on_url)
 
     def prepare_for_clone(self):
         tree = self.make_branch_and_tree('stacked-on')
@@ -133,8 +159,8 @@
         cloned_bzrdir = stacked_bzrdir.clone('cloned', preserve_stacking=True)
         try:
             self.assertEqual(
-                stacked_bzrdir.open_branch().get_stacked_on(),
-                cloned_bzrdir.open_branch().get_stacked_on())
+                stacked_bzrdir.open_branch().get_stacked_on_url(),
+                cloned_bzrdir.open_branch().get_stacked_on_url())
         except (errors.UnstackableBranchFormat,
                 errors.UnstackableRepositoryFormat):
             pass
@@ -157,14 +183,14 @@
             self.fail('Expected a failure due to broken fetching.')
         unstacked_branch = cloned_unstacked_bzrdir.open_branch()
         self.assertRaises((errors.NotStacked, errors.UnstackableBranchFormat),
-                          unstacked_branch.get_stacked_on)
+                          unstacked_branch.get_stacked_on_url)
 
     def test_no_op_preserve_stacking(self):
         """With no stacking, preserve_stacking should be a no-op."""
         branch = self.make_branch('source')
         cloned_bzrdir = branch.bzrdir.clone('cloned', preserve_stacking=True)
         self.assertRaises((errors.NotStacked, errors.UnstackableBranchFormat),
-                          cloned_bzrdir.open_branch().get_stacked_on)
+                          cloned_bzrdir.open_branch().get_stacked_on_url)
 
     def test_sprout_stacking_policy_handling(self):
         """Obey policy where possible, ignore otherwise."""
@@ -174,7 +200,7 @@
         source = self.make_branch('source')
         target = source.bzrdir.sprout('target').open_branch()
         try:
-            self.assertEqual('../stack-on', target.get_stacked_on())
+            self.assertEqual('../stack-on', target.get_stacked_on_url())
         except errors.UnstackableBranchFormat:
             pass
 
@@ -186,6 +212,6 @@
         source = self.make_branch('source')
         target = source.bzrdir.clone('target').open_branch()
         try:
-            self.assertEqual('../stack-on', target.get_stacked_on())
+            self.assertEqual('../stack-on', target.get_stacked_on_url())
         except errors.UnstackableBranchFormat:
             pass

=== modified file 'bzrlib/tests/test_branch.py'
--- a/bzrlib/tests/test_branch.py	2008-06-16 19:09:28 +0000
+++ b/bzrlib/tests/test_branch.py	2008-07-16 07:30:18 +0000
@@ -318,14 +318,14 @@
     def get_format_name_subtree(self):
         return "dirstate-with-subtree"
 
-    def test_set_stacked_on_errors(self):
+    def test_set_stacked_on_url_errors(self):
         branch = self.make_branch('a', format=self.get_format_name())
         self.assertRaises(errors.UnstackableBranchFormat,
-            branch.set_stacked_on, None)
+            branch.set_stacked_on_url, None)
 
     def test_default_stacked_location(self):
         branch = self.make_branch('a', format=self.get_format_name())
-        self.assertRaises(errors.UnstackableBranchFormat, branch.get_stacked_on)
+        self.assertRaises(errors.UnstackableBranchFormat, branch.get_stacked_on_url)
 
 
 class TestBranch7(TestBranch67, TestCaseWithTransport):
@@ -339,13 +339,13 @@
     def get_format_name_subtree(self):
         return "development-subtree"
 
-    def test_set_stacked_on_unstackable_repo(self):
+    def test_set_stacked_on_url_unstackable_repo(self):
         repo = self.make_repository('a', format='dirstate-tags')
         control = repo.bzrdir
         branch = _mod_branch.BzrBranchFormat7().initialize(control)
         target = self.make_branch('b')
         self.assertRaises(errors.UnstackableRepositoryFormat,
-            branch.set_stacked_on, target.base)
+            branch.set_stacked_on_url, target.base)
 
     def test_clone_stacked_on_unstackable_repo(self):
         repo = self.make_repository('a', format='dirstate-tags')
@@ -356,23 +356,23 @@
 
     def _test_default_stacked_location(self):
         branch = self.make_branch('a', format=self.get_format_name())
-        self.assertRaises(errors.NotStacked, branch.get_stacked_on)
+        self.assertRaises(errors.NotStacked, branch.get_stacked_on_url)
 
     def test_stack_and_unstack(self):
         branch = self.make_branch('a', format=self.get_format_name())
         target = self.make_branch_and_tree('b', format=self.get_format_name())
-        branch.set_stacked_on(target.branch.base)
-        self.assertEqual(target.branch.base, branch.get_stacked_on())
+        branch.set_stacked_on_url(target.branch.base)
+        self.assertEqual(target.branch.base, branch.get_stacked_on_url())
         revid = target.commit('foo')
         self.assertTrue(branch.repository.has_revision(revid))
-        branch.set_stacked_on(None)
-        self.assertRaises(errors.NotStacked, branch.get_stacked_on)
+        branch.set_stacked_on_url(None)
+        self.assertRaises(errors.NotStacked, branch.get_stacked_on_url)
         self.assertFalse(branch.repository.has_revision(revid))
 
     def test_open_opens_stacked_reference(self):
         branch = self.make_branch('a', format=self.get_format_name())
         target = self.make_branch_and_tree('b', format=self.get_format_name())
-        branch.set_stacked_on(target.branch.base)
+        branch.set_stacked_on_url(target.branch.base)
         branch = branch.bzrdir.open_branch()
         revid = target.commit('foo')
         self.assertTrue(branch.repository.has_revision(revid))

=== modified file 'bzrlib/tests/test_bzrdir.py'
--- a/bzrlib/tests/test_bzrdir.py	2008-07-14 16:16:48 +0000
+++ b/bzrlib/tests/test_bzrdir.py	2008-07-16 07:30:18 +0000
@@ -451,13 +451,13 @@
         child_branch, new_child_transport = self.prepare_default_stacking()
         new_child = child_branch.bzrdir.clone_on_transport(new_child_transport)
         self.assertEqual(child_branch.base,
-                         new_child.open_branch().get_stacked_on())
+                         new_child.open_branch().get_stacked_on_url())
 
     def test_sprout_obeys_stacking_policy(self):
         child_branch, new_child_transport = self.prepare_default_stacking()
         new_child = child_branch.bzrdir.sprout(new_child_transport.base)
         self.assertEqual(child_branch.base,
-                         new_child.open_branch().get_stacked_on())
+                         new_child.open_branch().get_stacked_on_url())
 
     def test_add_fallback_repo_handles_absolute_urls(self):
         stack_on = self.make_branch('stack_on', format='development1')
@@ -477,7 +477,7 @@
         policy = bzrdir.UseExistingRepository(stacked.repository,
             '.', stack_on.base)
         policy.configure_branch(stacked)
-        self.assertEqual('..', stacked.get_stacked_on())
+        self.assertEqual('..', stacked.get_stacked_on_url())
 
     def test_relative_branch_stacking_to_absolute(self):
         stack_on = self.make_branch('stack_on', format='development1')
@@ -486,7 +486,7 @@
             '.', self.get_readonly_url('stack_on'))
         policy.configure_branch(stacked)
         self.assertEqual(self.get_readonly_url('stack_on'),
-                         stacked.get_stacked_on())
+                         stacked.get_stacked_on_url())
 
 
 class ChrootedTests(TestCaseWithTransport):




More information about the bazaar-commits mailing list