|
Pierre-Yves Chibon |
706f31 |
{% extends "repo_master.html" %}
|
|
Pierre-Yves Chibon |
7732a9 |
{% from "_formhelper.html" import render_field_in_row %}
|
|
Pierre-Yves Chibon |
006f93 |
|
|
Pierre-Yves Chibon |
f67de7 |
{% block title %}Pull request #{{ requestid }} - {{ repo.name }}{% endblock %}
|
|
Pierre-Yves Chibon |
006f93 |
{%block tag %}home{% endblock %}
|
|
Pierre-Yves Chibon |
006f93 |
|
|
Pierre-Yves Chibon |
006f93 |
|
|
Pierre-Yves Chibon |
706f31 |
{% block repo %}
|
|
Pierre-Yves Chibon |
006f93 |
|
|
Pierre-Yves Chibon |
006f93 |
Request pull
|
|
Pierre-Yves Chibon |
ea8735 |
|
|
Pierre-Yves Chibon |
006f93 |
{{ repo.name }}
|
|
Pierre-Yves Chibon |
006f93 |
|
|
Pierre-Yves Chibon |
006f93 |
|
|
Pierre-Yves Chibon |
ea8735 |
(
|
|
Pierre-Yves Chibon |
006f93 |
repo=repo.name, identifier=commitid) }}"
|
|
Pierre-Yves Chibon |
006f93 |
>tree)
|
|
Pierre-Yves Chibon |
006f93 |
|
|
Pierre-Yves Chibon |
006f93 |
|
|
Pierre-Yves Chibon |
006f93 |
|
|
Pierre-Yves Chibon |
87ba70 |
{% if pull_request %}
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
Title: {{ pull_request.title }}
|
|
Johan Cwiklinski |
d22157 |
|
|
Pierre-Yves Chibon |
87ba70 |
{% if pull_request.status and repo_admin %}
|
|
Johan Cwiklinski |
d22157 |
|
|
Pierre-Yves Chibon |
7c99eb |
|
|
Pierre-Yves Chibon |
7c99eb |
repo=repo.name, requestid=requestid) }}" method="POST">
|
|
Pierre-Yves Chibon |
7c99eb |
{{ mergeform.csrf_token }}
|
|
Pierre-Yves Chibon |
7c99eb |
<input class="button" type="submit" value="Merge">
|
|
Pierre-Yves Chibon |
7c99eb |
|
|
Pierre-Yves Chibon |
7c99eb |
|
|
Pierre-Yves Chibon |
7c99eb |
|
|
Pierre-Yves Chibon |
7c99eb |
|
|
Pierre-Yves Chibon |
7c99eb |
repo=repo.name, requestid=requestid) }}" method="POST">
|
|
Pierre-Yves Chibon |
7c99eb |
{{ mergeform.csrf_token }}
|
|
Pierre-Yves Chibon |
7c99eb |
<input class="button" id="cancel_pr" type="submit" value="Cancel">
|
|
Pierre-Yves Chibon |
7c99eb |
|
|
Pierre-Yves Chibon |
7c99eb |
|
|
Pierre-Yves Chibon |
87ba70 |
{% elif pull_request and pull_request.status == False %}
|
|
Johan Cwiklinski |
d22157 |
|
|
Pierre-Yves Chibon |
7c99eb |
Merged
|
|
Johan Cwiklinski |
d22157 |
|
|
Pierre-Yves Chibon |
706f31 |
{% endif %}
|
|
Pierre-Yves Chibon |
7c99eb |
|
|
Pierre-Yves Chibon |
7c99eb |
|
|
Pierre-Yves Chibon |
7c99eb |
repo=repo.name, requestid=requestid) }}">Patch
|
|
Pierre-Yves Chibon |
7c99eb |
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
|
|
Pierre-Yves Chibon |
7732a9 |
{% endif %}
|
|
Pierre-Yves Chibon |
7732a9 |
|
|
Pierre-Yves Chibon |
7732a9 |
{% if form %}
|
|
Pierre-Yves Chibon |
7732a9 |
<section class="new_project"></section>
|
|
Pierre-Yves Chibon |
7732a9 |
|
|
Pierre-Yves Chibon |
7732a9 |
repo=repo.name, commitid=commitid) }}" method="post">
|
|
Pierre-Yves Chibon |
7732a9 |
|
|
Pierre-Yves Chibon |
7732a9 |
{{ render_field_in_row(form.title) }}
|
|
Pierre-Yves Chibon |
071f09 |
|
|
Pierre-Yves Chibon |
071f09 |
To branch
|
|
Pierre-Yves Chibon |
071f09 |
|
|
Pierre-Yves Chibon |
071f09 |
<select id="branch_select"></select>
|
|
Pierre-Yves Chibon |
071f09 |
<option>{{ branchname }}</option>
|
|
Pierre-Yves Chibon |
071f09 |
{% for branch in branches |reverse %}
|
|
Pierre-Yves Chibon |
071f09 |
{% if branch != branchname %}
|
|
Pierre-Yves Chibon |
071f09 |
<option>{{ branch }}</option>
|
|
Pierre-Yves Chibon |
071f09 |
{% endif %}
|
|
Pierre-Yves Chibon |
071f09 |
{% endfor %}
|
|
Pierre-Yves Chibon |
071f09 |
|
|
Pierre-Yves Chibon |
071f09 |
|
|
Pierre-Yves Chibon |
071f09 |
|
|
Pierre-Yves Chibon |
7732a9 |
|
|
Pierre-Yves Chibon |
7732a9 |
|
|
Pierre-Yves Chibon |
7732a9 |
<input class="submit positive button" type="submit" value="Create">
|
|
Pierre-Yves Chibon |
7732a9 |
{{ form.csrf_token }}
|
|
Pierre-Yves Chibon |
856159 |
|
|
Pierre-Yves Chibon |
856159 |
<input type="button" value="Cancel">
|
|
Pierre-Yves Chibon |
856159 |
|
|
Pierre-Yves Chibon |
7732a9 |
|
|
Pierre-Yves Chibon |
7732a9 |
|
|
Pierre-Yves Chibon |
7732a9 |
|
|
Pierre-Yves Chibon |
7732a9 |
{% endif %}
|
|
Pierre-Yves Chibon |
7732a9 |
|
|
Pierre-Yves Chibon |
7c99eb |
<section class="commit_list"></section>
|
|
Pierre-Yves Chibon |
7c99eb |
|
|
Pierre-Yves Chibon |
7c99eb |
{% for commit in diff_commits %}
|
|
Pierre-Yves Chibon |
7c99eb |
|
|
Pierre-Yves Chibon |
7c99eb |
{% if pull_request and pull_request.status and pull_request.repo_from.is_fork %}
|
|
Pierre-Yves Chibon |
7c99eb |
|
|
Pierre-Yves Chibon |
7c99eb |
repo=pull_request.repo_from.name, commitid=commit.oid.hex)}}">
|
|
Pierre-Yves Chibon |
7c99eb |
{% else %}
|
|
Pierre-Yves Chibon |
7c99eb |
|
|
Pierre-Yves Chibon |
7c99eb |
repo=repo.name, commitid=commit.oid.hex)}}">
|
|
Pierre-Yves Chibon |
7c99eb |
{% endif %}
|
|
Pierre-Yves Chibon |
7c99eb |
{{ commit.oid.hex|short }}
|
|
Pierre-Yves Chibon |
7c99eb |
{{ commit.message.split('\n')[0] }}
|
|
Pierre-Yves Chibon |
7c99eb |
|
|
Pierre-Yves Chibon |
7c99eb |
|
|
Pierre-Yves Chibon |
87d2ff |
{% else %}
|
|
Pierre-Yves Chibon |
87d2ff |
No commits found
|
|
Pierre-Yves Chibon |
7c99eb |
{% endfor %}
|
|
Pierre-Yves Chibon |
7c99eb |
|
|
Pierre-Yves Chibon |
7c99eb |
|
|
Pierre-Yves Chibon |
7c99eb |
|
|
Pierre-Yves Chibon |
006f93 |
<section class="request_diff"></section>
|
|
Johan Cwiklinski |
d22157 |
{% for commit in diff_commits %}
|
|
Johan Cwiklinski |
d22157 |
{% set splitted_message = commit.message.split('\n') %}
|
|
Johan Cwiklinski |
d22157 |
{% set diff = diffs[loop.index - 1] %}
|
|
Johan Cwiklinski |
d22157 |
{% set commitid = commit.oid.hex %}
|
|
Pierre-Yves Chibon |
006f93 |
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
{{ splitted_message[0] }}
|
|
Johan Cwiklinski |
d22157 |
(commit: {{ commitid|short }}
|
|
Johan Cwiklinski |
d22157 |
-
|
|
Johan Cwiklinski |
d22157 |
repo=repo.name, identifier=commitid) }}">tree)
|
|
Johan Cwiklinski |
d22157 |
{% if splitted_message|length > 1 %}
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
{% for message in splitted_message %}
|
|
Johan Cwiklinski |
d22157 |
{% if loop.index > 1 %}
|
|
Johan Cwiklinski |
d22157 |
{{ message }}
|
|
Johan Cwiklinski |
d22157 |
{% endif %}
|
|
Johan Cwiklinski |
d22157 |
{% endfor %}
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
{% endif %}
|
|
Johan Cwiklinski |
d22157 |
|
|
Pierre-Yves Chibon |
006f93 |
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
Author
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
{{ commit.author.name }} {{ '<' + commit.author.email + '>' }}
|
|
Johan Cwiklinski |
d22157 |
- {{ commit.commit_time | format_ts}}
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
Committer
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
{{ commit.committer.name }} {{ '<' + commit.committer.email + '>' }}
|
|
Johan Cwiklinski |
d22157 |
- {{ commit.commit_time | format_ts }}
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
Parent
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
{% for parent in commit.parents %}
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
repo=repo.name, commitid=parent.oid.hex) }}">
|
|
Johan Cwiklinski |
d22157 |
{{ parent.oid.hex }}
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
{% endfor %}
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
Changes
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
{% for patch in diff %}
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
|
|
Pierre-Yves Chibon |
5bb7d0 |
{% if (patch.additions + patch.deletions) %}
|
|
Pierre-Yves Chibon |
f44656 |
|
|
Johan Cwiklinski |
d22157 |
{% if patch.additions > 0 %}+{{ patch.additions }}{% endif %}
|
|
Johan Cwiklinski |
d22157 |
{% if patch.deletions > 0 %}-{{ patch.deletions }}{% endif %}
|
|
Pierre-Yves Chibon |
f44656 |
|
|
Pierre-Yves Chibon |
c2a541 |
{% endif %}
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
{{ patch.new_file_path }}
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
{% endfor %}
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
{% for patch in diff %}
|
|
Johan Cwiklinski |
d22157 |
<section class="commit_diff"></section>
|
|
Johan Cwiklinski |
d22157 |
<header></header>
|
|
Johan Cwiklinski |
d22157 |
{{ patch.new_file_path }}
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
|
|
Pierre-Yves Chibon |
5bb7d0 |
{% if (patch.additions + patch.deletions) %}
|
|
Pierre-Yves Chibon |
f44656 |
|
|
Johan Cwiklinski |
d22157 |
{% if patch.additions > 0 %}+{{ patch.additions }}{% endif %}
|
|
Johan Cwiklinski |
d22157 |
{% if patch.deletions > 0 %}-{{ patch.deletions }}{% endif %}
|
|
Johan Cwiklinski |
d22157 |
|
|
Pierre-Yves Chibon |
f44656 |
{% endif %}
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
repo=repo.name, identifier=commitid,
|
|
Johan Cwiklinski |
d22157 |
filename=patch.new_file_path) }}" title="View file as of {{ commitid|short }}">View
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
{% if patch.is_binary %}
|
|
Johan Cwiklinski |
d22157 |
Binary diffs cannot be rendered.
|
|
Johan Cwiklinski |
d22157 |
{% else %}
|
|
Johan Cwiklinski |
d22157 |
{% autoescape false %}
|
|
Johan Cwiklinski |
d22157 |
{{ patch|patch_to_diff|html_diff|format_loc(diff_commits[loop.index - 1], pull_request,
|
|
Johan Cwiklinski |
d22157 |
index=loop.index)}}
|
|
Johan Cwiklinski |
d22157 |
{% endautoescape %}
|
|
Johan Cwiklinski |
d22157 |
{% endif %}
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
|
|
Johan Cwiklinski |
d22157 |
{% endfor %}
|
|
Pierre-Yves Chibon |
006f93 |
{% endfor %}
|
|
Pierre-Yves Chibon |
006f93 |
|
|
Pierre-Yves Chibon |
006f93 |
|
|
Pierre-Yves Chibon |
267613 |
|
|
Pierre-Yves Chibon |
267613 |
{% endblock %}
|
|
Pierre-Yves Chibon |
267613 |
|
|
Pierre-Yves Chibon |
267613 |
{% block jscripts %}
|
|
Pierre-Yves Chibon |
267613 |
{{ super() }}
|
|
Pierre-Yves Chibon |
267613 |
<script type="text/javascript"></script>
|
|
Pierre-Yves Chibon |
071f09 |
$(function(){
|
|
Pierre-Yves Chibon |
071f09 |
$( "#branch_select" ).change(
|
|
Pierre-Yves Chibon |
071f09 |
function() {
|
|
Pierre-Yves Chibon |
bc7e3f |
var url = $(location).attr('href').split('?')[0];
|
|
Pierre-Yves Chibon |
bc7e3f |
var params = $(location).attr('search').replace('?', '').split('&');
|
|
Pierre-Yves Chibon |
071f09 |
var sel = $('#branch_select');
|
|
Pierre-Yves Chibon |
bc7e3f |
/* Check all the current argument in the URL */
|
|
Pierre-Yves Chibon |
bc7e3f |
var changed = false;
|
|
Pierre-Yves Chibon |
bc7e3f |
for (i = 0; i < params.length; i++) {
|
|
Pierre-Yves Chibon |
bc7e3f |
/* If we find branch=, updated it */
|
|
Pierre-Yves Chibon |
bc7e3f |
if (params[i].match("^branch=")) {
|
|
Pierre-Yves Chibon |
bc7e3f |
params[i] = 'branch=' + sel.val();
|
|
Pierre-Yves Chibon |
bc7e3f |
changed = true;
|
|
Pierre-Yves Chibon |
bc7e3f |
}
|
|
Pierre-Yves Chibon |
bc7e3f |
}
|
|
Pierre-Yves Chibon |
bc7e3f |
/* Otherwise add it */
|
|
Pierre-Yves Chibon |
bc7e3f |
if (!changed) {
|
|
Pierre-Yves Chibon |
bc7e3f |
params.push('branch=' + sel.val());
|
|
Pierre-Yves Chibon |
bc7e3f |
}
|
|
Pierre-Yves Chibon |
bc7e3f |
var final_url = url + '?' + params.join('&');
|
|
Pierre-Yves Chibon |
bc7e3f |
window.location.href = final_url;
|
|
Pierre-Yves Chibon |
071f09 |
}
|
|
Pierre-Yves Chibon |
071f09 |
);
|
|
Johan Cwiklinski |
86d9c4 |
|
|
Johan Cwiklinski |
86d9c4 |
$('#cancel_pr').click(function(){
|
|
Johan Cwiklinski |
bad8e4 |
return window.confirm("Are you sure you want to cancel this requested pull?");
|
|
Johan Cwiklinski |
86d9c4 |
});
|
|
Pierre-Yves Chibon |
071f09 |
});
|
|
Pierre-Yves Chibon |
071f09 |
|
|
Pierre-Yves Chibon |
267613 |
function comment() {
|
|
Pierre-Yves Chibon |
267613 |
$( ".cancel" ).click(
|
|
Pierre-Yves Chibon |
267613 |
function() {
|
|
Pierre-Yves Chibon |
267613 |
$(this).parent().parent().parent().parent().remove();
|
|
Pierre-Yves Chibon |
267613 |
}
|
|
Pierre-Yves Chibon |
267613 |
);
|
|
Pierre-Yves Chibon |
267613 |
};
|
|
Pierre-Yves Chibon |
267613 |
|
|
Pierre-Yves Chibon |
267613 |
$(function(){
|
|
Pierre-Yves Chibon |
267613 |
$( "tr" ).hover(
|
|
Pierre-Yves Chibon |
267613 |
function() {
|
|
Pierre-Yves Chibon |
267613 |
$( this ).find( "img" ).show().width(13);
|
|
Pierre-Yves Chibon |
267613 |
}, function() {
|
|
Pierre-Yves Chibon |
267613 |
$( this ).find( "img" ).hide();
|
|
Pierre-Yves Chibon |
267613 |
}
|
|
Pierre-Yves Chibon |
267613 |
);
|
|
Pierre-Yves Chibon |
267613 |
|
|
Pierre-Yves Chibon |
267613 |
$( ".prc" ).click(
|
|
Pierre-Yves Chibon |
267613 |
function() {
|
|
Pierre-Yves Chibon |
267613 |
var row = $( this ).attr('data-row');
|
|
Pierre-Yves Chibon |
267613 |
var commit = $( this ).attr('data-commit');
|
|
Pierre-Yves Chibon |
267613 |
var url = "{{ url_for(
|
|
Pierre-Yves Chibon |
267613 |
'pull_request_add_comment', username=username, repo=repo.name,
|
|
Pierre-Yves Chibon |
267613 |
requestid=requestid, commit='', row='') }}".slice(0, -1);
|
|
Pierre-Yves Chibon |
267613 |
url = url + commit + '/' + row;
|
|
Pierre-Yves Chibon |
9738dc |
var rowid = $(this).prev().find('a').attr('id');
|
|
Pierre-Yves Chibon |
c4550f |
var table = $( this ).parent().parent();
|
|
Pierre-Yves Chibon |
9738dc |
var nextid = rowid.replace('_' + row, '_' + (Number(row) + 1));
|
|
Pierre-Yves Chibon |
9738dc |
var next_row = table.find('#' + nextid).parent().parent();
|
|
Pierre-Yves Chibon |
c4550f |
if (next_row.prev().find('.pr_comment_form').length == 0){
|
|
Pierre-Yves Chibon |
267613 |
$.get( url , function( data ) {
|
|
Pierre-Yves Chibon |
be1f52 |
next_row.before(
|
|
Pierre-Yves Chibon |
be1f52 |
'' + data + '' );
|
|
Pierre-Yves Chibon |
267613 |
comment();
|
|
Pierre-Yves Chibon |
267613 |
});
|
|
Pierre-Yves Chibon |
55a67c |
} else {
|
|
Pierre-Yves Chibon |
0c2372 |
next_row.prev().find('.pr_comment_form').parent().remove();
|
|
Pierre-Yves Chibon |
267613 |
}
|
|
Pierre-Yves Chibon |
267613 |
}
|
|
Pierre-Yves Chibon |
267613 |
);
|
|
Pierre-Yves Chibon |
267613 |
|
|
Pierre-Yves Chibon |
267613 |
});
|
|
Pierre-Yves Chibon |
267613 |
|
|
Pierre-Yves Chibon |
006f93 |
{% endblock %}
|