Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

sync: add configChanged() method to receive repo notifications

Also use the repo's busy count to trigger detection of changes after
significant events. If changes did occur, the repo will report them
to anyone that is interested.

Changeset 89d59d963522

Parent b8607dded23a

by Steve Borho

Changes to one file · Browse files at 89d59d963522 Showing diff from parent b8607dded23a Diff from another changeset...

 
25
26
27
28
29
30
31
 
37
38
39
40
41
42
43
44
45
46
47
 
50
51
52
 
 
 
 
 
 
53
54
55
 
151
152
153
 
 
 
 
154
155
156
 
277
278
279
 
280
281
282
283
284
 
285
286
287
 
308
309
310
311
312
313
314
 
345
346
347
348
349
350
 
 
 
351
352
353
 
364
365
366
 
367
368
369
370
371
372
373
 
374
375
376
 
25
26
27
 
28
29
30
 
36
37
38
 
 
 
 
 
39
40
41
 
44
45
46
47
48
49
50
51
52
53
54
55
 
151
152
153
154
155
156
157
158
159
160
 
281
282
283
284
285
286
287
 
 
288
289
290
291
 
312
313
314
 
315
316
317
 
348
349
350
 
 
 
351
352
353
354
355
356
 
367
368
369
370
371
372
 
 
373
374
375
376
377
378
379
@@ -25,7 +25,6 @@
 _schemes = ['local', 'ssh', 'http', 'https']    class SyncWidget(QWidget): - invalidate = pyqtSignal()   outgoingNodes = pyqtSignal(object)   showMessage = pyqtSignal(str)   @@ -37,11 +36,6 @@
  self.setLayout(layout)   self.setAcceptDrops(True)   - self.log = log - if not log: - self.setWindowTitle(_('TortoiseHg Sync')) - self.resize(850, 550) -   self.root = root   self.repo = thgrepo.repository(ui.ui(), root)   self.finishfunc = None @@ -50,6 +44,12 @@
  self.updateInProgress = False   self.tv = PathsTree(root, self)   + self.log = log + if not log: + self.setWindowTitle(_('TortoiseHg Sync')) + self.resize(850, 550) + self.repo.configChanged.connect(self.configChanged) +   hbox = QHBoxLayout()   hbox.setContentsMargins(0, 0, 0, 0)   self.savebutton = QPushButton(_('Save')) @@ -151,6 +151,10 @@
  for b in self.opbuttons:   b.setEnabled(True)   + def configChanged(self): + 'Repository is reporting its config files have changed' + self.reload() +   def reload(self):   fn = os.path.join(self.root, '.hg', 'hgrc')   fn, cfg = loadIniFile([fn], self) @@ -277,11 +281,11 @@
  else:   alias = 'new'   url = hglib.fromunicode(self.urlentry.text()) + self.repo.incrementBusyCount()   dialog = SaveDialog(self.root, alias, url, self)   if dialog.exec_() == QDialog.Accepted:   self.curalias = hglib.fromunicode(dialog.aliasentry.text()) - self.repo.invalidateui() - self.reload() + self.repo.decrementBusyCount()     def authclicked(self):   host = hglib.fromunicode(self.hostentry.text()) @@ -308,7 +312,6 @@
    def pullclicked(self):   def finished(ret, output): - self.invalidate.emit()   self.showMessage.emit(_('Pull finished, ret %d') % ret)   self.finishfunc = finished   cmdline = ['--repository', self.root, 'pull'] @@ -345,9 +348,9 @@
    def postpullclicked(self):   dlg = PostPullDialog(self.repo, self) - if dlg.exec_() == QDialog.Accepted: - self.repo.invalidateui() - self.reload() + self.repo.incrementBusyCount() + dlg.exec_() + self.repo.decrementBusyCount()     def emailclicked(self):   from tortoisehg.hgqt import run as _run @@ -364,13 +367,13 @@
  return   if alias in cfg['paths']:   del cfg['paths'][alias] + self.repo.incrementBusyCount()   try:   wconfig.writefile(cfg, fn) - self.repo.invalidateui() - self.reload()   except IOError, e:   qtlib.WarningMsgBox(_('Unable to write configuration file'),   hglib.tounicode(e), parent=self) + self.repo.decrementBusyCount()      class PostPullDialog(QDialog):