Rev 2813: Merge 0.92 opening. in http://people.ubuntu.com/~robertc/baz2.0/knits
Robert Collins
robertc at robertcollins.net
Wed Sep 12 22:27:55 BST 2007
At http://people.ubuntu.com/~robertc/baz2.0/knits
------------------------------------------------------------
revno: 2813
revision-id: robertc at robertcollins.net-20070912212742-xlzu3nasjo31d5zs
parent: robertc at robertcollins.net-20070912042151-o2k78pnf1hdwd2xt
parent: pqm at pqm.ubuntu.com-20070912075616-4lsus30tfc3sgwy0
committer: Robert Collins <robertc at robertcollins.net>
branch nick: knits
timestamp: Thu 2007-09-13 07:27:42 +1000
message:
Merge 0.92 opening.
added:
bzrlib/tests/commands/test_update.py test_update.py-20070910091045-8uyp8v73j926l1g2-1
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzr bzr.py-20050313053754-5485f144c7006fa6
bzrlib/__init__.py __init__.py-20050309040759-33e65acf91bbcd5d
bzrlib/branch.py branch.py-20050309040759-e4baf4e0d046576e
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/bzrdir.py bzrdir.py-20060131065624-156dfea39c4387cb
bzrlib/repository.py rev_storage.py-20051111201905-119e9401e46257e3
bzrlib/tag.py tag.py-20070212110532-91cw79inah2cfozx-1
bzrlib/tests/commands/__init__.py __init__.py-20070520095518-ecfl8531fxgjeycj-1
bzrlib/tests/interrepository_implementations/test_interrepository.py test_interrepository.py-20060220061411-1ec13fa99e5e3eee
bzrlib/tests/test_tag.py test_tag.py-20070212110532-91cw79inah2cfozx-2
bzrlib/workingtree.py workingtree.py-20050511021032-29b6ec0a681e02e3
------------------------------------------------------------
revno: 2805.1.11
revision-id: pqm at pqm.ubuntu.com-20070912075616-4lsus30tfc3sgwy0
parent: pqm at pqm.ubuntu.com-20070912042748-qhmeoj3c8zk7zt01
parent: mbp at sourcefrog.net-20070912012921-x905ro1jgeiddlsm
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2007-09-12 08:56:16 +0100
message:
(mbp) prepare for 0.92 cycle
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzr bzr.py-20050313053754-5485f144c7006fa6
bzrlib/__init__.py __init__.py-20050309040759-33e65acf91bbcd5d
------------------------------------------------------------
revno: 2805.1.9.2.1
revision-id: mbp at sourcefrog.net-20070912012921-x905ro1jgeiddlsm
parent: pqm at pqm.ubuntu.com-20070911055622-a3060rj7l0iy38l2
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: integration
timestamp: Wed 2007-09-12 11:29:21 +1000
message:
Prepare for 0.92 cycle
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzr bzr.py-20050313053754-5485f144c7006fa6
bzrlib/__init__.py __init__.py-20050309040759-33e65acf91bbcd5d
------------------------------------------------------------
revno: 2805.1.10
revision-id: pqm at pqm.ubuntu.com-20070912042748-qhmeoj3c8zk7zt01
parent: pqm at pqm.ubuntu.com-20070911055622-a3060rj7l0iy38l2
parent: robertc at robertcollins.net-20070912031604-lzy05h9u6dyfrfgb
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2007-09-12 05:27:48 +0100
message:
(robertc) Fix fetching of revisions referring to nested trees. (Robert Collins)
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/repository.py rev_storage.py-20051111201905-119e9401e46257e3
bzrlib/tests/interrepository_implementations/test_interrepository.py test_interrepository.py-20060220061411-1ec13fa99e5e3eee
------------------------------------------------------------
revno: 2805.1.9.1.2
revision-id: robertc at robertcollins.net-20070912031604-lzy05h9u6dyfrfgb
parent: robertc at robertcollins.net-20070912000548-b93ev6hxnfh202ks
committer: Robert Collins <robertc at robertcollins.net>
branch nick: nested-tree
timestamp: Wed 2007-09-12 13:16:04 +1000
message:
Fixup other interrepository tests failing due to the change to test subtrees.
modified:
bzrlib/tests/interrepository_implementations/test_interrepository.py test_interrepository.py-20060220061411-1ec13fa99e5e3eee
------------------------------------------------------------
revno: 2805.1.9.1.1
revision-id: robertc at robertcollins.net-20070912000548-b93ev6hxnfh202ks
parent: pqm at pqm.ubuntu.com-20070911055622-a3060rj7l0iy38l2
committer: Robert Collins <robertc at robertcollins.net>
branch nick: nested-tree
timestamp: Wed 2007-09-12 10:05:48 +1000
message:
* Pushing, pulling and branching branches with subtree references was not
copying the subtree weave, preventing the file graph from being accessed
and causing errors in commits in clones. (Robert Collins)
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/repository.py rev_storage.py-20051111201905-119e9401e46257e3
bzrlib/tests/interrepository_implementations/test_interrepository.py test_interrepository.py-20060220061411-1ec13fa99e5e3eee
------------------------------------------------------------
revno: 2805.1.9
revision-id: pqm at pqm.ubuntu.com-20070911055622-a3060rj7l0iy38l2
parent: pqm at pqm.ubuntu.com-20070911025457-xd28g5hqu9jco1sm
parent: mbp at sourcefrog.net-20070911031705-ho2pp6ulm4zln3du
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2007-09-11 06:56:22 +0100
message:
(mbp) fix bugs in tags with checkouts
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/tag.py tag.py-20070212110532-91cw79inah2cfozx-1
bzrlib/tests/test_tag.py test_tag.py-20070212110532-91cw79inah2cfozx-2
------------------------------------------------------------
revno: 2805.6.5
revision-id: mbp at sourcefrog.net-20070911031705-ho2pp6ulm4zln3du
parent: mbp at sourcefrog.net-20070911030714-nzoumditu81hhwtw
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: tags
timestamp: Tue 2007-09-11 13:17:05 +1000
message:
Add another test that tags work ok in checkouts
modified:
bzrlib/tests/test_tag.py test_tag.py-20070212110532-91cw79inah2cfozx-2
------------------------------------------------------------
revno: 2805.6.4
revision-id: mbp at sourcefrog.net-20070911030714-nzoumditu81hhwtw
parent: mbp at sourcefrog.net-20070911030330-8000a0t8feq8g130
parent: pqm at pqm.ubuntu.com-20070911025457-xd28g5hqu9jco1sm
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: tags
timestamp: Tue 2007-09-11 13:07:14 +1000
message:
merge trunk
added:
bzrlib/tests/commands/test_update.py test_update.py-20070910091045-8uyp8v73j926l1g2-1
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/branch.py branch.py-20050309040759-e4baf4e0d046576e
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/bzrdir.py bzrdir.py-20060131065624-156dfea39c4387cb
bzrlib/help_topics.py help_topics.py-20060920210027-rnim90q9e0bwxvy4-1
bzrlib/repofmt/weaverepo.py presplitout.py-20070125045333-wfav3tsh73oxu3zk-1
bzrlib/repository.py rev_storage.py-20051111201905-119e9401e46257e3
bzrlib/tag.py tag.py-20070212110532-91cw79inah2cfozx-1
bzrlib/tests/commands/__init__.py __init__.py-20070520095518-ecfl8531fxgjeycj-1
bzrlib/tests/test_tag.py test_tag.py-20070212110532-91cw79inah2cfozx-2
bzrlib/transport/__init__.py transport.py-20050711165921-4978aa7ce1285ad5
bzrlib/workingtree.py workingtree.py-20050511021032-29b6ec0a681e02e3
doc/developers/HACKING.txt HACKING-20050805200004-2a5dc975d870f78c
------------------------------------------------------------
revno: 2805.6.3
revision-id: mbp at sourcefrog.net-20070911030330-8000a0t8feq8g130
parent: mbp at sourcefrog.net-20070911020916-t0i1xe6jrpmjl4vf
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: tags
timestamp: Tue 2007-09-11 13:03:30 +1000
message:
In checkouts, tags are copied into the master branch when created, changed or deleted, and are copied into the checkout when it is updated. (Martin Pool, #93856, #93860)
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/tests/test_tag.py test_tag.py-20070212110532-91cw79inah2cfozx-2
------------------------------------------------------------
revno: 2805.6.2
revision-id: mbp at sourcefrog.net-20070911020916-t0i1xe6jrpmjl4vf
parent: mbp at sourcefrog.net-20070910095133-yvlr99xkorynbdue
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: tags
timestamp: Tue 2007-09-11 12:09:16 +1000
message:
Setting and deleting tags should also update the master branch, if any.
modified:
bzrlib/tag.py tag.py-20070212110532-91cw79inah2cfozx-1
bzrlib/tests/test_tag.py test_tag.py-20070212110532-91cw79inah2cfozx-2
------------------------------------------------------------
revno: 2805.6.1
revision-id: mbp at sourcefrog.net-20070910095133-yvlr99xkorynbdue
parent: pqm at pqm.ubuntu.com-20070907145828-hjh5941jv7y8d9z8
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: tags
timestamp: Mon 2007-09-10 19:51:33 +1000
message:
Start adding tests for bug 93860
modified:
bzrlib/tests/test_tag.py test_tag.py-20070212110532-91cw79inah2cfozx-2
------------------------------------------------------------
revno: 2805.1.8
revision-id: pqm at pqm.ubuntu.com-20070911025457-xd28g5hqu9jco1sm
parent: pqm at pqm.ubuntu.com-20070911020027-bmt9h0jgy3zdlge3
parent: mbp at sourcefrog.net-20070911012409-c2ln3x5v53weqf9c
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2007-09-11 03:54:57 +0100
message:
(vila) avoid repeated connections from bzr update
added:
bzrlib/tests/commands/test_update.py test_update.py-20070910091045-8uyp8v73j926l1g2-1
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/branch.py branch.py-20050309040759-e4baf4e0d046576e
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/bzrdir.py bzrdir.py-20060131065624-156dfea39c4387cb
bzrlib/tests/commands/__init__.py __init__.py-20070520095518-ecfl8531fxgjeycj-1
bzrlib/workingtree.py workingtree.py-20050511021032-29b6ec0a681e02e3
------------------------------------------------------------
revno: 2805.1.5.2.2
revision-id: mbp at sourcefrog.net-20070911012409-c2ln3x5v53weqf9c
parent: mbp at sourcefrog.net-20070911002726-xqvjood96a36ue2m
parent: pqm at pqm.ubuntu.com-20070911010353-6lu7ek40rbjhj86o
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: integration
timestamp: Tue 2007-09-11 11:24:09 +1000
message:
merge news
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/branch.py branch.py-20050309040759-e4baf4e0d046576e
bzrlib/tag.py tag.py-20070212110532-91cw79inah2cfozx-1
bzrlib/tests/test_tag.py test_tag.py-20070212110532-91cw79inah2cfozx-2
------------------------------------------------------------
revno: 2805.1.5.2.1
revision-id: mbp at sourcefrog.net-20070911002726-xqvjood96a36ue2m
parent: pqm at pqm.ubuntu.com-20070910121243-ccy1gej0kqy4feen
parent: v.ladeuil+lp at free.fr-20070910121247-sxf4l4pq1e27380p
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: integration
timestamp: Tue 2007-09-11 10:27:26 +1000
message:
merge vincent and cleanup
added:
bzrlib/tests/commands/test_update.py test_update.py-20070910091045-8uyp8v73j926l1g2-1
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/branch.py branch.py-20050309040759-e4baf4e0d046576e
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/bzrdir.py bzrdir.py-20060131065624-156dfea39c4387cb
bzrlib/tests/commands/__init__.py __init__.py-20070520095518-ecfl8531fxgjeycj-1
bzrlib/workingtree.py workingtree.py-20050511021032-29b6ec0a681e02e3
------------------------------------------------------------
revno: 2805.1.1.2.2
revision-id: v.ladeuil+lp at free.fr-20070910121247-sxf4l4pq1e27380p
parent: v.ladeuil+lp at free.fr-20070910091350-mnrhuokhmj2vxim0
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 128076
timestamp: Mon 2007-09-10 14:12:47 +0200
message:
Fix #128076 and #131396 by reusing bound branch transport.
* bzrlib/bzrdir.py:
(BzrDir.open): Add possible_transports as the last parameter.
* bzrlib/builtins.py:
(cmd_update.run): Use possible_transports parameter to obtain the
master branch transport and reuse it.
* bzrlib/branch.py:
(Branch.open, Branch.get_master_branch,
BzrBranch5.get_master_branch, BzrBranch5.update): Add
possible_transports as the last parameter.
* bzrlib/workingtree.py:
(WorkingTree.update): Add possible_transports as the last parameter.
* bzrlib/tests/commands/test_update.py:
(TestUpdate.test_update): Ignore connections from bind.
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/branch.py branch.py-20050309040759-e4baf4e0d046576e
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/bzrdir.py bzrdir.py-20060131065624-156dfea39c4387cb
bzrlib/tests/commands/test_update.py test_update.py-20070910091045-8uyp8v73j926l1g2-1
bzrlib/workingtree.py workingtree.py-20050511021032-29b6ec0a681e02e3
------------------------------------------------------------
revno: 2805.1.1.2.1
revision-id: v.ladeuil+lp at free.fr-20070910091350-mnrhuokhmj2vxim0
parent: pqm at pqm.ubuntu.com-20070910054843-evbkt0bivtk6tpqu
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 128076
timestamp: Mon 2007-09-10 11:13:50 +0200
message:
Reproduce #131396 and #128076 in the test suite.
added:
bzrlib/tests/commands/test_update.py test_update.py-20070910091045-8uyp8v73j926l1g2-1
modified:
bzrlib/tests/commands/__init__.py __init__.py-20070520095518-ecfl8531fxgjeycj-1
=== added file 'bzrlib/tests/commands/test_update.py'
--- a/bzrlib/tests/commands/test_update.py 1970-01-01 00:00:00 +0000
+++ b/bzrlib/tests/commands/test_update.py 2007-09-10 12:12:47 +0000
@@ -0,0 +1,40 @@
+# Copyright (C) 2007 Canonical Ltd
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+from bzrlib import builtins
+from bzrlib.tests.transport_util import TestCaseWithConnectionHookedTransport
+
+
+class TestUpdate(TestCaseWithConnectionHookedTransport):
+
+ def test_update(self):
+ wt1 = self.make_branch_and_tree('branch1')
+ wt2 = self.make_branch_and_tree('branch2')
+ wt2.pull(wt1.branch)
+
+ wt1.commit('empty commit')
+ wt2.commit('empty commit too')
+
+ bind = builtins.cmd_bind()
+ bind.run(location=self.get_url('branch1'))
+
+ self.install_hooks()
+
+ update = builtins.cmd_update()
+ update.run()
+ self.assertEquals(1, len(self.connections))
+
=== modified file 'NEWS'
--- a/NEWS 2007-09-12 04:21:51 +0000
+++ b/NEWS 2007-09-12 21:27:42 +0000
@@ -7,11 +7,40 @@
IN DEVELOPMENT
==============
+ NOTES WHEN UPGRADING:
+
+ FEATURES:
+
+ PERFORMANCE:
+
+ IMPROVEMENTS:
+
+ BUG FIXES:
+
+ API BREAKS:
+
+ * The ``VersionedFile`` interface now allows content checks to be bypassed
+ by supplying check_content=False. This saves nearly 30% of the minimum
+ cost to store a version of a file. (Robert Collins)
+
+ TESTING:
+
+
+bzr 0.91rc2 2007-09-11
+======================
+
+ * Replaced incorrect tarball for previous release; a debug statement was left
+ in bzrlib/remote.py.
+
+bzr 0.91rc1 2007-09-11
+======================
+
CHANGES:
* The default branch and repository format has changed to
``dirstate-tags``, so tag commands are active by default.
This format is compatible with Bazaar 0.15 and later.
+ This incidentally fixes bug #126141.
(Martin Pool)
* ``--quiet`` or ``-q`` is no longer a global option. If present, it
@@ -56,6 +85,10 @@
* ``bzr plugins`` now lists the version number for each plugin in square
brackets after the path. (Robert Collins, #125421)
+ * Pushing, pulling and branching branches with subtree references was not
+ copying the subtree weave, preventing the file graph from being accessed
+ and causing errors in commits in clones. (Robert Collins)
+
* Suppress warning "integer argument expected, got float" from Paramiko,
which sometimes caused false test failures. (Martin Pool)
@@ -126,9 +159,17 @@
* Prompt for an ftp password if none is provided.
(Vincent Ladeuil, #137044)
+ * Reuse bound branch associated transport to avoid multiple
+ connections.
+ (Vincent Ladeuil, #128076, #131396)
+
* Overwrite conflicting tags by ``push`` and ``pull`` if the
``--overwrite`` option is specified. (Lukáš Lalinský, #93947)
+ * In checkouts, tags are copied into the master branch when created,
+ changed or deleted, and are copied into the checkout when it is
+ updated. (Martin Pool, #93856, #93860)
+
IMPROVEMENTS:
* Add the option "--show-diff" to the commit command in order to display
@@ -199,10 +240,6 @@
allows the avoidance of double-sha1 calculations during commit.
(Robert Collins)
- * The ``VersionedFile`` interface now allows content checks to be bypassed
- by supplying check_content=False. This saves nearly 30% of the minimum
- cost to store a version of a file. (Robert Collins)
-
* ``Transport.should_cache`` has been removed. It was not called in the
previous release. (Martin Pool)
=== modified file 'bzr'
--- a/bzr 2007-09-03 02:51:50 +0000
+++ b/bzr 2007-09-12 01:29:21 +0000
@@ -88,7 +88,7 @@
import bzrlib.commands
import bzrlib.trace
-if bzrlib.version_info[:3] != (0, 91, 0):
+if bzrlib.version_info[:3] != (0, 92, 0):
sys.stderr.write("bzr: WARNING: bzrlib version doesn't match the bzr program.\n"
"This may indicate an installation problem.\n"
"bzrlib from %s is version %r\n"
=== modified file 'bzrlib/__init__.py'
--- a/bzrlib/__init__.py 2007-08-17 05:16:14 +0000
+++ b/bzrlib/__init__.py 2007-09-12 01:29:21 +0000
@@ -35,7 +35,7 @@
# Python version 2.0 is (2, 0, 0, 'final', 0)." Additionally we use a
# releaselevel of 'dev' for unreleased under-development code.
-version_info = (0, 91, 0, 'dev', 0)
+version_info = (0, 92, 0, 'dev', 0)
# API compatibility version: bzrlib is currently API compatible with 0.18.
api_minimum_version = (0, 18, 0)
=== modified file 'bzrlib/branch.py'
--- a/bzrlib/branch.py 2007-09-07 11:37:13 +0000
+++ b/bzrlib/branch.py 2007-09-11 01:24:09 +0000
@@ -117,13 +117,14 @@
master.break_lock()
@staticmethod
- def open(base, _unsupported=False):
+ def open(base, _unsupported=False, possible_transports=None):
"""Open the branch rooted at base.
For instance, if the branch is at URL/.bzr/branch,
Branch.open(URL) -> a Branch instance.
"""
- control = bzrdir.BzrDir.open(base, _unsupported)
+ control = bzrdir.BzrDir.open(base, _unsupported,
+ possible_transports=possible_transports)
return control.open_branch(_unsupported)
@staticmethod
@@ -320,7 +321,7 @@
return self.repository.get_commit_builder(self, parents, config,
timestamp, timezone, committer, revprops, revision_id)
- def get_master_branch(self):
+ def get_master_branch(self, possible_transports=None):
"""Return the branch we are bound to.
:return: Either a Branch, or None
@@ -1648,7 +1649,7 @@
class BzrBranch5(BzrBranch):
- """A format 5 branch. This supports new features over plan branches.
+ """A format 5 branch. This supports new features over plain branches.
It has support for a master_branch which is the data for bound branches.
"""
@@ -1697,7 +1698,7 @@
return None
@needs_read_lock
- def get_master_branch(self):
+ def get_master_branch(self, possible_transports=None):
"""Return the branch we are bound to.
:return: Either a Branch, or None
@@ -1711,7 +1712,8 @@
if not bound_loc:
return None
try:
- return Branch.open(bound_loc)
+ return Branch.open(bound_loc,
+ possible_transports=possible_transports)
except (errors.NotBranchError, errors.ConnectionError), e:
raise errors.BoundBranchConnectionFailure(
self, bound_loc, e)
@@ -1779,13 +1781,13 @@
return self.set_bound_location(None)
@needs_write_lock
- def update(self):
+ def update(self, possible_transports=None):
"""Synchronise this branch with the master branch if any.
:return: None or the last_revision that was pivoted out during the
update.
"""
- master = self.get_master_branch()
+ master = self.get_master_branch(possible_transports)
if master is not None:
old_tip = _mod_revision.ensure_null(self.last_revision())
self.pull(master, overwrite=True)
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py 2007-09-10 10:05:51 +0000
+++ b/bzrlib/builtins.py 2007-09-11 00:27:26 +0000
@@ -1016,7 +1016,9 @@
def run(self, dir='.'):
tree = WorkingTree.open_containing(dir)[0]
- master = tree.branch.get_master_branch()
+ possible_transports = []
+ master = tree.branch.get_master_branch(
+ possible_transports=possible_transports)
if master is not None:
tree.lock_write()
else:
@@ -1032,8 +1034,9 @@
revno = tree.branch.revision_id_to_revno(last_rev)
note("Tree is up to date at revision %d." % (revno,))
return 0
- conflicts = tree.update(delta._ChangeReporter(
- unversioned_filter=tree.is_ignored))
+ conflicts = tree.update(
+ delta._ChangeReporter(unversioned_filter=tree.is_ignored),
+ possible_transports=possible_transports)
revno = tree.branch.revision_id_to_revno(
_mod_revision.ensure_null(tree.last_revision()))
note('Updated to revision %d.' % (revno,))
=== modified file 'bzrlib/bzrdir.py'
--- a/bzrlib/bzrdir.py 2007-09-05 03:20:26 +0000
+++ b/bzrlib/bzrdir.py 2007-09-10 12:12:47 +0000
@@ -533,12 +533,12 @@
return BzrDir.open(base, _unsupported=True)
@staticmethod
- def open(base, _unsupported=False):
+ def open(base, _unsupported=False, possible_transports=None):
"""Open an existing bzrdir, rooted at 'base' (url)
_unsupported is a private parameter to the BzrDir class.
"""
- t = get_transport(base)
+ t = get_transport(base, possible_transports=possible_transports)
return BzrDir.open_from_transport(t, _unsupported=_unsupported)
@staticmethod
=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py 2007-09-12 04:21:51 +0000
+++ b/bzrlib/repository.py 2007-09-12 21:27:42 +0000
@@ -78,7 +78,7 @@
_file_ids_altered_regex = lazy_regex.lazy_compile(
r'file_id="(?P<file_id>[^"]+)"'
- r'.*revision="(?P<revision_id>[^"]+)"'
+ r'.* revision="(?P<revision_id>[^"]+)"'
)
def abort_write_group(self):
@@ -1646,8 +1646,13 @@
@classmethod
def _get_repo_format_to_test(self):
- """Repository format for testing with."""
- return RepositoryFormat.get_default_format()
+ """Repository format for testing with.
+
+ InterSameData can pull from subtree to subtree and from non-subtree to
+ non-subtree, so we test this with the richest repository format.
+ """
+ from bzrlib.repofmt import knitrepo
+ return knitrepo.RepositoryFormatKnit3()
@staticmethod
def is_compatible(source, target):
=== modified file 'bzrlib/tag.py'
--- a/bzrlib/tag.py 2007-09-11 00:15:56 +0000
+++ b/bzrlib/tag.py 2007-09-11 03:07:14 +0000
@@ -82,6 +82,9 @@
# all done with a write lock held, so this looks atomic
self.branch.lock_write()
try:
+ master = self.branch.get_master_branch()
+ if master is not None:
+ master.tags.set_tag(tag_name, tag_target)
td = self.get_tag_dict()
td[tag_name] = tag_target
self._set_tag_dict(td)
@@ -134,6 +137,12 @@
del d[tag_name]
except KeyError:
raise errors.NoSuchTag(tag_name)
+ master = self.branch.get_master_branch()
+ if master is not None:
+ try:
+ master.tags.delete_tag(tag_name)
+ except errors.NoSuchTag:
+ pass
self._set_tag_dict(d)
finally:
self.branch.unlock()
@@ -152,7 +161,7 @@
def _serialize_tag_dict(self, tag_dict):
td = dict((k.encode('utf-8'), v)
- for k,v in tag_dict.items())
+ for k,v in tag_dict.items())
return bencode.bencode(td)
def _deserialize_tag_dict(self, tag_content):
=== modified file 'bzrlib/tests/commands/__init__.py'
--- a/bzrlib/tests/commands/__init__.py 2007-07-15 11:17:19 +0000
+++ b/bzrlib/tests/commands/__init__.py 2007-09-10 09:13:50 +0000
@@ -35,6 +35,7 @@
'bzrlib.tests.commands.test_missing',
'bzrlib.tests.commands.test_pull',
'bzrlib.tests.commands.test_push',
+ 'bzrlib.tests.commands.test_update',
]
loader = TestLoader()
suite = loader.loadTestsFromModuleNames(testmod_names)
=== modified file 'bzrlib/tests/interrepository_implementations/test_interrepository.py'
--- a/bzrlib/tests/interrepository_implementations/test_interrepository.py 2007-07-17 16:04:00 +0000
+++ b/bzrlib/tests/interrepository_implementations/test_interrepository.py 2007-09-12 03:16:04 +0000
@@ -32,7 +32,12 @@
import bzrlib.repofmt.weaverepo as weaverepo
import bzrlib.repository as repository
from bzrlib.revision import NULL_REVISION, Revision
-from bzrlib.tests import TestCase, TestCaseWithTransport, TestSkipped
+from bzrlib.tests import (
+ TestCase,
+ TestCaseWithTransport,
+ TestNotApplicable,
+ TestSkipped,
+ )
from bzrlib.tests.bzrdir_implementations.test_bzrdir import TestCaseWithBzrDir
from bzrlib.transport import get_transport
@@ -289,18 +294,16 @@
# repository.
# 'ghost' is a ghost in missing_ghost and not in with_ghost_rev
- inv = Inventory(revision_id='ghost')
- inv.root.revision = 'ghost'
repo = self.make_repository('with_ghost_rev')
- sha1 = repo.add_inventory('ghost', inv, [])
- rev = bzrlib.revision.Revision(timestamp=0,
- timezone=None,
- committer="Foo Bar <foo at example.com>",
- message="Message",
- inventory_sha1=sha1,
- revision_id='ghost')
- rev.parent_ids = []
- repo.add_revision('ghost', rev)
+ repo.lock_write()
+ builder = repo.get_commit_builder(None, [], None,
+ committer="Foo Bar <foo at example.com>",
+ revision_id='ghost')
+ ie = bzrlib.inventory.InventoryDirectory('TREE_ROOT', '', None)
+ builder.record_entry_contents(ie, [], '', None)
+ builder.finish_inventory()
+ builder.commit("Message")
+ repo.unlock()
repo = self.make_to_repository('missing_ghost')
inv = Inventory(revision_id='with_ghost')
@@ -325,3 +328,27 @@
# rev must not be corrupt now
rev = repo.get_revision('with_ghost')
self.assertEqual([None, 'ghost', 'with_ghost'], repo.get_ancestry('with_ghost'))
+
+
+class TestFetchDependentData(TestCaseWithInterRepository):
+
+ def test_reference(self):
+ from_tree = self.make_branch_and_tree('tree')
+ to_repo = self.make_to_repository('to')
+ if (not from_tree.supports_tree_reference() or
+ not from_tree.branch.repository._format.supports_tree_reference or
+ not to_repo._format.supports_tree_reference):
+ raise TestNotApplicable("Need subtree support.")
+ subtree = self.make_branch_and_tree('tree/subtree')
+ subtree.commit('subrev 1')
+ from_tree.add_reference(subtree)
+ tree_rev = from_tree.commit('foo')
+ # now from_tree has a last-modified of subtree of the rev id of the
+ # commit for foo, and a reference revision of the rev id of the commit
+ # for subrev 1
+ to_repo.fetch(from_tree.branch.repository, tree_rev)
+ # to_repo should have a file_graph for from_tree.path2id('subtree') and
+ # revid tree_rev.
+ file_vf = to_repo.weave_store.get_weave(
+ from_tree.path2id('subtree'), to_repo.get_transaction())
+ self.assertEqual([tree_rev], file_vf.get_ancestry([tree_rev]))
=== modified file 'bzrlib/tests/test_tag.py'
--- a/bzrlib/tests/test_tag.py 2007-09-07 11:37:13 +0000
+++ b/bzrlib/tests/test_tag.py 2007-09-11 03:17:05 +0000
@@ -26,6 +26,7 @@
_merge_tags_if_possible,
)
from bzrlib.tests import (
+ KnownFailure,
TestCase,
TestCaseWithTransport,
)
@@ -98,3 +99,55 @@
conflicts = a.tags.merge_to(b.tags, overwrite=True)
self.assertEqual(conflicts, [])
self.assertEqual('z', b.tags.lookup_tag('tag-2'))
+
+
+class TestTagsInCheckouts(TestCaseWithTransport):
+
+ def test_update_tag_into_checkout(self):
+ # checkouts are directly connected to the tags of their master branch:
+ # adding a tag in the checkout pushes it to the master
+ # https://bugs.launchpad.net/bzr/+bug/93860
+ master = self.make_branch('master')
+ child = self.make_branch('child')
+ child.bind(master)
+ child.tags.set_tag('foo', 'rev-1')
+ self.assertEquals('rev-1', master.tags.lookup_tag('foo'))
+ # deleting a tag updates the master too
+ child.tags.delete_tag('foo')
+ self.assertRaises(errors.NoSuchTag,
+ master.tags.lookup_tag, 'foo')
+
+ def test_tag_copied_by_initial_checkout(self):
+ # https://bugs.launchpad.net/bzr/+bug/93860
+ master = self.make_branch('master')
+ master.tags.set_tag('foo', 'rev-1')
+ co_tree = master.create_checkout('checkout')
+ self.assertEquals('rev-1',
+ co_tree.branch.tags.lookup_tag('foo'))
+
+ def test_update_updates_tags(self):
+ # https://bugs.launchpad.net/bzr/+bug/93856
+ master = self.make_branch('master')
+ master.tags.set_tag('foo', 'rev-1')
+ child = self.make_branch('child')
+ child.bind(master)
+ child.update()
+ # after an update, the child has all the master's tags
+ self.assertEquals('rev-1', child.tags.lookup_tag('foo'))
+ # add another tag and update again
+ master.tags.set_tag('tag2', 'target2')
+ child.update()
+ self.assertEquals('target2', child.tags.lookup_tag('tag2'))
+
+ def test_tag_deletion_from_master_to_bound(self):
+ master = self.make_branch('master')
+ master.tags.set_tag('foo', 'rev-1')
+ child = self.make_branch('child')
+ child.bind(master)
+ child.update()
+ # and deletion of tags should also propagate
+ master.tags.delete_tag('foo')
+ raise KnownFailure("tag deletion does not propagate: "
+ "https://bugs.launchpad.net/bzr/+bug/138802")
+ self.assertRaises(errors.NoSuchTag,
+ child.tags.lookup_tag, 'foo')
=== modified file 'bzrlib/workingtree.py'
--- a/bzrlib/workingtree.py 2007-09-05 03:20:26 +0000
+++ b/bzrlib/workingtree.py 2007-09-10 12:12:47 +0000
@@ -2022,7 +2022,7 @@
"""
raise NotImplementedError(self.unlock)
- def update(self, change_reporter=None):
+ def update(self, change_reporter=None, possible_transports=None):
"""Update a working tree along its branch.
This will update the branch if its bound too, which means we have
@@ -2047,7 +2047,7 @@
basis.
- Do a 'normal' merge of the old branch basis if it is relevant.
"""
- if self.branch.get_master_branch() is not None:
+ if self.branch.get_master_branch(possible_transports) is not None:
self.lock_write()
update_branch = True
else:
@@ -2055,7 +2055,7 @@
update_branch = False
try:
if update_branch:
- old_tip = self.branch.update()
+ old_tip = self.branch.update(possible_transports)
else:
old_tip = None
return self._update_tree(old_tip, change_reporter)
More information about the bazaar-commits
mailing list