Edgewall Software
Modify

Opened 19 months ago

Last modified 13 months ago

#12177 new defect

Quickjump should list all bookmarks, not only those of current revision

Reported by: Jun Omae Owned by:
Priority: normal Milestone: plugin - mercurial
Component: plugin/mercurial Version:
Severity: normal Keywords:
Cc:
Release Notes:
API 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

Attachments (0)

Change History (0)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned. Next status will be 'new'.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.