Commits

Yuya Nishihara committed 25409dd

refresh

Comments (0)

Files changed (3)

fv-displayloaded.diff

 # HG changeset patch
 # Date 1390040312 -32400
-# Parent 84973d09f86d8f14cd126e2d20dec4aa5934e00c
+# Parent 530150ba676c5a5cf1c01855e8deba9fcafd9c00
 fileview: allow to preload file data by client code
 
 diff --git a/tortoisehg/hgqt/filedata.py b/tortoisehg/hgqt/filedata.py
 --- a/tortoisehg/hgqt/filedata.py
 +++ b/tortoisehg/hgqt/filedata.py
-@@ -102,6 +102,10 @@ class _AbstractFileData(object):
+@@ -105,6 +105,10 @@ class _AbstractFileData(object):
                                 posixpath.join(self._rpath, self._wfile),
                                 self._ctx)
  
 diff --git a/tortoisehg/hgqt/fileview.py b/tortoisehg/hgqt/fileview.py
 --- a/tortoisehg/hgqt/fileview.py
 +++ b/tortoisehg/hgqt/fileview.py
-@@ -423,7 +423,8 @@ class HgFileView(QFrame):
+@@ -460,7 +460,8 @@ class HgFileView(QFrame):
          self._displayLoaded(self._fd)
  
      def display(self, fd):
 -        fd.load(self.isChangeSelectionEnabled())
 +        if not fd.isLoaded():
 +            fd.load(self.isChangeSelectionEnabled())
-         self._displayLoaded(fd)
- 
-     def _displayLoaded(self, fd):
+         fd.setTextEncoding(self._textEncoding())
+         if self._autoTextEncoding():
+             fd.detectTextEncoding()

fv-updatechunkpriv.diff

 # HG changeset patch
 # Date 1390040763 -32400
-# Parent 921f3b933fe3b26847e509d2f9329ce0c6aca157
+# Parent 40de3d946643b584f87f65326cfb02045b8b9326
 fileview: inline updateChunk() which is private now
 
 diff --git a/tortoisehg/hgqt/fileview.py b/tortoisehg/hgqt/fileview.py
 --- a/tortoisehg/hgqt/fileview.py
 +++ b/tortoisehg/hgqt/fileview.py
-@@ -277,10 +277,6 @@ class HgFileView(QFrame):
+@@ -299,10 +299,6 @@ class HgFileView(QFrame):
          if self._effectiveMode() == DiffMode:
              self._changeEffectiveMode(DiffMode)
  
      @pyqtSlot(QAction)
      def _setModeByAction(self, action):
          'One of the mode toolbar buttons has been toggled'
-@@ -1284,10 +1280,6 @@ class _ChunkSelectionViewControl(_Abstra
+@@ -1330,10 +1326,6 @@ class _ChunkSelectionViewControl(_Abstra
              self._chunkatline[chunk.lineno] = chunk
              self._updateMarker(chunk)
  
      def _updateMarker(self, chunk):
          excludemsg = ' ' + _('(excluded from the next commit)')
          # markerAdd() does not check if the specified marker is already
-@@ -1340,7 +1332,8 @@ class _ChunkSelectionViewControl(_Abstra
+@@ -1404,7 +1396,9 @@ class _ChunkSelectionViewControl(_Abstra
+ 
+     def _setChunkAtLines(self, lines, excluded):
+         for l in lines:
+-            self.updateChunk(self._chunkatline[l], excluded)
++            chunk = self._chunkatline[line]
++            self._fd.setChunkExcluded(chunk, excluded)
++            self._updateMarker(chunk)
+         self.chunkSelectionChanged.emit()
  
      def _toggleChunkAtLine(self, line):
-         chunk = self._chunkatline[line]
--        self.updateChunk(chunk, not chunk.excluded)
-+        self._fd.setChunkExcluded(chunk, not chunk.excluded)
-+        self._updateMarker(chunk)
-         self.chunkSelectionChanged.emit()
- 
-     @pyqtSlot()

st-chunkupdate.diff

 # HG changeset patch
 # Date 1390040576 -32400
-# Parent 3db4a0848bba3f56492c5dffc1b4403ceff3424a
+# Parent 1487ddcb2157ad12c30e957099deab9d644e49f4
 status: merge chunk selection before displaying file content
 
 newChunkList signal is no longer necessary because StatusWidget loads chunks
      chunkSelectionChanged = pyqtSignal()
  
      grepRequested = pyqtSignal(unicode, dict)
-@@ -472,11 +471,6 @@ class HgFileView(QFrame):
+@@ -514,11 +513,6 @@ class HgFileView(QFrame):
          for c in self._activeViewControls:
              c.display(fd)
  
 -            self.newChunkList.emit(fd.filePath(), None)
 -
          self.highlightText(*self._lastSearch)
-         uc = hglib.tounicode(fd.contents) or ''
-         self.fileDisplayed.emit(fd.filePath(), uc)
+         self.fileDisplayed.emit(fd.filePath(), fd.fileText())
+ 
 diff --git a/tortoisehg/hgqt/status.py b/tortoisehg/hgqt/status.py
 --- a/tortoisehg/hgqt/status.py
 +++ b/tortoisehg/hgqt/status.py
-@@ -184,7 +184,6 @@ class StatusWidget(QWidget):
+@@ -185,7 +185,6 @@ class StatusWidget(QWidget):
          self.fileview.linkActivated.connect(self.linkActivated)
          self.fileview.fileDisplayed.connect(self.fileDisplayed)
          self.fileview.shelveToolExited.connect(self.refreshWctx)
          self.fileview.chunkSelectionChanged.connect(self.chunkSelectionChanged)
          self.fileview.grepRequested.connect(self.grepRequested)
          self.fileview.setMinimumSize(QSize(16, 16))
-@@ -239,8 +238,7 @@ class StatusWidget(QWidget):
+@@ -240,8 +239,7 @@ class StatusWidget(QWidget):
          self.fileview.saveSettings(qs, prefix+'/fileview')
          qs.setValue(prefix+'/state', self.split.saveState())
  
          # remove files from the partials dictionary if they are not partial
          # selections, in order to simplify refresh.
          dels = []
-@@ -255,7 +253,8 @@ class StatusWidget(QWidget):
+@@ -256,7 +254,8 @@ class StatusWidget(QWidget):
          for file in dels:
              del self.partials[file]
  
          if changes is None:
              if wfile in self.partials:
                  del self.partials[wfile]
-@@ -268,14 +267,14 @@ class StatusWidget(QWidget):
+@@ -269,14 +268,14 @@ class StatusWidget(QWidget):
              oldstates = dict([(c.fromline, c.excluded) for c in oldhunks])
              for chunk in changes.hunks:
                  if chunk.fromline in oldstates:
          self.chunkSelectionChanged()
          self.partials[wfile] = changes
  
-@@ -548,6 +547,10 @@ class StatusWidget(QWidget):
+@@ -549,6 +548,10 @@ class StatusWidget(QWidget):
              fd = filedata.createSubrepoData(ctx, pctx, wfile)
          else:
              fd = filedata.createFileData(ctx, pctx, wfile, status)