Modify ↓
Opened 8 years ago
Closed 8 years ago
#12946 closed defect (fixed)
Suggestion from Subversion repository should be sorted
Reported by: | Jun Omae | Owned by: | Peter Suter |
---|---|---|---|
Priority: | normal | Component: | WikiAutoCompletePlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 1.0 |
Description
Suggestion from Subversion repository is not sorted. We should sort the suggestion.
Also, slash characters between repository name and path are inserted twice.
-
wikiautocomplete/web_ui.py
diff --git a/wikiautocomplete/web_ui.py b/wikiautocomplete/web_ui.py index 0b9fb29..7a864a9 100644
a b class WikiAutoCompleteModule(Component): 248 248 completions.append('%s%s@%s' % (reponame, path, rev)) 249 249 else: 250 250 dir, filename = path.rsplit('/', 1) 251 if dir == '': 252 dir = '/' 253 node = repos.get_node(dir, repos.youngest_rev) 254 completions = ['%s/%s%s' % (reponame, n.path, '/' if n.isdir else '') 255 for n in node.get_entries() 256 if n.can_view(req.perm) and n.name.startswith(filename)] 251 node = repos.get_node(dir or '/', repos.youngest_rev) 252 completions = sorted( 253 '%s/%s%s' % (reponame, n.path.lstrip('/'), '/' if n.isdir else '') 254 for n in node.get_entries() 255 if n.name.startswith(filename) and n.can_view(req.perm)) 257 256 return completions 258 257 259 258 def _suggest_milestone(self, req, term):
Attachments (1)
Change History (3)
Changed 8 years ago by
Attachment: | unsorted-suggestion-from-svnrepos.png added |
---|
comment:1 Changed 8 years ago by
Note: See
TracTickets for help on using
tickets.
Sounds good.