~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-05-29 10:34:34 UTC
  • mfrom: (4390.2.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090529103434-04tivhvlg6aohfkj
(igc) make tags faster when on the mainline

Show diffs side-by-side

added added

removed removed

Lines of Context:
5053
5053
            tags.sort(key=lambda x: timestamps[x[1]])
5054
5054
        if not show_ids:
5055
5055
            # [ (tag, revid), ... ] -> [ (tag, dotted_revno), ... ]
5056
 
            revno_map = branch.get_revision_id_to_revno_map()
5057
 
            tags = [ (tag, '.'.join(map(str, revno_map.get(revid, ('?',)))))
5058
 
                        for tag, revid in tags ]
 
5056
            for index, (tag, revid) in enumerate(tags):
 
5057
                try:
 
5058
                    revno = branch.revision_id_to_dotted_revno(revid)
 
5059
                    if isinstance(revno, tuple):
 
5060
                        revno = '.'.join(map(str, revno))
 
5061
                except errors.NoSuchRevision:
 
5062
                    # Bad tag data/merges can lead to tagged revisions
 
5063
                    # which are not in this branch. Fail gracefully ...
 
5064
                    revno = '?'
 
5065
                tags[index] = (tag, revno)
5059
5066
        for tag, revspec in tags:
5060
5067
            self.outf.write('%-20s %s\n' % (tag, revspec))
5061
5068