Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

hglib: add maxdiffsize() function

Changeset dd33b915ff44

Parent d8f7789f87cc

by Steve Borho

Changes to one file · Browse files at dd33b915ff44 Showing diff from parent d8f7789f87cc Diff from another changeset...

Change 1 of 1 Show Entire File thgutil/​hglib.py Stacked
 
93
94
95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
97
98
 
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
@@ -93,6 +93,21 @@
  _tabwidth = tabwidth   return tabwidth   +_maxdiff = None +def getmaxdiffsize(ui): + global _maxdiff + if _maxdiff is not None: + return _maxdiff + maxdiff = ui.config('tortoisehg', 'maxdiff') + try: + maxdiff = int(maxdiff) + if maxdiff < 1: + maxdiff = sys.maxint + except (ValueError, TypeError): + maxdiff = 1024 # 1MB by default + _maxdiff = maxdiff * 1024 + return _maxdiff +  def diffexpand(line):   'Expand tabs in a line of diff/patch text'   if _tabwidth is None: