# HG changeset patch # User Augie Fackler # Date 1223666346 18000 # Node ID 9c481cae0428b3554c17733daabea6c2d97b9967 # Parent b66ed66c82e417f0bd32e0c1d6d7aae2c6bbea6f 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. diff --git a/svncommand.py b/svncommand.py --- 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): diff --git a/tests/test_tags.py b/tests/test_tags.py --- 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)