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

chunks: poll for changes to currently displayed patch or working file

Changeset ed22e0d76982

Parent e07d376e3df7

by Steve Borho

Changes to one file · Browse files at ed22e0d76982 Showing diff from parent e07d376e3df7 Diff from another changeset...

 
6
7
8
 
9
10
11
 
63
64
65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
67
68
 
88
89
90
 
91
92
93
 
6
7
8
9
10
11
12
 
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
 
109
110
111
112
113
114
115
@@ -6,6 +6,7 @@
 # of the GNU General Public License, incorporated herein by reference.    import cStringIO +import os    from hgext import record   @@ -63,6 +64,26 @@
    self.splitter.setStretchFactor(0, 0)   self.splitter.setStretchFactor(1, 3) + self.timerevent = self.startTimer(500) + + def timerEvent(self, event): + 'Periodic poll of currently displayed patch or working file' + ctx = self.filelistmodel._ctx + if ctx is None: + return + if isinstance(ctx, patchctx): + path = ctx._path + mtime = ctx._mtime + elif self.currentFile: + path = self.repo.wjoin(self.currentFile) + mtime = self.mtime + else: + return + if os.path.exists(path): + newmtime = os.path.getmtime(path) + if mtime != newmtime: + self.mtime = newmtime + self.refresh()     def editCurrentFile(self):   ctx = self.filelistmodel._ctx @@ -88,6 +109,7 @@
  def displayFile(self, file, rev, status):   if file:   self.currentFile = file + self.mtime = os.path.getmtime(self.repo.wjoin(file))   self.diffbrowse.displayFile(file, status)   self.fileSelected.emit(True)   else: