diff --git a/rhodecode/controllers/changeset.py b/rhodecode/controllers/changeset.py --- a/rhodecode/controllers/changeset.py +++ b/rhodecode/controllers/changeset.py @@ -50,13 +50,14 @@ from rhodecode.model.meta import Session log = logging.getLogger(__name__) -def anchor_url(revision,path): +def anchor_url(revision, path): fid = h.FID(revision, path) - return h.url.current(anchor=fid,**request.GET) + return h.url.current(anchor=fid, **request.GET) + def get_ignore_ws(fid, GET): ig_ws_global = request.GET.get('ignorews') - ig_ws = filter(lambda k:k.startswith('WS'),GET.getall(fid)) + ig_ws = filter(lambda k: k.startswith('WS'), GET.getall(fid)) if ig_ws: try: return int(ig_ws[0].split(':')[-1]) @@ -64,6 +65,7 @@ def get_ignore_ws(fid, GET): pass return ig_ws_global + def _ignorews_url(fileid=None): params = defaultdict(list) @@ -88,14 +90,15 @@ def _ignorews_url(fileid=None): # if we have passed in ln_ctx pass it along to our params if ln_ctx: params[ctx_key] += [ctx_val] - + params['anchor'] = fileid return h.link_to(lbl, h.url.current(**params)) + def get_line_ctx(fid, GET): ln_ctx_global = request.GET.get('context') - ln_ctx = filter(lambda k:k.startswith('C'),GET.getall(fid)) - + ln_ctx = filter(lambda k: k.startswith('C'), GET.getall(fid)) + if ln_ctx: retval = ln_ctx[0].split(':')[-1] else: @@ -106,10 +109,11 @@ def get_line_ctx(fid, GET): except: return + def _context_url(fileid=None): """ Generates url for context lines - + :param fileid: """ ig_ws = get_ignore_ws(fileid, request.GET) @@ -131,7 +135,7 @@ def _context_url(fileid=None): params[fileid] += ['C:%s' % ln_ctx] ig_ws_key = fileid ig_ws_val = 'WS:%s' % 1 - + if ig_ws: params[ig_ws_key] += [ig_ws_val] @@ -140,14 +144,16 @@ def _context_url(fileid=None): params['anchor'] = fileid return h.link_to(lbl, h.url.current(**params)) + def wrap_to_table(str_): return '''
| - | %s |
+ %s |