[merge] make "push" to an empty location push tags
Marien Zwart
marienz at gentoo.org
Tue Mar 13 01:06:18 GMT 2007
Hi,
The attached bundle makes "push" to an empty location push over tags.
This already worked for a location with an existing tree.
I'm pretty sure the blackbox test is accurate. I'm not entirely
certain the place where I inserted the tag copying is correct. I put
it in Branch.copy_content_into, which is called from clone and sprout.
The path where it is called through sprout is currently untested: the
blackbox test calls clone.
Is this ok as-is, or should I grow a test for sprout too (if yes:
pointers on how/where to add this greatly appreciated) or should I
move the tags call into clone?
--
Marien.
-------------- next part --------------
# Bazaar revision bundle v0.9
#
# message:
# Properly push tags if push creates a new branch.
# committer: Marien Zwart <marienz at gentoo.org>
# date: Tue 2007-03-13 02:00:34.497999907 +0100
=== modified file bzrlib/branch.py
--- bzrlib/branch.py
+++ bzrlib/branch.py
@@ -648,6 +648,7 @@
else:
if parent:
destination.set_parent(parent)
+ self.tags.merge_to(destination.tags)
@needs_read_lock
def check(self):
=== modified file bzrlib/tests/blackbox/test_tags.py
--- bzrlib/tests/blackbox/test_tags.py
+++ bzrlib/tests/blackbox/test_tags.py
@@ -99,6 +99,10 @@
b1.tags.set_tag('tag4', 'second-revid')
self.run_bzr('merge', '-d', 'branch2', 'branch1')
self.assertEquals(b2.tags.lookup_tag('tag4'), 'second-revid')
+ # pushing to a new location copies the tag across
+ self.run_bzr('push', '-d', 'branch1', 'branch3')
+ b3 = Branch.open('branch3')
+ self.assertEquals(b3.tags.lookup_tag('tag1'), 'first-revid')
def test_list_tags(self):
t = self.make_branch_and_tree('branch1')
=== modified directory // last-changed:marienz at gentoo.org-20070313010034-1m84w
... jf97jscdkdg
# revision id: marienz at gentoo.org-20070313010034-1m84wjf97jscdkdg
# sha1: b5cba7b0e0fb6a88a9c37a4c69667e4882ed1c40
# inventory sha1: 53aa84182e65413dec5d590972aaf115e6d779f7
# parent ids:
# pqm at pqm.ubuntu.com-20070312222222-41194ff2fd4e23fe
# base id: pqm at pqm.ubuntu.com-20070312222222-41194ff2fd4e23fe
# properties:
# branch-nick: push-tags
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070313/4f323a2c/attachment.pgp
More information about the bazaar
mailing list