Commits

Yuya Nishihara  committed 92a8e4a

filedata: add stub to switch encoding of file content

  • Participants
  • Parent commits e835aa0
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/filedata.py

     def subrepoType(self):
         pass
 
+    def _textToUnicode(self, s):
+        return hglib.tounicode(s)
+
     def diffText(self):
-        return hglib.tounicode(self.diff or '')
+        return self._textToUnicode(self.diff or '')
 
     def fileText(self):
-        return hglib.tounicode(self.contents or '')
+        return self._textToUnicode(self.contents or '')
 
 
 class FileData(_AbstractFileData):
                 self.diff = ''
 
     def diffText(self):
-        udiff = hglib.tounicode(self.diff or '')
+        udiff = self._textToUnicode(self.diff or '')
         if self.changes:
             return udiff
         return _trimdiffheader(udiff)
         return nullrev
 
     def diffText(self):
-        return _trimdiffheader(hglib.tounicode(self.diff or ''))
+        return _trimdiffheader(self._textToUnicode(self.diff or ''))
 
 
 class PatchDirData(_AbstractFileData):