Changeset e85f55e53828…
Parent 328a4f3f0d23…
by
Changes to one file · Browse files at e85f55e53828 Showing diff from parent 328a4f3f0d23 Diff from another changeset...
@@ -92,6 +92,7 @@ self.preview_tab_name_label = None
self.subrepos = []
self.colorstyle = self.repo.ui.config('tortoisehg', 'diffcolorstyle')
+ self.ignoremaxdiff = False
def auto_check(self):
# Only auto-check files once, and only if a pattern was given.
@@ -1153,22 +1154,30 @@ if len(self.diffmodel):
tree.scroll_to_cell(0, use_align=True, row_align=0.0)
- def read_file_chunks(self, wfile):
- 'Get diffs of working file, parse into (c)hunks'
- difftext = cStringIO.StringIO()
+ def check_max_diff(self, pfile):
+ lines = []
+ if self.ignoremaxdiff:
+ return lines
ctx = self.repo[self._node1]
try:
- pfile = util.pconvert(wfile)
fctx = ctx.filectx(pfile)
except error.LookupError:
fctx = None
if fctx and fctx.size() > hglib.getmaxdiffsize(self.repo.ui):
# Fake patch that displays size warning
- lines = ['diff --git a/%s b/%s\n' % (wfile, wfile)]
+ lines = ['diff --git a/%s b/%s\n' % (pfile, pfile)]
lines.append(_('File is larger than the specified max size.\n'))
lines.append(_('Hunk selection is disabled for this file.\n'))
- lines.append('--- a/%s\n' % wfile)
- lines.append('+++ b/%s\n' % wfile)
+ lines.append('--- a/%s\n' % pfile)
+ lines.append('+++ b/%s\n' % pfile)
+ return lines
+
+ def read_file_chunks(self, wfile):
+ 'Get diffs of working file, parse into (c)hunks'
+ difftext = cStringIO.StringIO()
+ pfile = util.pconvert(wfile)
+ lines = self.check_max_diff(pfile)
+ if lines:
difftext.writelines(lines)
difftext.seek(0)
else:
|
Loading...