Exemple #1
0
 def test_flyspray(self):
     self.assertEquals('1234', get_bug_id('https://flyspray.example.com/index.php?do=details&task_id=1234'))
     self.assertEquals('1234', get_bug_id('https://bugs.flyspray.org/task/1234'))
Exemple #2
0
 def test_jira(self):
     self.assertEquals('AB-1234', get_bug_id('http://jiraserver/browse/AB-1234'))
     self.assertEquals('A_B-1234', get_bug_id('http://jiraserver/browse/A_B-1234'))
     self.assertEquals('AB_1-1234', get_bug_id('http://jiraserver/browse/AB_1-1234'))
     self.assertEquals('AB_1A-1234', get_bug_id('http://jiraserver/browse/AB_1A-1234'))
     self.assertEquals(None, get_bug_id('http://jiraserver/browse/1A-1234'))
     self.assertEquals(None, get_bug_id('http://jiraserver/browse/_1A-1234'))
     self.assertEquals(None, get_bug_id('http://jiraserver/browse/A-1234A'))
     self.assertEquals(None, get_bug_id('http://jiraserver/browse/a-1'))
     self.assertEquals(None, get_bug_id('http://jiraserver/browse/a'))
     self.assertEquals(None, get_bug_id('http://jiraserver/browse/A'))
     self.assertEquals(None, get_bug_id('http://jiraserver/browse/A-'))
     self.assertEquals(None, get_bug_id('http://jiraserver/browse/A_1'))
     self.assertEquals('A-1', get_bug_id('http://jiraserver/browse/A-1'))
     self.assertEquals('ZZ12_SA__2__-122222222', get_bug_id('http://jiras1212erver/browse/ZZ12_SA__2__-122222222'))
Exemple #3
0
 def test_mantis(self):
     self.assertEquals('7721', get_bug_id('http://www.mantisbt.org/bugs/view.php?id=7721'))
     self.assertEquals('123', get_bug_id('http://localhost/view.php?id=123'))
Exemple #4
0
 def test_fusionforge(self):
     self.assertEquals('292', get_bug_id('https://fusionforge.org/tracker/index.php?func=detail&aid=292'))
Exemple #5
0
 def test_fogbugz(self):
     self.assertEquals('1234', get_bug_id('http://test.fogbugz.com/default.asp?1234'))
Exemple #6
0
 def test_roundup(self):
     self.assertEquals('5243', get_bug_id('http://bugs.python.org/issue5243'))
Exemple #7
0
 def test_redmine(self):
     self.assertEquals('1832', get_bug_id('http://www.redmine.org/issues/show/1832'))
     self.assertEquals('6', get_bug_id('https://rm.ftrahan.com/issues/6'))
Exemple #8
0
 def test_bugzilla(self):
     self.assertEquals('169104', get_bug_id('http://bugs.kde.org/show_bug.cgi?id=169104'))
Exemple #9
0
 def test_trac(self):
     self.assertEquals('3852', get_bug_id('http://bugs.musicbrainz.org/ticket/3852'))
Exemple #10
0
 def test_launchpad(self):
     self.assertEquals('261234', get_bug_id('https://launchpad.net/bugs/261234'))
Exemple #11
0
 def data(self, index, role):
     
     if not index.isValid():
         return QtCore.QVariant()
     
     def blank():
         if role == QtCore.Qt.DisplayRole:
             return QtCore.QVariant("")
         return QtCore.QVariant()
     
     c_rev = self.computed.filtered_revs[index.row()]
     if c_rev is None:
         return blank()
     
     if c_rev.rev.revid in cached_revisions:
         revision = cached_revisions[c_rev.rev.revid]
     else:
         revision = None
     
     if role == GraphDataRole:
         prev_c_rev = None
         prev_c_rev_f_index = c_rev.f_index - 1
         if prev_c_rev_f_index >= 0:
             prev_c_rev = self.computed.filtered_revs[prev_c_rev_f_index]
         
         tags = []
         # Branch labels
         tags.extend([(label,
                       QtGui.QColor(24, 80, 200),
                       QtGui.QColor(QtCore.Qt.white))
                      for (branch_info, label) in c_rev.branch_labels
                      if label])
         # Tags
         if c_rev.rev.revid in self.graph_viz.tags:
             tags.extend(
                 [(tag,
                   QtGui.QColor(80, 128, 32),
                   QtGui.QColor(QtCore.Qt.white))
                  for tag in self.graph_viz.tags[c_rev.rev.revid]])
         
         # Bugs
         if revision:
             if hasattr(revision, '_qlog_bugs'):
                 bugs = revision._qlog_bugs
             else:
                 bugs = []
                 for bug in revision.properties.get('bugs', '').split('\n'):
                     if bug:
                         url = bug.split(' ', 1)[0]
                         bug_id = get_bug_id(url)
                         if bug_id:
                             bugs.append(self.bugtext % bug_id)
                 revision._qlog_bugs = bugs
             tags.extend([(bug,
                           QtGui.QColor(164, 0, 0),
                           QtGui.QColor(QtCore.Qt.white))
                          for bug in bugs])
         is_clicked = c_rev.f_index == self.clicked_f_index
         
         return QtCore.QVariant((c_rev, prev_c_rev, tags, is_clicked))
     
     if (role == QtCore.Qt.DisplayRole and index.column() == COL_REV):
         return QtCore.QVariant(c_rev.rev.revno_str)
     
     if role == QtCore.Qt.ToolTipRole and index.column() == COL_MESSAGE:
         urls =  [branch_info.branch.base
                  for (branch_info, label) in c_rev.branch_labels
                  if label]
         return QtCore.QVariant('\n'.join(urls))
     
     if role == RevIdRole:
         return QtCore.QVariant(c_rev.rev.revid)
     
     #Everything from here foward will need to have the revision loaded.
     if revision is None:
         return blank()
     
     if role == QtCore.Qt.DisplayRole and index.column() == COL_DATE:
         return QtCore.QVariant(strftime("%Y-%m-%d %H:%M",
                                         localtime(revision.timestamp)))
     if role == QtCore.Qt.DisplayRole and index.column() == COL_AUTHOR:
         return QtCore.QVariant(extract_name(get_apparent_author(revision)))
     if role == QtCore.Qt.DisplayRole and index.column() == COL_MESSAGE:
         return QtCore.QVariant(revision.get_summary())
     
     return blank()