Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0.3, 2.0.4, and 2.0.5

stable fileview: enforce maxdiff for R!

improved by checking file size first, then process as before

Changeset 93471309cb3d

Parent 610cff8add6f

by Eduard-Cristian Stefan

Changes to one file · Browse files at 93471309cb3d Showing diff from parent 610cff8add6f Diff from another changeset...

 
617
618
619
 
 
 
620
621
622
623
624
625
626
627
 
 
 
628
629
 
 
 
 
 
630
631
632
 
617
618
619
620
621
622
623
624
 
 
 
 
 
 
625
626
627
628
 
629
630
631
632
633
634
635
636
@@ -617,16 +617,20 @@
    # TODO: elif check if a subdirectory (for manifest tool)   + mde = _('File or diffs not displayed: ') + \ + _('File is larger than the specified max size.\n') +   if status in ('R', '!'):   if wfile in ctx.p1(): - olddata = ctx.p1()[wfile].data() - if '\0' in olddata: - self.error = 'binary file' - elif len(olddata) > ctx._repo.maxdiff: - p = _('File or diffs not displayed: ') - self.error = p + _('File is larger than the specified max size.\n') + fctx = ctx.p1()[wfile] + if fctx._filelog.rawsize(fctx.filerev()) > ctx._repo.maxdiff: + self.error = mde   else: - self.contents = hglib.tounicode(olddata) + olddata = fctx.data() + if '\0' in olddata: + self.error = 'binary file' + else: + self.contents = hglib.tounicode(olddata)   self.flabel += _(' <i>(was deleted)</i>')   else:   self.flabel += _(' <i>(was added, now missing)</i>')