Rev 6447: (jelmer) Fetch revisions when branching into an empty control directory. in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/2.5/
Patch Queue Manager
pqm at pqm.ubuntu.com
Thu Jan 19 13:42:40 UTC 2012
At file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/2.5/
------------------------------------------------------------
revno: 6447 [merge]
revision-id: pqm at pqm.ubuntu.com-20120119134240-g8me32sn0s86c6r1
parent: pqm at pqm.ubuntu.com-20120119124813-1qz4rgkgeuwaf0jk
parent: jelmer at samba.org-20120119120112-v5f90mqrq7dma16w
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: 2.5
timestamp: Thu 2012-01-19 13:42:40 +0000
message:
(jelmer) Fetch revisions when branching into an empty control directory.
(Jelmer Vernooij)
modified:
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/tests/blackbox/test_branch.py test_branch.py-20060524161337-noms9gmcwqqrfi8y-1
doc/en/release-notes/bzr-2.5.txt bzr2.5.txt-20110708125756-587p0hpw7oke4h05-1
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py 2012-01-17 10:30:33 +0000
+++ b/bzrlib/builtins.py 2012-01-19 12:01:12 +0000
@@ -1394,6 +1394,11 @@
from_location, revision)
raise errors.BzrCommandError(msg)
else:
+ try:
+ to_repo = to_dir.open_repository()
+ except errors.NoRepositoryPresent:
+ to_repo = to_dir.create_repository()
+ to_repo.fetch(br_from.repository, revision_id=revision_id)
branch = br_from.sprout(to_dir, revision_id=revision_id)
_merge_tags_if_possible(br_from, branch)
# If the source branch is stacked, the new branch may
=== modified file 'bzrlib/tests/blackbox/test_branch.py'
--- a/bzrlib/tests/blackbox/test_branch.py 2012-01-05 13:02:31 +0000
+++ b/bzrlib/tests/blackbox/test_branch.py 2012-01-19 12:01:12 +0000
@@ -156,6 +156,12 @@
work = branch.Branch.open('current')
self.assertEqual(work.last_revision(), _mod_revision.NULL_REVISION)
+ def test_branch_into_empty_dir(self):
+ t = self.example_branch('source')
+ self.make_bzrdir('target')
+ self.run_bzr("branch source target")
+ self.assertEquals(2, len(t.branch.repository.all_revision_ids()))
+
def test_branch_switch_checkout(self):
# Checkout in the current directory:
# => new branch will be created and checkout bound to the new branch
=== modified file 'doc/en/release-notes/bzr-2.5.txt'
--- a/doc/en/release-notes/bzr-2.5.txt 2012-01-19 12:48:13 +0000
+++ b/doc/en/release-notes/bzr-2.5.txt 2012-01-19 13:42:40 +0000
@@ -32,6 +32,9 @@
.. Fixes for situations where bzr would previously crash or give incorrect
or undesirable results.
+* ``bzr branch`` now fetches revisions when branching into an empty
+ control directory. (Jelmer Vernooij, #905594)
+
* Support scripts that don't call bzrlib.initialize() but still call run_bzr().
(Vincent Ladeuil, #917733)
More information about the bazaar-commits
mailing list