diff hgsubversion/svnmeta.py @ 521:839734dfb5c7

Handle tag subdirectory as tag in replay mode (issue119) Original version by Dirkjan Ochtman <dirkjan@ochtman.nl>
author Patrick Mezard <pmezard@gmail.com>
date Fri, 22 Jan 2010 18:01:19 -0600
parents 5a5b90a6d522
children 7b330c576920
line wrap: on
line diff
--- a/hgsubversion/svnmeta.py
+++ b/hgsubversion/svnmeta.py
@@ -262,10 +262,13 @@ class SVNMeta(object):
             return (path, None, '')
         tag = self.get_path_tag(path)
         if tag:
-            matched = [t for t in self.tags.iterkeys() if tag.startswith(t+'/')]
+            # consider the new tags when dispatching entries
+            matched = []
+            for tags in (self.tags, self.addedtags):
+                matched += [t for t in tags if tag.startswith(t + '/')]
             if not matched:
                 return None, None, None
-            matched.sort(cmp=lambda x,y: cmp(len(x),len(y)), reverse=True)
+            matched.sort(key=len, reverse=True)
             brpath = tag[len(matched[0])+1:]
             svrpath = path[:-(len(brpath)+1)]
             ln = self.localname(svrpath)