Rev 2248: Integrate tags with Branch6: in http://sourcefrog.net/bzr/tags

Martin Pool mbp at sourcefrog.net
Thu Feb 22 03:04:54 GMT 2007


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

------------------------------------------------------------
revno: 2248
revision-id: mbp at sourcefrog.net-20070222030454-qbli35zu25vq59q2
parent: mbp at sourcefrog.net-20070221073559-lhmy548t6172pd5e
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: tags
timestamp: Thu 2007-02-22 14:04:54 +1100
message:
  Integrate tags with Branch6:
  
  Make a tags file when initializing a branch; warn if it's not there in case
  someone has a branch using an unreleased version of this code.
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 07:35:59 +0000
+++ b/bzrlib/branch.py	2007-02-22 03:04:54 +0000
@@ -1015,7 +1015,8 @@
         """Create a branch of this format in a_bzrdir."""
         utf8_files = [('last-revision', '0 null:\n'),
                       ('branch-name', ''),
-                      ('branch.conf', '')
+                      ('branch.conf', ''),
+                      ('tags', ''),
                       ]
         return self._initialize_helper(a_bzrdir, utf8_files)
 

=== modified file 'bzrlib/tag.py'
--- a/bzrlib/tag.py	2007-02-21 07:35:59 +0000
+++ b/bzrlib/tag.py	2007-02-22 03:04:54 +0000
@@ -26,6 +26,8 @@
 # called tags* are ctags files... mbp 20070220.
 
 
+from warnings import warn
+
 from bzrlib import (
     errors,
     trace,
@@ -34,6 +36,7 @@
 
 
 class _Tags(object):
+
     def __init__(self, branch):
         self.branch = branch
 
@@ -92,9 +95,11 @@
             try:
                 tag_content = self.branch._transport.get_bytes('tags')
             except errors.NoSuchFile, e:
-                trace.warning('Missing tags file in %s.  '
+                # ugly, but only abentley should see this :)
+                trace.warning('No branch/tags file in %s.  '
                      'This branch was probably created by bzr 0.15pre.  '
-                     'Please create an empty branch/tags file.')
+                     'Create an empty file to silence this message.'
+                     % (self.branch, ))
                 return {}
             return self._deserialize_tag_dict(tag_content)
         finally:
@@ -133,7 +138,7 @@
 
     def _deserialize_tag_dict(self, tag_content):
         """Convert the tag file into a dictionary of tags"""
-        # as a special case to make initialization easy, an empty definition
+        # was a special case to make initialization easy, an empty definition
         # is an empty dictionary
         if tag_content == '':
             return {}




More information about the bazaar-commits mailing list