Edgewall Software
Modify

Opened 9 years ago

Closed 6 years ago

#12177 closed defect (fixed)

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: Branch:
Release Notes:

Show all bookmarks.

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

Attachments (0)

Change History (1)

comment:1 by Peter Suter, 6 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: newclosed

Pushed with test in [55/mercurial-plugin].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.