changeset 2295:b12a05722ced

Entries in index are now unique.
author Ashutosh Singla <ashu1461@gmail.com>
date Mon, 23 Sep 2013 19:30:14 +0530
parents e615e3bbe48d
children 500d5d4b514a
files MoinMoin/items/__init__.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/items/__init__.py	Mon Sep 23 19:29:32 2013 +0530
+++ b/MoinMoin/items/__init__.py	Mon Sep 23 19:30:14 2013 +0530
@@ -637,7 +637,7 @@
         files = []
         # IndexEntry instances of "directory" subitems
         dirs = []
-        added_fullnames = set()
+        added_dir_relnames = set()
         for rev in subitems:
             fullnames = rev.meta[NAME]
             for fullname in fullnames:
@@ -651,8 +651,9 @@
                         # 'foo', and current item (`rev`) is 'foo/bar/lorem/ipsum',
                         # 'foo/bar' will be found.
                         direct_relname = relname.partition('/')[0]
-                        if fullname_fqname not in added_fullnames:
-                            added_fullnames.add(fullname_fqname)
+                        direct_relname_fqname = CompositeName(rev.meta[NAMESPACE], NAME_EXACT, direct_relname)
+                        if direct_relname_fqname not in added_dir_relnames:
+                            added_dir_relnames.add(direct_relname_fqname)
                             direct_fullname = prefix + direct_relname
                             direct_fullname_fqname = CompositeName(rev.meta[NAMESPACE], NAME_EXACT, direct_fullname)
                             fqname = CompositeName(rev.meta[NAMESPACE], NAME_EXACT, direct_fullname)