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

stable thgrepo: add option not to monitor changes on network drives (refs #889)

Sometimes it causes locking issue to watch files on network share.
This is just a workaround for the issue, but I think it's nice to disable
monitoring on network drives.

Changeset 5fe1a71fa68b

Parent 620643a20418

by Yuya Nishihara

Changes to 2 files · Browse files at 5fe1a71fa68b Showing diff from parent 620643a20418 Diff from another changeset...

 
444
445
446
 
 
 
 
447
448
449
 
444
445
446
447
448
449
450
451
452
453
@@ -444,6 +444,10 @@
  'Default: 0, Not expanded')),   _fi(_('Force Repo Tab'), 'tortoisehg.forcerepotab', genBoolRBGroup,   _('Always show repo tabs, even for a single repo. Default: False')), + _fi(_('Monitor Repo Changes'), 'tortoisehg.monitorrepo', + (genDefaultCombo, ['always', 'localonly']), + _('Specify the target filesystem where TortoiseHg monitors changes. ' + 'Default: always')),   _fi(_('Max Diff Size'), 'tortoisehg.maxdiff', genIntEditCombo,   _('The maximum size file (in KB) that TortoiseHg will '   'show changes for in the changelog, status, and commit windows. '
 
20
21
22
23
 
24
25
26
 
78
79
80
 
 
81
82
 
 
83
84
85
 
20
21
22
 
23
24
25
26
 
78
79
80
81
82
83
84
85
86
87
88
89
@@ -20,7 +20,7 @@
 from mercurial import ui as uimod  from mercurial.util import propertycache   -from tortoisehg.util import hglib +from tortoisehg.util import hglib, paths  from tortoisehg.util.patchctx import patchctx    _repocache = {} @@ -78,8 +78,12 @@
  repo.workingDirectoryChanged = self.workingDirectoryChanged   repo.workingBranchChanged = self.workingBranchChanged   self.recordState() + + monitorrepo = repo.ui.config('tortoisehg', 'monitorrepo', 'always')   if isinstance(repo, bundlerepo.bundlerepository):   dbgoutput('not watching F/S events for bundle repository') + elif monitorrepo == 'localonly' and paths.netdrive_status(repo.path): + dbgoutput('not watching F/S events for network drive')   else:   self.watcher = QFileSystemWatcher(self)   self.watcher.addPath(repo.path)