Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.1, 2.1.1, and 2.1.2

cslist: set the repo on init and remove the repo argument to update()

Changeset ca5df3b8912a

Parent 47ff626c895d

by David Wilhelm

Changes to 4 files · Browse files at ca5df3b8912a Showing diff from parent 47ff626c895d Diff from another changeset...

 
20
21
22
23
 
24
25
26
 
27
28
29
 
67
68
69
70
71
 
72
73
74
 
134
135
136
137
 
138
139
140
141
142
143
144
 
148
149
150
151
 
152
153
154
155
156
157
 
158
159
160
 
20
21
22
 
23
24
25
 
26
27
28
29
 
67
68
69
 
 
70
71
72
73
 
133
134
135
 
136
137
138
139
 
140
141
142
 
146
147
148
 
149
150
151
 
152
153
 
154
155
156
157
@@ -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
37
38
39
 
40
41
42
 
78
79
80
81
 
82
83
84
 
36
37
38
 
39
40
41
42
 
78
79
80
 
81
82
83
84
@@ -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
72
73
74
 
75
76
77
 
221
222
223
224
225
 
226
227
228
 
71
72
73
 
74
75
76
77
 
221
222
223
 
 
224
225
226
227
@@ -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
72
73
74
 
75
76
77
 
166
167
168
169
 
170
171
172
 
71
72
73
 
74
75
76
77
 
166
167
168
 
169
170
171
172
@@ -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):