Rev 1197: Fix compatibility with shallow branches. in file:///data/jelmer/bzr-svn/shallow/
Jelmer Vernooij
jelmer at samba.org
Wed Jun 4 18:31:40 BST 2008
At file:///data/jelmer/bzr-svn/shallow/
------------------------------------------------------------
revno: 1197
revision-id: jelmer at samba.org-20080604173140-uk5hs6i32n9zuec1
parent: jelmer at samba.org-20080602223052-7pcbhqc92cki13jh
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: shallow
timestamp: Wed 2008-06-04 19:31:40 +0200
message:
Fix compatibility with shallow branches.
modified:
branch.py svnbranch.py-20051017135706-11c749eb0dab04a7
remote.py format.py-20060406233823-b6fa009fe35dfde7
=== modified file 'branch.py'
--- a/branch.py 2008-05-29 11:22:40 +0000
+++ b/branch.py 2008-06-04 17:31:40 +0000
@@ -19,7 +19,7 @@
from bzrlib.branch import Branch, BranchFormat, BranchCheckResult, PullResult
from bzrlib.bzrdir import BzrDir
from bzrlib.errors import (NoSuchFile, DivergedBranches, NoSuchRevision,
- NotBranchError)
+ NotBranchError, UnstackableBranchFormat)
from bzrlib.inventory import (Inventory)
from bzrlib.revision import is_null, ensure_null, NULL_REVISION
from bzrlib.workingtree import WorkingTree
@@ -425,6 +425,9 @@
self.copy_content_into(result, revision_id=revision_id)
return result
+ def get_stacked_on(self):
+ raise UnstackableBranchFormat(self._format, self.base)
+
def __str__(self):
return '%s(%r)' % (self.__class__.__name__, self.base)
=== modified file 'remote.py'
--- a/remote.py 2008-05-11 21:53:46 +0000
+++ b/remote.py 2008-06-04 17:31:40 +0000
@@ -15,6 +15,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""Subversion BzrDir formats."""
+import bzrlib
from bzrlib import urlutils
from bzrlib.bzrdir import BzrDirFormat, BzrDir, format_registry
from bzrlib.errors import (NotBranchError, NotLocalUrl, NoRepositoryPresent,
@@ -59,29 +60,6 @@
"""
raise NotImplementedError(SvnRemoteAccess.clone)
- def sprout(self, url, revision_id=None, force_new_repo=False,
- recurse='down', possible_transports=None, accelerator_tree=None,
- hardlink=False):
- """See BzrDir.sprout()."""
- # FIXME: Use possible_transports
- # FIXME: Use recurse
- format = get_rich_root_format()
- result = format.initialize(url)
- repo = self.find_repository()
- if force_new_repo:
- result_repo = repo.clone(result, revision_id)
- else:
- try:
- result_repo = result.find_repository()
- result_repo.fetch(repo, revision_id=revision_id)
- except NoRepositoryPresent:
- result_repo = repo.clone(result, revision_id)
- branch = self.open_branch()
- result_branch = branch.sprout(result, revision_id)
- if result_branch.repository.make_working_trees():
- result.create_workingtree(hardlink=hardlink)
- return result
-
def open_repository(self, _unsupported=False):
"""Open the repository associated with this BzrDir.
@@ -101,6 +79,10 @@
transport = transport.clone_root()
return SvnRepository(self, transport, self.branch_path)
+ def cloning_metadir(self):
+ """Produce a metadir suitable for cloning with."""
+ return bzrlib.bzrdir.format_registry.make_bzrdir("rich-root-pack")
+
def open_workingtree(self, _unsupported=False,
recommend_upgrade=True):
"""See BzrDir.open_workingtree().
More information about the bazaar-commits
mailing list