##// END OF EJS Templates
diffs: add repo_name as parameter of diffset - fixes bug...
dan -
r1142:c6b41371 default
parent child Browse files
Show More
@@ -260,6 +260,7 b' class ChangesetController(BaseRepoContro'
260 return get_node
260 return get_node
261
261
262 diffset = codeblocks.DiffSet(
262 diffset = codeblocks.DiffSet(
263 repo_name=c.repo_name,
263 source_node_getter=_node_getter(commit1),
264 source_node_getter=_node_getter(commit1),
264 target_node_getter=_node_getter(commit2),
265 target_node_getter=_node_getter(commit2),
265 ).render_patchset(_parsed, commit1.raw_id, commit2.raw_id)
266 ).render_patchset(_parsed, commit1.raw_id, commit2.raw_id)
@@ -254,6 +254,7 b' class CompareController(BaseRepoControll'
254 return get_node
254 return get_node
255
255
256 c.diffset = codeblocks.DiffSet(
256 c.diffset = codeblocks.DiffSet(
257 repo_name=source_repo.repo_name,
257 source_node_getter=_node_getter(source_commit),
258 source_node_getter=_node_getter(source_commit),
258 target_node_getter=_node_getter(target_commit),
259 target_node_getter=_node_getter(target_commit),
259 ).render_patchset(_parsed, source_ref, target_ref)
260 ).render_patchset(_parsed, source_ref, target_ref)
@@ -352,7 +352,7 b' class DiffSet(object):'
352 # in the case of multiline code
352 # in the case of multiline code
353 HL_NONE = 'NONE' # no highlighting, fastest
353 HL_NONE = 'NONE' # no highlighting, fastest
354
354
355 def __init__(self, highlight_mode=HL_REAL,
355 def __init__(self, highlight_mode=HL_REAL, repo_name=None,
356 source_node_getter=lambda filename: None,
356 source_node_getter=lambda filename: None,
357 target_node_getter=lambda filename: None,
357 target_node_getter=lambda filename: None,
358 source_nodes=None, target_nodes=None,
358 source_nodes=None, target_nodes=None,
@@ -366,7 +366,7 b' class DiffSet(object):'
366 self.target_node_getter = target_node_getter
366 self.target_node_getter = target_node_getter
367 self.source_nodes = source_nodes or {}
367 self.source_nodes = source_nodes or {}
368 self.target_nodes = target_nodes or {}
368 self.target_nodes = target_nodes or {}
369
369 self.repo_name = repo_name
370
370
371 self.max_file_size_limit = max_file_size_limit
371 self.max_file_size_limit = max_file_size_limit
372
372
@@ -377,6 +377,7 b' class DiffSet(object):'
377 changed_files=0,
377 changed_files=0,
378 files=[],
378 files=[],
379 limited_diff=isinstance(patchset, LimitedDiffContainer),
379 limited_diff=isinstance(patchset, LimitedDiffContainer),
380 repo_name=self.repo_name,
380 source_ref=source_ref,
381 source_ref=source_ref,
381 target_ref=target_ref,
382 target_ref=target_ref,
382 ))
383 ))
@@ -65,7 +65,7 b' collapse_all = len(diffset.files) > coll'
65 <div class="diffset-heading ${diffset.limited_diff and 'diffset-heading-warning' or ''}">
65 <div class="diffset-heading ${diffset.limited_diff and 'diffset-heading-warning' or ''}">
66 %if commit:
66 %if commit:
67 <div class="pull-right">
67 <div class="pull-right">
68 <a class="btn tooltip" title="${_('Browse Files at revision {}').format(commit.raw_id)}" href="${h.url('files_home',repo_name=c.repo_name, revision=commit.raw_id, f_path='')}">
68 <a class="btn tooltip" title="${_('Browse Files at revision {}').format(commit.raw_id)}" href="${h.url('files_home',repo_name=diffset.repo_name, revision=commit.raw_id, f_path='')}">
69 ${_('Browse Files')}
69 ${_('Browse Files')}
70 </a>
70 </a>
71 </div>
71 </div>
@@ -256,7 +256,7 b' from rhodecode.lib.diffs import NEW_FILE'
256 %if filediff.patch['operation'] in ['D', 'M']:
256 %if filediff.patch['operation'] in ['D', 'M']:
257 <a
257 <a
258 class="tooltip"
258 class="tooltip"
259 href="${h.url('files_home',repo_name=c.repo_name,f_path=filediff.source_file_path,revision=filediff.diffset.source_ref)}"
259 href="${h.url('files_home',repo_name=filediff.diffset.repo_name,f_path=filediff.source_file_path,revision=filediff.diffset.source_ref)}"
260 title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}"
260 title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}"
261 >
261 >
262 ${_('Show file before')}
262 ${_('Show file before')}
@@ -272,7 +272,7 b' from rhodecode.lib.diffs import NEW_FILE'
272 %if filediff.patch['operation'] in ['A', 'M']:
272 %if filediff.patch['operation'] in ['A', 'M']:
273 <a
273 <a
274 class="tooltip"
274 class="tooltip"
275 href="${h.url('files_home',repo_name=c.repo_name,f_path=filediff.target_file_path,revision=filediff.diffset.target_ref)}"
275 href="${h.url('files_home',repo_name=filediff.diffset.repo_name,f_path=filediff.target_file_path,revision=filediff.diffset.target_ref)}"
276 title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}"
276 title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}"
277 >
277 >
278 ${_('Show file after')}
278 ${_('Show file after')}
@@ -288,14 +288,14 b' from rhodecode.lib.diffs import NEW_FILE'
288 <a
288 <a
289 class="tooltip"
289 class="tooltip"
290 title="${h.tooltip(_('Raw diff'))}"
290 title="${h.tooltip(_('Raw diff'))}"
291 href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=filediff.target_file_path,diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='raw')}"
291 href="${h.url('files_diff_home',repo_name=filediff.diffset.repo_name,f_path=filediff.target_file_path,diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='raw')}"
292 >
292 >
293 ${_('Raw diff')}
293 ${_('Raw diff')}
294 </a>
294 </a>
295 <a
295 <a
296 class="tooltip"
296 class="tooltip"
297 title="${h.tooltip(_('Download diff'))}"
297 title="${h.tooltip(_('Download diff'))}"
298 href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=filediff.target_file_path,diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='download')}"
298 href="${h.url('files_diff_home',repo_name=filediff.diffset.repo_name,f_path=filediff.target_file_path,diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='download')}"
299 >
299 >
300 ${_('Download diff')}
300 ${_('Download diff')}
301 </a>
301 </a>
General Comments 0
You need to be logged in to leave comments. Login now