changeset 458:974102998578

rebuildmeta: remove any existing tagmap file.
author Augie Fackler <durin42@gmail.com>
date Sun, 05 Jul 2009 21:44:35 -0500
parents 8ad6dfd51f72
children 7151f63ab33c
files hgsubversion/maps.py hgsubversion/svncommands.py
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/maps.py
+++ b/hgsubversion/maps.py
@@ -101,9 +101,13 @@ class TagMap(dict):
 
     VERSION = 2
 
+    @classmethod
+    def filepath(cls, repo):
+        return os.path.join(repo.path, 'svn', 'tagmap')
+
     def __init__(self, repo, endrev=None):
         dict.__init__(self)
-        self.path = os.path.join(repo.path, 'svn', 'tagmap')
+        self.path = self.filepath(repo)
         self.seen = 0
         self.endrev=endrev
         if os.path.isfile(self.path):
--- a/hgsubversion/svncommands.py
+++ b/hgsubversion/svncommands.py
@@ -87,6 +87,9 @@ def rebuildmeta(ui, repo, hg_repo_path, 
     last_rev = -1
     branchinfo = {}
     noderevnums = {}
+    tagfile = os.path.join(svnmetadir, 'tagmap')
+    if os.path.exists(maps.TagMap.filepath(repo)):
+        os.unlink(maps.TagMap.filepath(repo))
     tags = maps.TagMap(repo)
 
     skipped = set()