Rev 2388: Remove the --basis parameter to clone etc. (Robert Collins) in file:///home/robertc/source/baz/unbasis/
Robert Collins
robertc at robertcollins.net
Fri Mar 30 03:36:52 BST 2007
At file:///home/robertc/source/baz/unbasis/
------------------------------------------------------------
revno: 2388
revision-id: robertc at robertcollins.net-20070330023636-v6k82rwz5isl6k3a
parent: pqm at pqm.ubuntu.com-20070329191009-2b533e883212576c
committer: Robert Collins <robertc at robertcollins.net>
branch nick: unbasis
timestamp: Fri 2007-03-30 12:36:36 +1000
message:
Remove the --basis parameter to clone etc. (Robert Collins)
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/bzrdir.py bzrdir.py-20060131065624-156dfea39c4387cb
bzrlib/repository.py rev_storage.py-20051111201905-119e9401e46257e3
bzrlib/tests/blackbox/test_branch.py test_branch.py-20060524161337-noms9gmcwqqrfi8y-1
bzrlib/tests/blackbox/test_bundle.py test_bundle.py-20060616222707-c21c8b7ea5ef57b1
bzrlib/tests/branch_implementations/test_branch.py testbranch.py-20050711070244-121d632bc37d7253
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/workingtree.py workingtree.py-20050511021032-29b6ec0a681e02e3
=== modified file 'NEWS'
--- a/NEWS 2007-03-29 18:47:42 +0000
+++ b/NEWS 2007-03-30 02:36:36 +0000
@@ -19,6 +19,9 @@
* Remove ``--verbose`` from ``bzr bundle``. It didn't work anyway.
(Robert Widhopf-Fenk, #98591)
+ * Remove ``--basis`` from the checkout/branch commands - it didn't work
+ properly and is no longer beneficial. (Robert Collins)
+
TESTING:
* Added ``bzrlib.strace.strace`` which will strace a single callable and
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py 2007-03-27 07:58:34 +0000
+++ b/bzrlib/builtins.py 2007-03-30 02:36:36 +0000
@@ -835,16 +835,12 @@
To retrieve the branch as of a particular revision, supply the --revision
parameter, as in "branch foo/bar -r 5".
-
- --basis is to speed up branching from remote branches. When specified, it
- copies all the file-contents, inventory and revision data from the basis
- branch before copying anything from the remote branch.
"""
takes_args = ['from_location', 'to_location?']
- takes_options = ['revision', 'basis']
+ takes_options = ['revision']
aliases = ['get', 'clone']
- def run(self, from_location, to_location=None, revision=None, basis=None):
+ def run(self, from_location, to_location=None, revision=None):
from bzrlib.tag import _merge_tags_if_possible
if revision is None:
revision = [None]
@@ -855,10 +851,6 @@
br_from = Branch.open(from_location)
br_from.lock_read()
try:
- if basis is not None:
- basis_dir = bzrdir.BzrDir.open_containing(basis)[0]
- else:
- basis_dir = None
if len(revision) == 1 and revision[0] is not None:
revision_id = revision[0].in_history(br_from)[1]
else:
@@ -883,17 +875,12 @@
% to_location)
try:
# preserve whatever source format we have.
- dir = br_from.bzrdir.sprout(to_transport.base,
- revision_id, basis_dir)
+ dir = br_from.bzrdir.sprout(to_transport.base, revision_id)
branch = dir.open_branch()
except errors.NoSuchRevision:
to_transport.delete_tree('.')
msg = "The branch %s has no revision %s." % (from_location, revision[0])
raise errors.BzrCommandError(msg)
- except errors.UnlistableBranch:
- osutils.rmtree(to_location)
- msg = "The branch %s cannot be used as a --basis" % (basis,)
- raise errors.BzrCommandError(msg)
if name:
branch.control_files.put_utf8('branch-name', name)
_merge_tags_if_possible(br_from, branch)
@@ -921,7 +908,7 @@
See "help checkouts" for more information on checkouts.
"""
takes_args = ['branch_location?', 'to_location?']
- takes_options = ['revision', # , 'basis']
+ takes_options = ['revision',
Option('lightweight',
help="perform a lightweight checkout. Lightweight "
"checkouts depend on access to the branch for "
@@ -932,7 +919,7 @@
]
aliases = ['co']
- def run(self, branch_location=None, to_location=None, revision=None, basis=None,
+ def run(self, branch_location=None, to_location=None, revision=None,
lightweight=False):
if revision is None:
revision = [None]
=== modified file 'bzrlib/bzrdir.py'
--- a/bzrlib/bzrdir.py 2007-03-14 04:43:45 +0000
+++ b/bzrlib/bzrdir.py 2007-03-30 02:36:36 +0000
@@ -118,7 +118,7 @@
# see open_downlevel to open legacy branches.
raise errors.UnsupportedFormatError(format=format)
- def clone(self, url, revision_id=None, basis=None, force_new_repo=False):
+ def clone(self, url, revision_id=None, force_new_repo=False):
"""Clone this bzrdir and its contents to url verbatim.
If urls last component does not exist, it will be created.
@@ -129,7 +129,6 @@
even if one is available.
"""
self._make_tail(url)
- basis_repo, basis_branch, basis_tree = self._get_basis_components(basis)
result = self._format.initialize(url)
try:
local_repo = self.find_repository()
@@ -140,24 +139,18 @@
if force_new_repo:
result_repo = local_repo.clone(
result,
- revision_id=revision_id,
- basis=basis_repo)
+ revision_id=revision_id)
result_repo.set_make_working_trees(local_repo.make_working_trees())
else:
try:
result_repo = result.find_repository()
# fetch content this dir needs.
- if basis_repo:
- # XXX FIXME RBC 20060214 need tests for this when the basis
- # is incomplete
- result_repo.fetch(basis_repo, revision_id=revision_id)
result_repo.fetch(local_repo, revision_id=revision_id)
except errors.NoRepositoryPresent:
# needed to make one anyway.
result_repo = local_repo.clone(
result,
- revision_id=revision_id,
- basis=basis_repo)
+ revision_id=revision_id)
result_repo.set_make_working_trees(local_repo.make_working_trees())
# 1 if there is a branch present
# make sure its content is available in the target repository
@@ -167,32 +160,11 @@
except errors.NotBranchError:
pass
try:
- self.open_workingtree().clone(result, basis=basis_tree)
+ self.open_workingtree().clone(result)
except (errors.NoWorkingTree, errors.NotLocalUrl):
pass
return result
- def _get_basis_components(self, basis):
- """Retrieve the basis components that are available at basis."""
- if basis is None:
- return None, None, None
- try:
- basis_tree = basis.open_workingtree()
- basis_branch = basis_tree.branch
- basis_repo = basis_branch.repository
- except (errors.NoWorkingTree, errors.NotLocalUrl):
- basis_tree = None
- try:
- basis_branch = basis.open_branch()
- basis_repo = basis_branch.repository
- except errors.NotBranchError:
- basis_branch = None
- try:
- basis_repo = basis.open_repository()
- except errors.NoRepositoryPresent:
- basis_repo = None
- return basis_repo, basis_branch, basis_tree
-
# TODO: This should be given a Transport, and should chdir up; otherwise
# this will open a new connection.
def _make_tail(self, url):
@@ -646,22 +618,15 @@
except errors.NoWorkingTree:
return False
- def _cloning_metadir(self, basis=None):
- def related_repository(bzrdir):
+ def _cloning_metadir(self):
+ result_format = self._format.__class__()
+ try:
try:
- branch = bzrdir.open_branch()
- return branch.repository
+ branch = self.open_branch()
+ source_repository = branch.repository
except errors.NotBranchError:
source_branch = None
- return bzrdir.open_repository()
- result_format = self._format.__class__()
- try:
- try:
- source_repository = related_repository(self)
- except errors.NoRepositoryPresent:
- if basis is None:
- raise
- source_repository = related_repository(self)
+ source_repository = self.open_repository()
result_format.repository_format = source_repository._format
except errors.NoRepositoryPresent:
source_repository = None
@@ -673,7 +638,7 @@
result_format.workingtree_format = tree._format.__class__()
return result_format, source_repository
- def cloning_metadir(self, basis=None):
+ def cloning_metadir(self):
"""Produce a metadir suitable for cloning or sprouting with.
These operations may produce workingtrees (yes, even though they're
@@ -691,7 +656,7 @@
def checkout_metadir(self):
return self.cloning_metadir()
- def sprout(self, url, revision_id=None, basis=None, force_new_repo=False,
+ def sprout(self, url, revision_id=None, force_new_repo=False,
recurse='down'):
"""Create a copy of this bzrdir prepared for use as a new line of
development.
@@ -707,9 +672,8 @@
itself to download less data.
"""
self._make_tail(url)
- cloning_format = self.cloning_metadir(basis)
+ cloning_format = self.cloning_metadir()
result = cloning_format.initialize(url)
- basis_repo, basis_branch, basis_tree = self._get_basis_components(basis)
try:
source_branch = self.open_branch()
source_repository = source_branch.repository
@@ -718,9 +682,7 @@
try:
source_repository = self.open_repository()
except errors.NoRepositoryPresent:
- # copy the entire basis one if there is one
- # but there is no repository.
- source_repository = basis_repo
+ source_repository = None
if force_new_repo:
result_repo = None
else:
@@ -741,10 +703,6 @@
result_repo = result.create_repository()
if result_repo is not None:
# fetch needed content into target.
- if basis_repo:
- # XXX FIXME RBC 20060214 need tests for this when the basis
- # is incomplete
- result_repo.fetch(basis_repo, revision_id=revision_id)
if source_repository is not None:
result_repo.fetch(source_repository, revision_id=revision_id)
if source_branch is not None:
@@ -810,17 +768,16 @@
"""Pre-splitout bzrdirs do not suffer from stale locks."""
raise NotImplementedError(self.break_lock)
- def clone(self, url, revision_id=None, basis=None, force_new_repo=False):
+ def clone(self, url, revision_id=None, force_new_repo=False):
"""See BzrDir.clone()."""
from bzrlib.workingtree import WorkingTreeFormat2
self._make_tail(url)
result = self._format._initialize_for_clone(url)
- basis_repo, basis_branch, basis_tree = self._get_basis_components(basis)
- self.open_repository().clone(result, revision_id=revision_id, basis=basis_repo)
+ self.open_repository().clone(result, revision_id=revision_id)
from_branch = self.open_branch()
from_branch.clone(result, revision_id=revision_id)
try:
- self.open_workingtree().clone(result, basis=basis_tree)
+ self.open_workingtree().clone(result)
except errors.NotLocalUrl:
# make a new one, this format always has to have one.
try:
@@ -912,14 +869,13 @@
self._check_supported(format, unsupported)
return format.open(self, _found=True)
- def sprout(self, url, revision_id=None, basis=None, force_new_repo=False):
+ def sprout(self, url, revision_id=None, force_new_repo=False):
"""See BzrDir.sprout()."""
from bzrlib.workingtree import WorkingTreeFormat2
self._make_tail(url)
result = self._format._initialize_for_clone(url)
- basis_repo, basis_branch, basis_tree = self._get_basis_components(basis)
try:
- self.open_repository().clone(result, revision_id=revision_id, basis=basis_repo)
+ self.open_repository().clone(result, revision_id=revision_id)
except errors.NoRepositoryPresent:
pass
try:
=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py 2007-03-29 01:36:44 +0000
+++ b/bzrlib/repository.py 2007-03-30 02:36:36 +0000
@@ -311,14 +311,14 @@
control = bzrdir.BzrDir.open(base)
return control.open_repository()
- def copy_content_into(self, destination, revision_id=None, basis=None):
+ def copy_content_into(self, destination, revision_id=None):
"""Make a complete copy of the content in self into destination.
This is a destructive operation! Do not use it on existing
repositories.
"""
revision_id = osutils.safe_revision_id(revision_id)
- return InterRepository.get(self, destination).copy_content(revision_id, basis)
+ return InterRepository.get(self, destination).copy_content(revision_id)
def fetch(self, source, revision_id=None, pb=None):
"""Fetch the content required to construct revision_id from source.
@@ -351,7 +351,7 @@
self.control_files.unlock()
@needs_read_lock
- def clone(self, a_bzrdir, revision_id=None, basis=None):
+ def clone(self, a_bzrdir, revision_id=None):
"""Clone this repository into a_bzrdir using the current format.
Currently no check is made that the format of this repository and
@@ -369,7 +369,7 @@
dest_repo = self._format.initialize(a_bzrdir, shared=self.is_shared())
except errors.UninitializableFormat:
dest_repo = a_bzrdir.open_repository()
- self.copy_content_into(dest_repo, revision_id, basis)
+ self.copy_content_into(dest_repo, revision_id)
return dest_repo
@needs_read_lock
@@ -1280,7 +1280,7 @@
_optimisers = []
"""The available optimised InterRepository types."""
- def copy_content(self, revision_id=None, basis=None):
+ def copy_content(self, revision_id=None):
raise NotImplementedError(self.copy_content)
def fetch(self, revision_id=None, pb=None):
@@ -1350,7 +1350,7 @@
return True
@needs_write_lock
- def copy_content(self, revision_id=None, basis=None):
+ def copy_content(self, revision_id=None):
"""Make a complete copy of the content in self into destination.
This is a destructive operation! Do not use it on existing
@@ -1358,7 +1358,6 @@
:param revision_id: Only copy the content needed to construct
revision_id and its parents.
- :param basis: Copy the needed data preferentially from basis.
"""
try:
self.target.set_make_working_trees(self.source.make_working_trees())
@@ -1367,9 +1366,6 @@
# TODO: jam 20070210 This is fairly internal, so we should probably
# just assert that revision_id is not unicode.
revision_id = osutils.safe_revision_id(revision_id)
- # grab the basis available data
- if basis is not None:
- self.target.fetch(basis, revision_id=revision_id)
# but don't bother fetching if we have the needed data now.
if (revision_id not in (None, _mod_revision.NULL_REVISION) and
self.target.has_revision(revision_id)):
@@ -1424,46 +1420,36 @@
return False
@needs_write_lock
- def copy_content(self, revision_id=None, basis=None):
+ def copy_content(self, revision_id=None):
"""See InterRepository.copy_content()."""
# weave specific optimised path:
# TODO: jam 20070210 Internal, should be an assert, not translate
revision_id = osutils.safe_revision_id(revision_id)
- if basis is not None:
- # copy the basis in, then fetch remaining data.
- basis.copy_content_into(self.target, revision_id)
- # the basis copy_content_into could miss-set this.
+ try:
+ self.target.set_make_working_trees(self.source.make_working_trees())
+ except NotImplementedError:
+ pass
+ # FIXME do not peek!
+ if self.source.control_files._transport.listable():
+ pb = ui.ui_factory.nested_progress_bar()
try:
- self.target.set_make_working_trees(self.source.make_working_trees())
- except NotImplementedError:
- pass
+ self.target.weave_store.copy_all_ids(
+ self.source.weave_store,
+ pb=pb,
+ from_transaction=self.source.get_transaction(),
+ to_transaction=self.target.get_transaction())
+ pb.update('copying inventory', 0, 1)
+ self.target.control_weaves.copy_multi(
+ self.source.control_weaves, ['inventory'],
+ from_transaction=self.source.get_transaction(),
+ to_transaction=self.target.get_transaction())
+ self.target._revision_store.text_store.copy_all_ids(
+ self.source._revision_store.text_store,
+ pb=pb)
+ finally:
+ pb.finished()
+ else:
self.target.fetch(self.source, revision_id=revision_id)
- else:
- try:
- self.target.set_make_working_trees(self.source.make_working_trees())
- except NotImplementedError:
- pass
- # FIXME do not peek!
- if self.source.control_files._transport.listable():
- pb = ui.ui_factory.nested_progress_bar()
- try:
- self.target.weave_store.copy_all_ids(
- self.source.weave_store,
- pb=pb,
- from_transaction=self.source.get_transaction(),
- to_transaction=self.target.get_transaction())
- pb.update('copying inventory', 0, 1)
- self.target.control_weaves.copy_multi(
- self.source.control_weaves, ['inventory'],
- from_transaction=self.source.get_transaction(),
- to_transaction=self.target.get_transaction())
- self.target._revision_store.text_store.copy_all_ids(
- self.source._revision_store.text_store,
- pb=pb)
- finally:
- pb.finished()
- else:
- self.target.fetch(self.source, revision_id=revision_id)
@needs_write_lock
def fetch(self, revision_id=None, pb=None):
@@ -1619,7 +1605,7 @@
return f.count_copied, f.failed_revisions
@needs_write_lock
- def copy_content(self, revision_id=None, basis=None):
+ def copy_content(self, revision_id=None):
"""Make a complete copy of the content in self into destination.
This is a destructive operation! Do not use it on existing
@@ -1627,7 +1613,6 @@
:param revision_id: Only copy the content needed to construct
revision_id and its parents.
- :param basis: Copy the needed data preferentially from basis.
"""
try:
self.target.set_make_working_trees(self.source.make_working_trees())
@@ -1635,9 +1620,6 @@
pass
# TODO: jam 20070210 Internal, assert, don't translate
revision_id = osutils.safe_revision_id(revision_id)
- # grab the basis available data
- if basis is not None:
- self.target.fetch(basis, revision_id=revision_id)
# but don't bother fetching if we have the needed data now.
if (revision_id not in (None, _mod_revision.NULL_REVISION) and
self.target.has_revision(revision_id)):
=== modified file 'bzrlib/tests/blackbox/test_branch.py'
--- a/bzrlib/tests/blackbox/test_branch.py 2007-02-07 09:11:31 +0000
+++ b/bzrlib/tests/blackbox/test_branch.py 2007-03-30 02:36:36 +0000
@@ -50,26 +50,6 @@
self.runbzr('commit -m foo --unchanged')
os.chdir('..')
- def test_branch_basis(self):
- # ensure that basis really does grab from the basis by having incomplete source
- tree = self.make_branch_and_tree('commit_tree')
- self.build_tree(['foo'], transport=tree.bzrdir.transport.clone('..'))
- tree.add('foo')
- tree.commit('revision 1', rev_id='1')
- source = self.make_branch_and_tree('source')
- # this gives us an incomplete repository
- tree.bzrdir.open_repository().copy_content_into(source.branch.repository)
- tree.commit('revision 2', rev_id='2', allow_pointless=True)
- tree.bzrdir.open_branch().copy_content_into(source.branch)
- tree.copy_content_into(source)
- self.assertFalse(source.branch.repository.has_revision('2'))
- dir = source.bzrdir
- self.runbzr('branch source target --basis commit_tree')
- target = bzrdir.BzrDir.open('target')
- self.assertEqual('2', target.open_branch().last_revision())
- self.assertEqual(['2'], target.open_workingtree().get_parent_ids())
- self.assertTrue(target.open_branch().repository.has_revision('2'))
-
def test_branch_only_copies_history(self):
# Knit branches should only push the history for the current revision.
format = bzrdir.BzrDirMetaFormat1()
=== modified file 'bzrlib/tests/blackbox/test_bundle.py'
--- a/bzrlib/tests/blackbox/test_bundle.py 2006-12-19 17:37:38 +0000
+++ b/bzrlib/tests/blackbox/test_bundle.py 2007-03-30 02:36:36 +0000
@@ -37,7 +37,7 @@
def test_uses_parent(self):
"""Parent location is used as a basis by default"""
- self.make_trees()
+ self.make_trees()
os.chdir('grandparent')
errmsg = self.run_bzr('bundle', retcode=3)[1]
self.assertContainsRe(errmsg, 'No base branch known or specified')
=== modified file 'bzrlib/tests/branch_implementations/test_branch.py'
--- a/bzrlib/tests/branch_implementations/test_branch.py 2007-03-28 22:31:41 +0000
+++ b/bzrlib/tests/branch_implementations/test_branch.py 2007-03-30 02:36:36 +0000
@@ -48,11 +48,6 @@
from bzrlib.workingtree import WorkingTree
-# TODO: Make a branch using basis branch, and check that it
-# doesn't request any files that could have been avoided, by
-# hooking into the Transport.
-
-
class TestCaseWithBranch(TestCaseWithBzrDir):
def setUp(self):
@@ -163,16 +158,6 @@
tree_b.branch.repository.fetch(tree_a.branch.repository)
return tree_a, tree_b
- def test_clone_branch(self):
- """Copy the stores from one branch to another"""
- tree_a, tree_b = self.get_balanced_branch_pair()
- tree_b.commit("silly commit")
- os.mkdir('c')
- # this fails to test that the history from a was not used.
- dir_c = tree_a.bzrdir.clone('c', basis=tree_b.bzrdir)
- self.assertEqual(tree_a.branch.revision_history(),
- dir_c.open_branch().revision_history())
-
def test_clone_partial(self):
"""Copy only part of the history of a branch."""
# TODO: RBC 20060208 test with a revision not on revision-history.
=== modified file 'bzrlib/tests/bzrdir_implementations/test_bzrdir.py'
--- a/bzrlib/tests/bzrdir_implementations/test_bzrdir.py 2007-03-28 22:31:41 +0000
+++ b/bzrlib/tests/bzrdir_implementations/test_bzrdir.py 2007-03-30 02:36:36 +0000
@@ -136,7 +136,7 @@
raise TestSkipped("cannot make working tree with transport %r"
% a_bzrdir.transport)
- def sproutOrSkip(self, from_bzrdir, to_url, revision_id=None, basis=None,
+ def sproutOrSkip(self, from_bzrdir, to_url, revision_id=None,
force_new_repo=False):
"""Sprout from_bzrdir into to_url, or raise TestSkipped.
@@ -145,7 +145,6 @@
"""
try:
target = from_bzrdir.sprout(to_url, revision_id=revision_id,
- basis=basis,
force_new_repo=force_new_repo)
except errors.NotLocalUrl:
raise TestSkipped('Cannot sprout to remote bzrdirs.')
@@ -494,30 +493,6 @@
self.skipIfNoWorkingTree(target)
self.assertEqual(['1'], target.open_workingtree().get_parent_ids())
- def test_clone_bzrdir_incomplete_source_with_basis(self):
- # ensure that basis really does grab from the basis by having incomplete source
- tree = self.make_branch_and_tree('commit_tree')
- self.build_tree(['foo'], transport=tree.bzrdir.transport.clone('..'))
- tree.add('foo')
- tree.commit('revision 1', rev_id='1')
- source = self.make_branch_and_tree('source')
- # this gives us an incomplete repository
- tree.bzrdir.open_repository().copy_content_into(source.branch.repository)
- tree.commit('revision 2', rev_id='2', allow_pointless=True)
- tree.bzrdir.open_branch().copy_content_into(source.branch)
- tree.copy_content_into(source)
- self.assertFalse(source.branch.repository.has_revision('2'))
- dir = source.bzrdir
- target = dir.clone(self.get_url('target'), basis=tree.bzrdir)
- self.assertEqual('2', target.open_branch().last_revision())
- try:
- self.assertEqual(['2'], target.open_workingtree().get_parent_ids())
- except errors.NoWorkingTree:
- # It should have a working tree if it's able to have one, so if
- # we're here make sure it really can't have one.
- self.assertRaises(errors.NotLocalUrl, target.create_workingtree)
- self.assertTrue(target.open_branch().repository.has_revision('2'))
-
def test_sprout_bzrdir_empty(self):
dir = self.make_bzrdir('source')
target = self.sproutOrSkip(dir, self.get_url('target'))
@@ -935,26 +910,6 @@
target = self.sproutOrSkip(dir, self.get_url('target'), revision_id='1')
self.assertEqual(['1'], target.open_workingtree().get_parent_ids())
- def test_sprout_bzrdir_incomplete_source_with_basis(self):
- # ensure that basis really does grab from the basis by having incomplete source
- tree = self.make_branch_and_tree('commit_tree')
- self.build_tree(['commit_tree/foo'])
- tree.add('foo')
- tree.commit('revision 1', rev_id='1')
- source = self.make_branch_and_tree('source')
- # this gives us an incomplete repository
- tree.bzrdir.open_repository().copy_content_into(source.branch.repository)
- tree.commit('revision 2', rev_id='2', allow_pointless=True)
- tree.bzrdir.open_branch().copy_content_into(source.branch)
- tree.copy_content_into(source)
- self.assertFalse(source.branch.repository.has_revision('2'))
- dir = source.bzrdir
- target = self.sproutOrSkip(dir, self.get_url('target'),
- basis=tree.bzrdir)
- self.assertEqual('2', target.open_branch().last_revision())
- self.assertEqual(['2'], target.open_workingtree().get_parent_ids())
- self.assertTrue(target.open_branch().repository.has_revision('2'))
-
def test_format_initialize_find_open(self):
# loopback test to check the current format initializes to itself.
if not self.bzrdir_format.is_supported():
=== modified file 'bzrlib/tests/repository_implementations/test_repository.py'
--- a/bzrlib/tests/repository_implementations/test_repository.py 2007-03-29 06:24:19 +0000
+++ b/bzrlib/tests/repository_implementations/test_repository.py 2007-03-30 02:36:36 +0000
@@ -252,20 +252,6 @@
def test_clone_repository_basis_revision(self):
raise TestSkipped('the use of a basis should not add noise data to the result.')
- def test_clone_repository_incomplete_source_with_basis(self):
- # ensure that basis really does grab from the basis by having incomplete source
- tree = self.make_branch_and_tree('commit_tree')
- self.build_tree(['foo'], transport=tree.bzrdir.transport.clone('..'))
- tree.add('foo')
- tree.commit('revision 1', rev_id='1')
- source = self.make_repository('source')
- # this gives us an incomplete repository
- tree.branch.repository.copy_content_into(source)
- tree.commit('revision 2', rev_id='2', allow_pointless=True)
- self.assertFalse(source.has_revision('2'))
- target = source.bzrdir.clone(self.get_url('target'), basis=tree.bzrdir)
- self.assertTrue(target.open_repository().has_revision('2'))
-
def test_clone_shared_no_tree(self):
# cloning a shared repository keeps it shared
# and preserves the make_working_tree setting.
=== modified file 'bzrlib/workingtree.py'
--- a/bzrlib/workingtree.py 2007-03-27 05:53:02 +0000
+++ b/bzrlib/workingtree.py 2007-03-30 02:36:36 +0000
@@ -524,7 +524,7 @@
return self.abspath(self.id2path(file_id))
@needs_read_lock
- def clone(self, to_bzrdir, revision_id=None, basis=None):
+ def clone(self, to_bzrdir, revision_id=None):
"""Duplicate this working tree into to_bzr, including all state.
Specifically modified files are kept as modified, but
@@ -536,10 +536,6 @@
If not None, the cloned tree will have its last revision set to
revision, and and difference between the source trees last revision
and this one merged in.
-
- basis
- If not None, a closer copy of a tree which may have some files in
- common, and which file content should be preferentially copied from.
"""
# assumes the target bzr dir format is compatible.
result = self._format.initialize(to_bzrdir)
More information about the bazaar-commits
mailing list