Handle moved files correctly
authorChristoph Trassl <christoph@trassl.net>
Thu, 13 May 2010 22:51:24 +0000 (00:51 +0200)
committerGiel van Schijndel <me@mortis.eu>
Sun, 27 Jun 2010 14:21:25 +0000 (16:21 +0200)
Moved files ('svn mv') where not handled properly.  The move target
would be correctly added to the taglist, the move source, however,
wouldn't be removed from the taglist.

Signed-off-by: Christoph Trassl <christoph@trassl.net>
Signed-off-by: Giel van Schijndel <me@mortis.eu>

codetags/indexer.py

index cc56c1d..35cdcd2 100644 (file)
@@ -7,7 +7,7 @@ import re
 import posixpath
 import cPickle as pickle
 from fnmatch import fnmatch
-from trac.versioncontrol.api import Node
+from trac.versioncontrol.api import Changeset, Node
 from trac.util.text import to_unicode
 
 try:
@@ -157,7 +157,8 @@ class TagIndexer(object):
                 folder = posixpath.dirname(path)
                 if not self.is_path_valid(folder):
                     continue
-
+                if change == Changeset.MOVE:
+                    changes.add(base_path)
                 for rule in self.scan_files:
                     if fnmatch(path, rule):
                         changes.add(path)