Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0, 2.0.1, and 2.0.2

stable reporegistry: make addRepo() accept repo object instead of repo.root

Changeset 1d9f99848608

Parent d145697b015f

by Yuya Nishihara

Changes to 4 files · Browse files at 1d9f99848608 Showing diff from parent d145697b015f Diff from another changeset...

 
206
207
208
209
 
210
211
212
 
248
249
250
251
 
252
253
254
 
 
255
256
257
 
206
207
208
 
209
210
211
212
 
248
249
250
 
251
252
 
 
253
254
255
256
257
@@ -206,7 +206,7 @@
  if not self.selitem:   return   m = self.model() - m.addRepo(self.selitem, '') + m.addRepo(self.selitem, None)     def sizeHint(self):   size = super(RepoTreeView, self).sizeHint() @@ -248,10 +248,10 @@
  def expand(self):   self.tview.expandToDepth(0)   - def addRepo(self, reporoot): + def addRepo(self, repo):   m = self.tmodel - if m.getRepoItem(reporoot) == None: - m.addRepo(None, reporoot) + if m.getRepoItem(repo.root) == None: + m.addRepo(None, repo)     def openrepo(self, path, reuse=False):   self.openRepoSignal.emit(hglib.tounicode(path), reuse)
 
145
146
147
148
 
149
150
 
151
152
153
 
145
146
147
 
148
149
 
150
151
152
153
@@ -145,9 +145,9 @@
     class RepoItem(RepoTreeItem): - def __init__(self, model, rootpath='', parent=None): + def __init__(self, model, repo=None, parent=None):   RepoTreeItem.__init__(self, model, parent) - self._root = rootpath + self._root = repo and repo.root or ''   self._settingsdlg = None     def rootpath(self):
 
196
197
198
199
200
201
 
 
202
203
204
 
207
208
209
210
211
212
213
 
220
221
222
223
 
224
225
226
 
196
197
198
 
 
 
199
200
201
202
203
 
206
207
208
 
209
210
211
 
218
219
220
 
221
222
223
224
@@ -196,9 +196,8 @@
  def allreposIndex(self):   return self.createIndex(0, 0, self.allrepos)   - def addRepo(self, group, reporoot): - ar = reporoot - if ar == '': + def addRepo(self, group, repo): + if not repo:   caption = _('Select repository directory to add')   FD = QFileDialog   path = FD.getExistingDirectory(caption=caption, @@ -207,7 +206,6 @@
  try:   lpath = hglib.fromunicode(path)   repo = thgrepo.repository(None, path=lpath) - ar = repo.root   except error.RepoError:   QMessageBox.warning(self, _('Failed to add repository'),   _('%s is not a valid repository') % path) @@ -220,7 +218,7 @@
  rgi = grp.internalPointer()   cc = rgi.childCount()   self.beginInsertRows(grp, cc, cc + 1) - rgi.appendChild(RepoItem(self, rootpath=ar)) + rgi.appendChild(RepoItem(self, repo))   self.endInsertRows()     def getRepoItem(self, reporoot):
 
485
486
487
488
 
489
490
491
 
485
486
487
 
488
489
490
491
@@ -485,7 +485,7 @@
  tw.setCurrentIndex(index)   rw.titleChanged.connect(   lambda title: tw.setTabText(tw.indexOf(rw), title)) - self.reporegistry.addRepo(repo.root) + self.reporegistry.addRepo(repo)     self.updateMenu()