added network graph page
|
1 |
<% |
2 |
my $user = param('user'); |
|
3 |
my $project = param('project'); |
|
improved network graph page ...
|
4 |
my $branch = param('rev1'); |
5 |
my $rev2_abs = param('rev2_abs'); |
|
6 |
my ($remote_user, $remote_project, $remote_branch) = split /\//, $rev2_abs, 3; |
|
added network graph page
|
7 |
|
cleanup import_branch
|
8 |
my $commits = app->git->get_commits(app->rep_info($user, $project), $branch, 100); |
revert encoding support
|
9 |
my $remote_commits = app->git->get_commits( |
cleanup import_branch
|
10 |
app->rep_info($remote_user, $remote_project), |
improved network graph page ...
|
11 |
$remote_branch, |
12 |
100 |
|
added network graph page
|
13 |
); |
improved network page design
|
14 |
|
15 |
my $merged_commits_h = {}; |
|
16 |
for my $commit (@$commits) { |
|
17 |
my $id = $commit->{id}; |
|
18 |
$merged_commits_h->{$id} ||= {}; |
|
19 |
$merged_commits_h->{$id}{age} = $commit->{age}; |
|
support time zone
|
20 |
$merged_commits_h->{$id}{age_string_date_local} = $commit->{age_string_date_local}; |
improved network page design
|
21 |
$merged_commits_h->{$id}{title} = $commit->{title}; |
complete network graph
|
22 |
$merged_commits_h->{$id}{type} = 'local'; |
improved network page design
|
23 |
} |
24 |
for my $commit (@$remote_commits) { |
|
25 |
my $id = $commit->{id}; |
|
26 |
if ($merged_commits_h->{$id}) { |
|
complete network graph
|
27 |
$merged_commits_h->{$id}{type} = 'same'; |
improved network page design
|
28 |
} |
29 |
else { |
|
30 |
$merged_commits_h->{$id} ||= {}; |
|
31 |
$merged_commits_h->{$id}{age} = $commit->{age}; |
|
support time zone
|
32 |
$merged_commits_h->{$id}{age_string_date_local} = $commit->{age_string_date_local}; |
improved network page design
|
33 |
$merged_commits_h->{$id}{title} = $commit->{title}; |
complete network graph
|
34 |
$merged_commits_h->{$id}{type} = 'remote'; |
improved network page design
|
35 |
} |
36 |
} |
|
37 |
|
|
38 |
my $merged_commits = []; |
|
39 |
for my $id ( |
|
40 |
sort { $merged_commits_h->{$b}{age} <=> $merged_commits_h->{$a}{age}} |
|
41 |
keys %$merged_commits_h) |
|
42 |
{ |
|
43 |
my $commit = {%{$merged_commits_h->{$id}}}; |
|
44 |
$commit->{id} = $id; |
|
45 |
push @$merged_commits, $commit; |
|
46 |
} |
|
improve graph page design
|
47 | |
48 |
layout 'common', title => "Network Graph $user/$project/$branch...$rev2_abs"; |
|
added network graph page
|
49 |
%> |
50 | ||
improved network graph page ...
|
51 |
%= include 'include/header'; |
52 |
|
|
complete network graph
|
53 |
%= javascript begin |
54 |
$('document').ready(function () { |
|
55 |
// Scroll to right |
|
56 |
$('#graph').scrollLeft(1000); |
|
57 |
}); |
|
58 |
% end |
|
59 |
|
|
improved network graph page ...
|
60 |
<div class="container"> |
improve graph page design
|
61 |
<h3 class="topic1">Graph</h3> |
improved network graph page ...
|
62 |
<div style="margin-bottom:20px">Compare 100 commits.</div> |
improved network graph page ...
|
63 |
<div style="margin-bottom:10px"> |
add pull page design
|
64 |
<span style="color:blue;font-size:22px"><%= "$user / $project / $branch" %></span> |
improved network graph page ...
|
65 |
</div> |
improve graph page design
|
66 |
<div id="graph" class="graph-diff"> |
improved network graph page ...
|
67 |
<table> |
complete network graph
|
68 |
% for my $type (qw/local same remote/) { |
69 |
<tr style="height:40px"> |
|
70 |
% for (my $i = 0; $i < @$merged_commits; $i++) { |
|
71 |
% my $commit = $merged_commits->[$i]; |
|
72 |
% my $color |
|
73 |
% = $type eq 'local' ? 'blue' |
|
74 |
% : $type eq 'same' ? 'gray' |
|
75 |
% : 'green'; |
|
76 | ||
77 |
% if ($commit->{type} eq $type) { |
|
78 |
<td> |
|
support time zone
|
79 |
<a style="color:<%= $color %>" href="<%= url_for("/$user/$project/commit/$commit->{id}") %>" title="<%= "$commit->{title}($commit->{age_string_date_local})" %>">●</a> |
complete network graph
|
80 |
</td> |
81 |
% } else { |
|
82 |
<td></td> |
|
83 |
% } |
|
84 |
<td style="color:#ddd">-</td> |
|
improved network page design
|
85 |
% } |
complete network graph
|
86 |
</tr> |
87 |
% } |
|
improved network graph page ...
|
88 |
</table> |
89 |
</div> |
|
improve graph page design
|
90 |
|
91 |
<div class="graph-document"> |
|
92 |
<div style="margin-bottom:30px"> |
|
93 |
<span style="color:green;font-size:22px"><%= "$remote_user / $remote_project / $remote_branch" %></span> |
|
94 |
</div> |
|
95 |
<hr> |
|
96 |
<div style="margin-bottom:15px"> |
|
97 |
<h4 class="topic1">Merging via command line</h4> |
|
98 |
you can perform a manual merge on the command line. |
|
99 |
</div> |
|
add the way to merge other u...
|
100 | |
improve graph page design
|
101 |
<b>Step 1:</b> If you don't add user remote repository, add it. |
102 |
<pre> |
|
add the way to merge other u...
|
103 |
git remote add <%= $remote_user %> <%= url_for("/$remote_user/$remote_project.git")->to_abs %> |
improve graph page design
|
104 |
</pre> |
add the way to merge other u...
|
105 | |
improve graph page design
|
106 |
<b>Step 2:</b> From your project repository, bring in the changes and test. |
107 |
<pre class="well" style="background:#333333;color:white;padding:20px 20px 0px 20px;"> |
|
add the way to merge other u...
|
108 |
git remote update |
109 |
git fetch |
|
110 |
git checkout -b <%= "$remote_user-$remote_branch" %> <%= "$remote_user/$remote_branch" %> |
|
111 |
git merge <%= $branch %> |
|
improve graph page design
|
112 |
</pre> |
113 |
|
|
114 |
<b>Step 3:</b> Merge the changes and update on GitHub. |
|
115 |
<pre class="well" style="background:#333333;color:white;padding:20px 20px 0px 20px;"> |
|
add the way to merge other u...
|
116 |
git checkout <%= $branch %> |
117 |
git merge <%= "$remote_user-$remote_branch" %> |
|
118 |
git push origin <%= $branch %> |
|
improve graph page design
|
119 |
</pre> |
120 |
</div> |
|
improved network graph page ...
|
121 |
</div> |
122 |
|
|
123 |
%= include '/include/footer'; |