##// END OF EJS Templates
added hidden fulldiff GET param for disabling big diff cut off limit....
marcink -
r2161:e8c01681 beta
parent child Browse files
Show More
@@ -51,13 +51,18 b' from rhodecode.lib.diffs import wrapped_'
51 log = logging.getLogger(__name__)
51 log = logging.getLogger(__name__)
52
52
53
53
54 def anchor_url(revision, path):
54 def _update_with_GET(params, GET):
55 for k in ['diff1', 'diff2', 'diff']:
56 params[k] += GET.getall(k)
57
58
59 def anchor_url(revision, path, GET):
55 fid = h.FID(revision, path)
60 fid = h.FID(revision, path)
56 return h.url.current(anchor=fid, **dict(request.GET))
61 return h.url.current(anchor=fid, **dict(GET))
57
62
58
63
59 def get_ignore_ws(fid, GET):
64 def get_ignore_ws(fid, GET):
60 ig_ws_global = request.GET.get('ignorews')
65 ig_ws_global = GET.get('ignorews')
61 ig_ws = filter(lambda k: k.startswith('WS'), GET.getall(fid))
66 ig_ws = filter(lambda k: k.startswith('WS'), GET.getall(fid))
62 if ig_ws:
67 if ig_ws:
63 try:
68 try:
@@ -67,12 +72,13 b' def get_ignore_ws(fid, GET):'
67 return ig_ws_global
72 return ig_ws_global
68
73
69
74
70 def _ignorews_url(fileid=None):
75 def _ignorews_url(GET, fileid=None):
71 fileid = str(fileid)
76 fileid = str(fileid) if fileid else None
72 params = defaultdict(list)
77 params = defaultdict(list)
78 _update_with_GET(params, GET)
73 lbl = _('show white space')
79 lbl = _('show white space')
74 ig_ws = get_ignore_ws(fileid, request.GET)
80 ig_ws = get_ignore_ws(fileid, GET)
75 ln_ctx = get_line_ctx(fileid, request.GET)
81 ln_ctx = get_line_ctx(fileid, GET)
76 # global option
82 # global option
77 if fileid is None:
83 if fileid is None:
78 if ig_ws is None:
84 if ig_ws is None:
@@ -98,7 +104,7 b' def _ignorews_url(fileid=None):'
98
104
99
105
100 def get_line_ctx(fid, GET):
106 def get_line_ctx(fid, GET):
101 ln_ctx_global = request.GET.get('context')
107 ln_ctx_global = GET.get('context')
102 ln_ctx = filter(lambda k: k.startswith('C'), GET.getall(fid))
108 ln_ctx = filter(lambda k: k.startswith('C'), GET.getall(fid))
103
109
104 if ln_ctx:
110 if ln_ctx:
@@ -112,17 +118,19 b' def get_line_ctx(fid, GET):'
112 return
118 return
113
119
114
120
115 def _context_url(fileid=None):
121 def _context_url(GET, fileid=None):
116 """
122 """
117 Generates url for context lines
123 Generates url for context lines
118
124
119 :param fileid:
125 :param fileid:
120 """
126 """
121 fileid = str(fileid)
127
122 ig_ws = get_ignore_ws(fileid, request.GET)
128 fileid = str(fileid) if fileid else None
123 ln_ctx = (get_line_ctx(fileid, request.GET) or 3) * 2
129 ig_ws = get_ignore_ws(fileid, GET)
130 ln_ctx = (get_line_ctx(fileid, GET) or 3) * 2
124
131
125 params = defaultdict(list)
132 params = defaultdict(list)
133 _update_with_GET(params, GET)
126
134
127 # global option
135 # global option
128 if fileid is None:
136 if fileid is None:
@@ -163,7 +171,7 b' class ChangesetController(BaseRepoContro'
163 c.anchor_url = anchor_url
171 c.anchor_url = anchor_url
164 c.ignorews_url = _ignorews_url
172 c.ignorews_url = _ignorews_url
165 c.context_url = _context_url
173 c.context_url = _context_url
166
174 limit_off = request.GET.get('fulldiff')
167 #get ranges of revisions if preset
175 #get ranges of revisions if preset
168 rev_range = revision.split('...')[:2]
176 rev_range = revision.split('...')[:2]
169 enable_comments = True
177 enable_comments = True
@@ -221,7 +229,7 b' class ChangesetController(BaseRepoContro'
221 ign_whitespace_lcl = get_ignore_ws(fid, request.GET)
229 ign_whitespace_lcl = get_ignore_ws(fid, request.GET)
222 lim = self.cut_off_limit
230 lim = self.cut_off_limit
223 if cumulative_diff > self.cut_off_limit:
231 if cumulative_diff > self.cut_off_limit:
224 lim = -1
232 lim = -1 if limit_off is None else None
225 size, cs1, cs2, diff, st = wrapped_diff(
233 size, cs1, cs2, diff, st = wrapped_diff(
226 filenode_old=None,
234 filenode_old=None,
227 filenode_new=node,
235 filenode_new=node,
@@ -252,7 +260,7 b' class ChangesetController(BaseRepoContro'
252 ign_whitespace_lcl = get_ignore_ws(fid, request.GET)
260 ign_whitespace_lcl = get_ignore_ws(fid, request.GET)
253 lim = self.cut_off_limit
261 lim = self.cut_off_limit
254 if cumulative_diff > self.cut_off_limit:
262 if cumulative_diff > self.cut_off_limit:
255 lim = -1
263 lim = -1 if limit_off is None else None
256 size, cs1, cs2, diff, st = wrapped_diff(
264 size, cs1, cs2, diff, st = wrapped_diff(
257 filenode_old=filenode_old,
265 filenode_old=filenode_old,
258 filenode_new=node,
266 filenode_new=node,
@@ -145,7 +145,7 b' class BaseModel(object):'
145 def delete(cls, id_):
145 def delete(cls, id_):
146 obj = cls.query().get(id_)
146 obj = cls.query().get(id_)
147 Session.delete(obj)
147 Session.delete(obj)
148
148
149 def __repr__(self):
149 def __repr__(self):
150 if hasattr(self, '__unicode__'):
150 if hasattr(self, '__unicode__'):
151 # python repr needs to return str
151 # python repr needs to return str
@@ -518,7 +518,7 b' class Repository(Base, BaseModel):'
518 logs = relationship('UserLog')
518 logs = relationship('UserLog')
519
519
520 def __unicode__(self):
520 def __unicode__(self):
521 return u"<%s('%s:%s')>" % (self.__class__.__name__,self.repo_id,
521 return u"<%s('%s:%s')>" % (self.__class__.__name__,self.repo_id,
522 self.repo_name)
522 self.repo_name)
523
523
524 @classmethod
524 @classmethod
@@ -36,8 +36,8 b''
36 <div class="diff-actions">
36 <div class="diff-actions">
37 <a href="${h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='show')}" title="${_('raw diff')}" class="tooltip"><img class="icon" src="${h.url('/images/icons/page_white.png')}"/></a>
37 <a href="${h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='show')}" title="${_('raw diff')}" class="tooltip"><img class="icon" src="${h.url('/images/icons/page_white.png')}"/></a>
38 <a href="${h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='download')}" title="${_('download diff')}" class="tooltip"><img class="icon" src="${h.url('/images/icons/page_white_get.png')}"/></a>
38 <a href="${h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='download')}" title="${_('download diff')}" class="tooltip"><img class="icon" src="${h.url('/images/icons/page_white_get.png')}"/></a>
39 ${c.ignorews_url()}
39 ${c.ignorews_url(request.GET)}
40 ${c.context_url()}
40 ${c.context_url(request.GET)}
41 </div>
41 </div>
42 <div class="comments-number" style="float:right;padding-right:5px">${len(c.comments)} comment(s) (${c.inline_cnt} ${_('inline')})</div>
42 <div class="comments-number" style="float:right;padding-right:5px">${len(c.comments)} comment(s) (${c.inline_cnt} ${_('inline')})</div>
43 </div>
43 </div>
@@ -91,14 +91,14 b''
91 </div>
91 </div>
92 </div>
92 </div>
93 <span>
93 <span>
94 ${_('%s files affected with %s additions and %s deletions:') % (len(c.changeset.affected_files),c.lines_added,c.lines_deleted)}
94 ${_('%s files affected with %s insertions and %s deletions:') % (len(c.changeset.affected_files),c.lines_added,c.lines_deleted)}
95 </span>
95 </span>
96 <div class="cs_files">
96 <div class="cs_files">
97 %for change,filenode,diff,cs1,cs2,stat in c.changes:
97 %for change,filenode,diff,cs1,cs2,stat in c.changes:
98 <div class="cs_${change}">
98 <div class="cs_${change}">
99 <div class="node">
99 <div class="node">
100 %if change != 'removed':
100 %if change != 'removed':
101 ${h.link_to(h.safe_unicode(filenode.path),c.anchor_url(filenode.changeset.raw_id,filenode.path)+"_target")}
101 ${h.link_to(h.safe_unicode(filenode.path),c.anchor_url(filenode.changeset.raw_id,filenode.path,request.GET)+"_target")}
102 %else:
102 %else:
103 ${h.link_to(h.safe_unicode(filenode.path),h.url.current(anchor=h.FID('',filenode.path)))}
103 ${h.link_to(h.safe_unicode(filenode.path),h.url.current(anchor=h.FID('',filenode.path)))}
104 %endif
104 %endif
@@ -19,8 +19,8 b''
19 <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='diff',fulldiff=1)}" title="${_('diff')}" class="tooltip"><img class="icon" src="${h.url('/images/icons/page_white_go.png')}"/></a>
19 <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='diff',fulldiff=1)}" title="${_('diff')}" class="tooltip"><img class="icon" src="${h.url('/images/icons/page_white_go.png')}"/></a>
20 <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='raw')}" title="${_('raw diff')}" class="tooltip"><img class="icon" src="${h.url('/images/icons/page_white.png')}"/></a>
20 <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='raw')}" title="${_('raw diff')}" class="tooltip"><img class="icon" src="${h.url('/images/icons/page_white.png')}"/></a>
21 <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='download')}" title="${_('download diff')}" class="tooltip"><img class="icon" src="${h.url('/images/icons/page_white_get.png')}"/></a>
21 <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='download')}" title="${_('download diff')}" class="tooltip"><img class="icon" src="${h.url('/images/icons/page_white_get.png')}"/></a>
22 ${c.ignorews_url(h.FID(filenode.changeset.raw_id,filenode.path))}
22 ${c.ignorews_url(request.GET, h.FID(filenode.changeset.raw_id,filenode.path))}
23 ${c.context_url(h.FID(filenode.changeset.raw_id,filenode.path))}
23 ${c.context_url(request.GET, h.FID(filenode.changeset.raw_id,filenode.path))}
24 </div>
24 </div>
25 <span style="float:right;margin-top:-3px">
25 <span style="float:right;margin-top:-3px">
26 <label>
26 <label>
General Comments 0
You need to be logged in to leave comments. Login now