Modify ↓
#12928 closed enhancement (fixed)
Suggest Mercurial bookmarks
Reported by: | Peter Suter | Owned by: | Peter Suter |
---|---|---|---|
Priority: | normal | Component: | WikiAutoCompletePlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: |
Description
-
wikiautocomplete/web_ui.py
diff -r fb04791b695e -r 8006a52d8581 wikiautocomplete/web_ui.py
a b 147 147 rev = repos.short_rev(r[1]) 148 148 if str(rev).startswith(search_rev): 149 149 completions.append('%s%s@%s' % (reponame, path, rev)) 150 151 if type(repos).__name__ == 'MercurialRepository': 152 from mercurial.bookmarks import listbookmarks 153 for rev in listbookmarks(repos.repo): 154 if str(rev).startswith(search_rev): 155 completions.append('%s%s@%s' % (reponame, path, rev)) 156 150 157 else: 151 158 dir, filename = path.rsplit('/', 1) 152 159 if dir == '':
Attachments (0)
Change History (7)
comment:1 Changed 8 years ago by
Component: | SELECT A HACK → WikiAutoCompletePlugin |
---|---|
Owner: | set to Peter Suter |
comment:2 follow-up: 3 Changed 8 years ago by
comment:3 Changed 8 years ago by
Also, I use
-
character in repository name. In this case, completion doesn't work.
Fixed in #12938, thanks!
comment:4 Changed 8 years ago by
Replying to jun66j5:
We could use
repos.get_quickjump_entries()
for branches, tags and bookmarks in Git and Mercurial.
Sounds nice. The entry names are a bit fragile:
- Categories are translated in Mercurial (but not in Git or SVN).
- Mercurial tags are joined so
name == "FirstTag, SecondTag"
. (If one revision has multiple tags.)
Also there can be a lot of unimportant entries (e.g. due to old tags). I think the current revision number is much more useful. So maybe only suggest the names if at least one character is given? (Not a great solution.)
comment:7 Changed 8 years ago by
Somehow not all Mercurial bookmarks are shown.
Maybe because of t:ticket:12177?
Note: See
TracTickets for help on using
tickets.
We could use
repos.get_quickjump_entries()
for branches, tags and bookmarks in Git and Mercurial.wikiautocomplete/web_ui.py
Also, I use
-
character in repository name. In this case, completion doesn't work.wikiautocomplete/htdocs/js/wikiautocomplete.js
\w/.]*(?:@\w*)?)$/,