changeset 28:9c481cae0428

Change the format of generated tags so they are tag/$tag instead of tag:$tag so that you can use them as revision args in diff.
author Augie Fackler <durin42@gmail.com>
date Fri, 10 Oct 2008 14:19:06 -0500 (2008-10-10)
parents b66ed66c82e4
children 575bd29bc1d8
files svncommand.py tests/test_tags.py
diffstat 2 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/svncommand.py
+++ b/svncommand.py
@@ -62,7 +62,7 @@ def generate_hg_tags(ui, hg_repo_path, *
     f = open(os.path.join(hg_repo_path, '.hg', 'localtags'), 'w')
     for tag, source in tag_info.iteritems():
         source_ha = hg_editor.get_parent_revision(source[1]+1, source[0])
-        f.write('%s tag:%s\n' % (node.hex(source_ha), tag))
+        f.write('%s tag/%s\n' % (node.hex(source_ha), tag))
 
 @register_subcommand('up')
 def update(ui, args, repo, clean=False, **opts):
--- a/tests/test_tags.py
+++ b/tests/test_tags.py
@@ -39,8 +39,8 @@ class TestTags(unittest.TestCase):
         self._test_tag_revision_info(repo)
         svncommand.generate_hg_tags(ui.ui(), self.wc_path)
         repo = hg.repository(ui.ui(), self.wc_path)
-        self.assertEqual(repo['tip'].node(), repo['tag:tag_r3'].node())
-        self.assertEqual(repo['tip'].node(), repo['tag:copied_tag'].node())
+        self.assertEqual(repo['tip'].node(), repo['tag/tag_r3'].node())
+        self.assertEqual(repo['tip'].node(), repo['tag/copied_tag'].node())
     
     def test_tags_stupid(self):
         self.test_tags(stupid=True)
@@ -51,8 +51,8 @@ class TestTags(unittest.TestCase):
         self._test_tag_revision_info(repo)
         svncommand.generate_hg_tags(ui.ui(), self.wc_path)
         repo = hg.repository(ui.ui(), self.wc_path)
-        self.assertEqual(repo['tip'].node(), repo['tag:tag_r3'].node())
-        self.assert_('tag:copied_tag' not in repo.tags())
+        self.assertEqual(repo['tip'].node(), repo['tag/tag_r3'].node())
+        self.assert_('tag/copied_tag' not in repo.tags())
     
     def test_remove_tag_stupid(self):
         self.test_remove_tag(stupid=True)
@@ -63,9 +63,9 @@ class TestTags(unittest.TestCase):
         self._test_tag_revision_info(repo)
         svncommand.generate_hg_tags(ui.ui(), self.wc_path)
         repo = hg.repository(ui.ui(), self.wc_path)
-        self.assertEqual(repo['tip'].node(), repo['tag:tag_r3'].node())
-        self.assertEqual(repo['tip'].node(), repo['tag:other_tag_r3'].node())
-        self.assert_('tag:copied_tag' not in repo.tags())
+        self.assertEqual(repo['tip'].node(), repo['tag/tag_r3'].node())
+        self.assertEqual(repo['tip'].node(), repo['tag/other_tag_r3'].node())
+        self.assert_('tag/copied_tag' not in repo.tags())
     
     def test_rename_tag_stupid(self):
         self.test_rename_tag(stupid=True)
@@ -76,9 +76,9 @@ class TestTags(unittest.TestCase):
         svncommand.generate_hg_tags(ui.ui(), self.wc_path)
         repo = hg.repository(ui.ui(), self.wc_path)
         self.assertEqual(repo['tip'].node(), repo['branch_from_tag'].node())
-        self.assertEqual(repo[1].node(), repo['tag:tag_r3'].node())
+        self.assertEqual(repo[1].node(), repo['tag/tag_r3'].node())
         self.assertEqual(repo['branch_from_tag'].parents()[0].node(), 
-                         repo['tag:copied_tag'].node())
+                         repo['tag/copied_tag'].node())
     
     def test_branch_from_tag_stupid(self):
         self.test_branch_from_tag(stupid=True)