~buaabyl/trac-bzr/BzrTagListMacro

« back to all changes in this revision

Viewing changes to bzrtaglist.py

  • Committer: swordfish
  • Date: 2010-12-22 03:04:50 UTC
  • Revision ID: buaa.byl@windows.com-20101222030450-33vj493gkqaxldcl
fixed:dotted revid may crash

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
            #sorted tags with revno, and save all tag name into list
59
59
            tagrevno_dict = {}
60
60
            for tagname in tagrevision_dict:
61
 
                revno = branch.revision_id_to_revno(tagrevision_dict[tagname])
 
61
                revno = branch.revision_id_to_dotted_revno(tagrevision_dict[tagname])
62
62
                if revno in tagrevno_dict:
63
63
                    tagrevno_dict[revno] = tagrevno_dict[revno] + [tagname]
64
64
                else:
74
74
            #this simple thing need template system.
75
75
            s = '<ul>'
76
76
            for revno in sorted(tagrevno_dict):
 
77
                if len(revno) == 1:
 
78
                    revno_str = "%d" % revno[0]
 
79
                elif len(revno) == 2:
 
80
                    revno_str = "%d.%d" % (revno[0], revno[1])
 
81
                elif len(revno) == 3:
 
82
                    revno_str = "%d.%d.%d" % (revno[0], revno[1], revno[2])
 
83
                else:
 
84
                    revno_str = ''
77
85
                tagname_list = tagrevno_dict[revno]
78
86
                for tagname in sorted(tagname_list):
79
87
                    s = s + "<li>Changeset " + \
80
 
                        "<a href=\"%s?rev=%d\">[%d]</a> " % (browser_url,revno, revno) + \
 
88
                        "<a href=\"%s?rev=%s\">[%s]</a> " % (browser_url,revno_str, revno_str) + \
81
89
                        "<em>tag:</em>" + "%s</li>" % tagname
82
90
            s = s + '</ul>'
83
91
        else:
84
92
            s = ''
85
93
 
86
 
        return s
 
94
            return s
87
95