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

chunkselect: fix size/binary checks for removed files

Changeset a65328eae56d

Parent 1b544ef8350a

by Steve Borho

Changes to one file · Browse files at a65328eae56d Showing diff from parent 1b544ef8350a Diff from another changeset...

 
22
23
24
25
 
 
26
27
 
28
29
30
31
32
33
34
 
35
36
37
 
22
23
24
 
25
26
27
 
28
29
30
31
32
33
34
 
35
36
37
38
@@ -22,16 +22,17 @@
  lines = []   try:   fctx = ctx.filectx(wfile) - except error.LookupError: + size = fctx.size() + except (EnvironmentError, error.LookupError):   fctx = None - if fctx and fctx.size() > hglib.getmaxdiffsize(ctx._repo.ui): + if fctx and size > hglib.getmaxdiffsize(ctx._repo.ui):   # Fake patch that displays size warning   lines = ['diff --git a/%s b/%s\n' % (wfile, wfile)]   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) - elif '\0' in fctx.data(): + elif fctx and '\0' in fctx.data():   # Fake patch that displays binary file warning   lines = ['diff --git a/%s b/%s\n' % (wfile, wfile)]   lines.append(_('File is binary.\n'))