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): 
    248248                            completions.append('%s%s@%s' % (reponame, path, rev))
    249249                else:
    250250                    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))
    257256        return completions
    258257
    259258    def _suggest_milestone(self, req, term):

Attachments (1)

unsorted-suggestion-from-svnrepos.png (17.5 KB) - added by Jun Omae 8 years ago.

Download all attachments as: .zip

Change History (3)

Changed 8 years ago by Jun Omae

comment:1 Changed 8 years ago by Peter Suter

Sounds good.

comment:2 Changed 8 years ago by Jun Omae

Resolution: fixed
Status: newclosed

In 15958:

WikiAutoCompletePlugin: sort suggestion for source: link (closes #12946)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Peter Suter.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.