Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph

Merge with stable

Changeset df80bd602a1f

Parents bc508a3590e9

Parents d533e14e006b

by Steve Borho

Changes to 2 files · Browse files at df80bd602a1f Showing diff from parent bc508a3590e9 d533e14e006b Diff from another changeset...

 
349
350
351
352
353
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
354
355
356
 
376
377
378
 
 
 
379
380
381
 
349
350
351
 
 
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
 
391
392
393
394
395
396
397
398
399
@@ -349,8 +349,23 @@
  self.expand()   self._pendingReloadModel = False   - def expand(self): - self.tview.expandToDepth(0) + def expand(self, it=None): + if not it: + self.tview.expandToDepth(0) + else: + # Create a list of ancestors (including the selected item) + from repotreeitem import RepoGroupItem + itchain = [it] + while(not isinstance(itchain[-1], RepoGroupItem)): + itchain.append(itchain[-1].parent()) + + # Starting from the topmost ancestor (a root item), expand the + # ancestors one by one + m = self.tview.model() + idx = self.tview.rootIndex() + for it in reversed(itchain): + idx = m.index(it.row(), 0, idx) + self.tview.expand(idx)     def addRepo(self, root):   'workbench has opened a new repowidget, ensure it is in the registry' @@ -376,6 +391,9 @@
  it.setActive(True)   self.tview.dataChanged(QModelIndex(), QModelIndex())   + # Make sure that the active tab is visible by expanding its parent + self.expand(it.parent()) +   def showPaths(self, show):   self.tview.setColumnHidden(1, not show)   self.tview.setHeaderHidden(not show)
 
86
87
88
89
 
90
91
92
 
813
814
815
816
817
818
819
820
821
822
 
847
848
849
 
 
 
 
 
850
851
852
 
86
87
88
 
89
90
91
92
 
813
814
815
 
 
 
 
816
817
818
 
843
844
845
846
847
848
849
850
851
852
853
@@ -86,7 +86,7 @@
  # Create the actions that will be displayed on the context menu   self.createActions()   self.lastClosedRepoRootList = [] - +   def setupUi(self):   desktopgeom = qApp.desktop().availableGeometry()   self.resize(desktopgeom.size() * 0.8) @@ -813,10 +813,6 @@
  wb = "Workbench/"   self.restoreGeometry(s.value(wb + 'geometry').toByteArray())   self.restoreState(s.value(wb + 'windowState').toByteArray()) - save = s.value(wb + 'saveRepos').toBool() - self.actionSaveRepos.setChecked(save) - for path in hglib.fromunicode(s.value(wb + 'openrepos').toString()).split(','): - self._openRepo(path, False)     # Load the repo registry settings. Note that we must allow the   # repo registry to assemble itself before toggling its settings @@ -847,6 +843,11 @@
  # Manually reload the model now, to apply the settings   self.reporegistry.reloadModel()   + save = s.value(wb + 'saveRepos').toBool() + self.actionSaveRepos.setChecked(save) + for path in hglib.fromunicode(s.value(wb + 'openrepos').toString()).split(','): + self._openRepo(path, False) +   # Allow repo registry to assemble itself before toggling path state   sp = s.value(wb + 'showPaths').toBool()   QTimer.singleShot(0, lambda: self.actionShowPaths.setChecked(sp))