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

reporegistry: add "Refresh Registry list" action

Added a new command to the repository groups which allows refreshing the
repository registry list. This is useful in three scenarios:

- It allows to reload the repository list when there are multiple instances of
the workbench and the repo registry was modified in one of the other instances
(note that this only works when the other instance is closed)
- It allows manually reloading the list of subrepos that is shown on the
repository registry
- Building on the patch that shows a warning icon on repositories that cannot be
loaded, it allows to check whether a repository that was missing when the
workbench was loaded can now be accessed (or viceversa)

As a drawback, I added the command to the repostitory group, which may suggest
that only the corresponding group will be reload. However the command text
should make it clear that what is refreshed is the "Repository Registry", rather
than the group.

Changeset ca099a1a8019

Parent fbb424290113

by Angel Ezquerra

Changes to 2 files · Browse files at ca099a1a8019 Showing diff from parent fbb424290113 Diff from another changeset...

 
208
209
210
 
 
 
 
211
212
213
214
215
216
217
 
228
229
230
231
232
233
 
 
 
234
235
236
 
208
209
210
211
212
213
214
215
216
217
 
218
219
220
 
231
232
233
 
234
 
235
236
237
238
239
240
@@ -208,10 +208,13 @@
    self.createActions()   QTimer.singleShot(0, self.expand) + def reloadModel(self): + self.tview.setModel( + repotreemodel.RepoTreeModel(settingsfilename(), self)) + self.expand()     def expand(self):   self.tview.expandToDepth(0) -   def addRepo(self, root):   'workbench has opened a new repowidget, ensure it is in the registry'   m = self.tview.model() @@ -228,9 +231,10 @@
    def close(self):   self.tview.model().write(settingsfilename()) -   def _action_defs(self): - a = [("open", _("Open"), 'thg-repository-open', + a = [("reloadRegistry", _("Refresh repository list"), 'view-refresh', + _("Refresh the Repository Registry list"), self.reloadModel), + ("open", _("Open"), 'thg-repository-open',   _("Open the repository in a new tab"), self.open),   ("openAll", _("Open All"), 'thg-repository-open',   _("Open all repositories in new tabs"), self.openAll),
 
352
353
354
355
356
357
358
 
 
359
360
361
 
380
381
382
383
384
385
386
 
 
387
388
389
 
352
353
354
 
355
 
 
356
357
358
359
360
 
379
380
381
 
382
 
 
383
384
385
386
387
@@ -352,10 +352,9 @@
  self.name = value.toString()   return True   return False -   def menulist(self): - return ['openAll', 'add', None, 'newGroup', None, 'rename', 'remove'] - + return ['openAll', 'add', None, 'newGroup', None, 'rename', 'remove', + None, 'reloadRegistry']   def flags(self):   return (Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsDropEnabled   | Qt.ItemIsDragEnabled | Qt.ItemIsEditable) @@ -380,10 +379,9 @@
  def __init__(self, model, parent=None):   RepoTreeItem.__init__(self, model, parent)   self.name = _('default') -   def menulist(self): - return ['openAll', 'add', None, 'newGroup', None, 'rename'] - + return ['openAll', 'add', None, 'newGroup', None, 'rename', + None, 'reloadRegistry']   def undump(self, xr):   a = xr.attributes()   name = a.value('', 'name').toString()