8239:59a9a658618c | 8240:93b8a353c4bf |
---|---|
8 """ | 8 """ |
9 | 9 |
10 import os | 10 import os |
11 import re | 11 import re |
12 import collections | 12 import collections |
13 import contextlib | |
13 | 14 |
14 from PyQt5.QtCore import pyqtSlot, Qt, QDate, QSize, QPoint, QFileInfo | 15 from PyQt5.QtCore import pyqtSlot, Qt, QDate, QSize, QPoint, QFileInfo |
15 from PyQt5.QtGui import ( | 16 from PyQt5.QtGui import ( |
16 QColor, QPixmap, QPainter, QPen, QBrush, QIcon, QTextCursor, QPalette | 17 QColor, QPixmap, QPainter, QPen, QBrush, QIcon, QTextCursor, QPalette |
17 ) | 18 ) |
2274 else: | 2275 else: |
2275 # lowest revision is the base, others will be bundled | 2276 # lowest revision is the base, others will be bundled |
2276 revs = [] | 2277 revs = [] |
2277 for itm in selectedItems: | 2278 for itm in selectedItems: |
2278 rev = itm.text(self.RevisionColumn).split(":", 1)[0] | 2279 rev = itm.text(self.RevisionColumn).split(":", 1)[0] |
2279 try: | 2280 with contextlib.suppress(ValueError): |
2280 revs.append(int(rev)) | 2281 revs.append(int(rev)) |
2281 except ValueError: | |
2282 # ignore silently | |
2283 pass | |
2284 baseRev = min(revs) | 2282 baseRev = min(revs) |
2285 while baseRev in revs: | 2283 while baseRev in revs: |
2286 revs.remove(baseRev) | 2284 revs.remove(baseRev) |
2287 | 2285 |
2288 bundleData = { | 2286 bundleData = { |