Changeset ca5df3b8912a…
Parent 47ff626c895d…
by
Changes to 4 files · Browse files at ca5df3b8912a Showing diff from parent 47ff626c895d Diff from another changeset...
@@ -20,10 +20,10 @@
class ChangesetList(QWidget):
- def __init__(self, parent=None):
+ def __init__(self, repo=None, parent=None):
super(ChangesetList, self).__init__()
- self.currepo = None
+ self.currepo = repo
self.curitems = None
self.curfactory = None
self.showitems = None
@@ -67,8 +67,7 @@ self.scrollarea.setWidget(self.scrollbox)
# signal handlers
- self.compactchk.toggled.connect(lambda *a: self.update(self.currepo,
- self.curitems))
+ self.compactchk.toggled.connect(lambda *a: self.update(self.curitems))
# csetinfo
def datafunc(widget, item, ctx):
@@ -134,11 +133,10 @@ text = _('Displaying %(count)d of %(total)d items') % num
self.statuslabel.setText(text)
- def update(self, repo, items, uselimit=True):
+ def update(self, items, uselimit=True):
"""Update the item list.
Public arguments:
- repo: Repository used to get changeset information.
items: List of revision numbers and/or patch file paths.
You can pass a mixed list. The order will be respected.
uselimit: If True, some of items will be shown.
@@ -148,13 +146,12 @@ """
# setup
self.clear()
- self.curfactory = csinfo.factory(repo, self.custom)
+ self.curfactory = csinfo.factory(self.currepo, self.custom)
# initialize variables
- self.currepo = repo
self.curitems = items
- if not items or not repo:
+ if not items or not self.currepo:
self.updatestatus()
return False
|
@@ -36,7 +36,7 @@ clcombo = QComboBox()
layout.addWidget(clcombo)
- self.cslist = cslist.ChangesetList()
+ self.cslist = cslist.ChangesetList(self.repo)
layout.addWidget(self.cslist)
self.cmd = cmdui.Runner(False, self)
@@ -78,7 +78,7 @@ except (error.Abort, error.RepoLookupError), e:
revs = []
self.cslist.clear()
- self.cslist.update(self.repo, revs)
+ self.cslist.update(revs)
sensitive = not curcl.endswith('(submitted)')
self.bb.button(QDialogButtonBox.Ok).setEnabled(sensitive)
self.bb.button(QDialogButtonBox.Discard).setEnabled(sensitive)
|
@@ -71,7 +71,7 @@ grid.addWidget(self.p0chk, 2, 1, Qt.AlignLeft)
### patch list
- self.cslist = cslist.ChangesetList()
+ self.cslist = cslist.ChangesetList(self.repo)
self.cslistrow = cslistrow = 4
self.cslistcol = cslistcol = 1
grid.addWidget(self.cslist, cslistrow, cslistcol,
@@ -221,8 +221,7 @@ self.cslist.clear()
self.import_btn.setDisabled(True)
else:
- self.cslist.update(self.repo,
- [os.path.abspath(p) for p in patches])
+ self.cslist.update([os.path.abspath(p) for p in patches])
self.import_btn.setEnabled(True)
self.updatestatus()
|
@@ -71,7 +71,7 @@ combo.addItem(hglib.tounicode(tag))
### preview box, contained in scroll area, contains preview grid
- self.cslist = cslist.ChangesetList()
+ self.cslist = cslist.ChangesetList(self.repo)
self.cslistrow = cslistrow = 2
self.cslistcol = cslistcol = 1
grid.addWidget(self.cslist, cslistrow, cslistcol,
@@ -166,7 +166,7 @@ striprevs.append(rev)
striprevs.sort()
self.cslist.clear()
- self.cslist.update(self.repo, striprevs)
+ self.cslist.update(striprevs)
return True
def preview(self):
|
Loading...