Edgewall Software

Opened 9 years ago

Last modified 6 years ago

#12177 closed defect

Quickjump should list all bookmarks, not only those of current revision — at Initial Version

Reported by: Jun Omae Owned by:
Priority: normal Milestone: plugin - mercurial
Component: plugin/mercurial Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

After #10527 and #11995, MercurialRepository.get_quickjump_entries(rev) lists only bookmarks for current revision. The method should list all bookmarks regardless of value of rev argument.

Suggestion from comment:5:ticket:11431.

  • tracext/hg/backend.py

    diff -r 7be798c48b82 tracext/hg/backend.py
    a b  
    114114    else:
    115115        from mercurial.scmutil import match
    116116
    117     has_bookmarks = None
     117    try:
     118        from mercurial.bookmarks import listbookmarks
     119    except ImportError:
     120        try:
     121            from hgext.bookmarks import listbookmarks
     122        except ImportError:
     123            listbookmarks = None
     124    has_bookmarks = bool(listbookmarks)
    118125    has_phasestr = None
    119126
    120127except ImportError, e:
     
    152159        return s
    153160
    154161def get_bookmarks(ctx):
    155     global has_bookmarks
    156162    if has_bookmarks:
    157163        return ctx.bookmarks()
    158     if has_bookmarks is None:
    159         has_bookmarks = hasattr(ctx, 'bookmarks')
    160         if has_bookmarks:
    161             return get_bookmarks(ctx)
    162     return ()
     164    else:
     165        return ()
     166
     167def get_repo_bookmarks(repo):
     168    if has_bookmarks:
     169        return listbookmarks(repo)
     170    else:
     171        return ()
    163172
    164173def get_phasestr(ctx):
    165174    global has_phasestr
     
    689698                yield ((name or nodestr) + taginfo(ctx), '/', nodestr)
    690699        # bookmarks
    691700        bookmarks = [(self.changectx(b), b)
    692                      for b in get_bookmarks(self.changectx(rev))]
     701                     for b in get_repo_bookmarks(self.repo)]
    693702        for e in quickjump_entries(bookmarks):
    694703            yield _("Bookmarks"), e[0], e[1], e[2]
    695704        # branches

Change History (0)

Note: See TracTickets for help on using tickets.