Rev 2243: doc in http://sourcefrog.net/bzr/tags

Martin Pool mbp at sourcefrog.net
Wed Feb 21 04:54:20 GMT 2007


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

------------------------------------------------------------
revno: 2243
revision-id: mbp at sourcefrog.net-20070221045419-664wi52usb58bf5p
parent: mbp at sourcefrog.net-20070221044547-0a55m0h9euy2q43l
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: tags
timestamp: Wed 2007-02-21 15:54:19 +1100
message:
  doc
modified:
  bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
  bzrlib/errors.py               errors.py-20050309040759-20512168c4e14fbd
  bzrlib/tests/blackbox/test_tags.py test_tags.py-20070116132048-5h4qak2cm22jlb9e-1
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2007-02-21 04:08:27 +0000
+++ b/bzrlib/builtins.py	2007-02-21 04:54:19 +0000
@@ -3203,6 +3203,20 @@
             self.outf.write('created tag %s' % tag_name)
 
 
+class cmd_tags(Command):
+    """List tags.
+
+    This tag shows a table of tag names and the revisions they reference.
+    """
+
+    @display_command
+    def run(self):
+        directory = '.'
+        branch, relpath = Branch.open_containing(directory)
+        for tag_name, target in branch.tags.get_tag_dict().sorted():
+            self.outf.write('%-40s %s' % (tag_name, target))
+
+
 # command-line interpretation helper for merge-related commands
 def _merge_helper(other_revision, base_revision,
                   check_clean=True, ignore_zero=False,

=== modified file 'bzrlib/errors.py'
--- a/bzrlib/errors.py	2007-02-21 04:08:27 +0000
+++ b/bzrlib/errors.py	2007-02-21 04:54:19 +0000
@@ -1761,4 +1761,4 @@
     _fmt = "Tags not supported by %(branch)s; you may be able to use bzr upgrade."
 
     def __init__(self, branch):
-        self.repository = branch
+        self.branch = branch

=== modified file 'bzrlib/tests/blackbox/test_tags.py'
--- a/bzrlib/tests/blackbox/test_tags.py	2007-02-21 04:08:27 +0000
+++ b/bzrlib/tests/blackbox/test_tags.py	2007-02-21 04:54:19 +0000
@@ -93,3 +93,12 @@
         b1.tags.set_tag('tag4', 'second-revid')
         self.run_bzr('merge', '-d', 'branch2', 'branch1')
         self.assertEquals(b2.tags.lookup_tag('tag4'), 'second-revid')
+
+    def test_list_tags(self):
+        t = self.make_branch_and_tree('branch1')
+        b1 = t.branch
+        tagname = u'\u30d0zaar'
+        b1.tags.set_tag(tagname, 'revid-1')
+        out, err = self.run_bzr('tags', '-d', 'branch1')
+        self.assertEquals(err, '')
+




More information about the bazaar-commits mailing list