Modify ↓
Opened 8 years ago
Closed 8 years ago
#12927 closed enhancement (fixed)
Suggest shortrev instead of full hash.
Reported by: | Peter Suter | Owned by: | Peter Suter |
---|---|---|---|
Priority: | normal | Component: | WikiAutoCompletePlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: |
Description
Suggesting the shortrev is more convenient.
Also suggest it for log:reponame@
.
-
wikiautocomplete/web_ui.py
diff -r d34b18bfc55a -r fb04791b695e wikiautocomplete/web_ui.py
a b 127 127 elif strategy == 'source': 128 128 rm = RepositoryManager(self.env) 129 129 completions = [] 130 if term.find('/') == -1 :130 if term.find('/') == -1 and term.find('@') == -1: 131 131 for reponame, repoinfo in rm.get_all_repositories().iteritems(): 132 132 if 'BROWSER_VIEW' in req.perm(Resource('repository', reponame)): 133 133 if len(term) == 0 or reponame.lower().startswith(term.lower()): 134 134 completions.append(reponame+'/') 135 135 else: 136 reponame, path = term.split('/', 1) 136 pos = term.find('/') 137 if pos == -1: 138 pos = term.find('@') 139 reponame, path = term[:pos], term[pos:] 137 140 repos = rm.get_repository(reponame) 138 141 if repos is not None: 139 142 if path.find('@') != -1: … … 141 144 node = repos.get_node(path, repos.youngest_rev) 142 145 if node.can_view(req.perm): 143 146 for r in node.get_history(10): 144 if str(r[1]).startswith(search_rev): 145 completions.append('%s/%s@%s' % (reponame, path, r[1])) 147 rev = repos.short_rev(r[1]) 148 if str(rev).startswith(search_rev): 149 completions.append('%s%s@%s' % (reponame, path, rev)) 146 150 else: 147 if path.find('/') != -1: 148 dir, filename = path.rsplit('/', 1) 149 else: 150 dir, filename = '/', path 151 dir, filename = path.rsplit('/', 1) 152 if dir == '': 153 dir = '/' 151 154 node = repos.get_node(dir, repos.youngest_rev) 152 155 completions = ['%s/%s%s' % (reponame, n.path, '/' if n.isdir else '') 153 156 for n in node.get_entries()
Attachments (0)
Change History (2)
comment:1 Changed 8 years ago by
comment:2 Changed 8 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
In 15954: