Rev 2247: Start adding tags to Branch6 in http://sourcefrog.net/bzr/tags

Martin Pool mbp at sourcefrog.net
Wed Feb 21 07:35:59 GMT 2007


At http://sourcefrog.net/bzr/tags

------------------------------------------------------------
revno: 2247
revision-id: mbp at sourcefrog.net-20070221073559-lhmy548t6172pd5e
parent: mbp at sourcefrog.net-20070221053456-vyr6o0ehqnbetrvb
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: tags
timestamp: Wed 2007-02-21 18:35:59 +1100
message:
  Start adding tags to Branch6
modified:
  bzrlib/branch.py               branch.py-20050309040759-e4baf4e0d046576e
  bzrlib/tag.py                  tag.py-20070212110532-91cw79inah2cfozx-1
=== modified file 'bzrlib/branch.py'
--- a/bzrlib/branch.py	2007-02-21 05:34:56 +0000
+++ b/bzrlib/branch.py	2007-02-21 07:35:59 +0000
@@ -1036,6 +1036,9 @@
                           a_bzrdir=a_bzrdir,
                           _repository=a_bzrdir.find_repository())
 
+    def supports_tags(self):
+        return True
+
 
 class BranchReferenceFormat(BranchFormat):
     """Bzr branch reference format.
@@ -2010,6 +2013,9 @@
             revno = self.revision_id_to_revno(revision_id)
         destination.set_last_revision_info(revno, revision_id)
 
+    def _make_tags(self):
+        return BasicTags(self)
+
 
 class BranchTestProviderAdapter(object):
     """A tool to generate a suite testing multiple branch formats at once.

=== modified file 'bzrlib/tag.py'
--- a/bzrlib/tag.py	2007-02-21 04:08:27 +0000
+++ b/bzrlib/tag.py	2007-02-21 07:35:59 +0000
@@ -28,6 +28,7 @@
 
 from bzrlib import (
     errors,
+    trace,
     )
 from bzrlib.util import bencode
 
@@ -88,7 +89,13 @@
     def get_tag_dict(self):
         self.branch.lock_read()
         try:
-            tag_content = self.branch._transport.get_bytes('tags')
+            try:
+                tag_content = self.branch._transport.get_bytes('tags')
+            except errors.NoSuchFile, e:
+                trace.warning('Missing tags file in %s.  '
+                     'This branch was probably created by bzr 0.15pre.  '
+                     'Please create an empty branch/tags file.')
+                return {}
             return self._deserialize_tag_dict(tag_content)
         finally:
             self.branch.unlock()




More information about the bazaar-commits mailing list