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 a warning indicator whenever a repo cannot be load

Currently the warning is only shown if thg is unable to load the list of
subrepos for a given repository.

Note that the warning icon is only set when the reporegistry is first load, so
any changes to the state of the repositories after the thg window has been open
will not be reflected in the repo registry status.

I am reusing the 'dialog-warning' icon. However maybe we should add an icon
named thg-warning to the scalable/status folder.

Changeset fbb424290113

Parent 4d707f88e484

by Angel Ezquerra

Changes to one file · Browse files at fbb424290113 Showing diff from parent 4d707f88e484 Diff from another changeset...

 
144
145
146
 
 
 
 
 
 
 
 
 
147
148
149
150
151
152
153
 
174
175
176
 
 
177
178
179
 
196
197
198
199
200
 
201
202
203
 
252
253
254
255
 
 
256
257
258
 
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
 
159
160
161
 
182
183
184
185
186
187
188
189
 
206
207
208
 
209
210
211
212
213
 
262
263
264
 
265
266
267
268
269
@@ -144,10 +144,18 @@
  self._shortname = u''   self._basenode = node.nullid   self._repotype = 'hg' + # The _valid property is used to display a "warning" icon for repos + # that cannot be open + # If root is set we assume that the repo is valid (an actual validity + # test would require calling hg.repository() which is expensive) + # Regardless, self._valid may be set to False if self.undump() fails + if self._root: + self._valid = True + else: + self._valid = False     def isRepo(self):   return True -   def rootpath(self):   return self._root   @@ -174,6 +182,8 @@
  if role == Qt.DecorationRole:   if column == 0:   ico = qtlib.geticon('hg') + if not self._valid: + ico = _overlaidicon(ico, qtlib.geticon('dialog-warning'))   return QVariant(ico)   return QVariant()   if column == 0: @@ -196,8 +206,8 @@
  xw.writeAttribute('root', hglib.tounicode(self._root))   xw.writeAttribute('shortname', self.shortname())   xw.writeAttribute('basenode', node.hex(self.basenode())) -   def undump(self, xr): + self._valid = False # Will be set to True if everything goes fine   a = xr.attributes()   self._root = hglib.fromunicode(a.value('', 'root').toString())   self._shortname = unicode(a.value('', 'shortname').toString()) @@ -252,7 +262,8 @@
  'The following subrepositories could not be accessed:'   '<br><br><i>%s</i>') %   (root, "<br>".join(invalidRepoList))) - + else: + self._valid = True   def details(self):   return _('Local Repository %s') % hglib.tounicode(self._root)