[bug 93853][merge] Better message about inability to place tags in empty branch

Martin Pool mbp at sourcefrog.net
Mon Jul 30 16:49:36 BST 2007


I intend to fix this properly, but would like to merge Tim's patch
below as a stopgap.  In merging it I'd add a comment with the bug
number.

---------- Forwarded message ----------
From: Tim Hatch <tim at timhatch.com>
Date: Jul 27, 2007 5:28 PM
Subject: [Bug 93853] Re: Tag command breaks badly with empty repository
To: mbp at sourcefrog.net


I also agree with John, having just hit this.  Something along the lines
of:

=== modified file 'bzrlib/builtins.py'
--- bzrlib/builtins.py  2007-07-23 19:37:15 +0000
+++ bzrlib/builtins.py  2007-07-27 22:24:01 +0000
@@ -3847,6 +3847,10 @@
                     revision_id = revision[0].in_history(branch).rev_id
                 else:
                     revision_id = branch.last_revision()
+                if not revision_id:
+                    raise errors.BzrCommandError(
+                            "Tags can not be placed on an empty branch, "
+                            "try making a commit first")
                 if (not force) and branch.tags.has_tag(tag_name):
                     raise errors.TagAlreadyExists(tag_name)
                 branch.tags.set_tag(tag_name, revision_id)

--
Tag command breaks badly with empty repository
https://bugs.launchpad.net/bugs/93853
You received this bug notification because you are a member of Bazaar
Developers, which is the registrant for Bazaar.



-- 
Martin



More information about the bazaar mailing list