Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
gitlab-ce
Commits
f5e001bd
Commit
f5e001bd
authored
Mar 22, 2013
by
Sato Hiroyuki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Using arrowed line only if it connects to not first parent.
It is easy to see which branch is merged.
parent
26606aa2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
43 deletions
+44
-43
app/assets/javascripts/branch-graph.js.coffee
app/assets/javascripts/branch-graph.js.coffee
+44
-43
No files found.
app/assets/javascripts/branch-graph.js.coffee
View file @
f5e001bd
...
@@ -191,56 +191,57 @@ class BranchGraph
...
@@ -191,56 +191,57 @@ class BranchGraph
drawLines
:
(
x
,
y
,
commit
)
->
drawLines
:
(
x
,
y
,
commit
)
->
r
=
@
r
r
=
@
r
for
parent
in
commit
.
parents
for
parent
,
i
in
commit
.
parents
parentCommit
=
@
preparedCommits
[
parent
[
0
]]
parentCommit
=
@
preparedCommits
[
parent
[
0
]]
parentY
=
@
offsetY
+
@
unitTime
*
parentCommit
.
time
parentY
=
@
offsetY
+
@
unitTime
*
parentCommit
.
time
parentX1
=
@
offsetX
+
@
unitSpace
*
(
@
mspace
-
parentCommit
.
space
)
parentX1
=
@
offsetX
+
@
unitSpace
*
(
@
mspace
-
parentCommit
.
space
)
parentX2
=
@
offsetX
+
@
unitSpace
*
(
@
mspace
-
parent
[
1
])
parentX2
=
@
offsetX
+
@
unitSpace
*
(
@
mspace
-
parent
[
1
])
if
parentCommit
.
space
is
commit
.
space
and
parentCommit
.
space
is
parent
[
1
]
# Set line color
r
.
path
([
"M"
,
x
,
y
,
"L"
,
parentX1
,
parentY
]).
attr
(
if
parentCommit
.
space
<=
commit
.
space
stroke
:
@
colors
[
parentCommit
.
space
]
color
=
@
colors
[
commit
.
space
]
"stroke-width"
:
2
)
else
if
parentCommit
.
space
<
commit
.
space
else
if
x
is
parentX2
color
=
@
colors
[
parentCommit
.
space
]
r
.
path
([
# Build line shape
"M"
,
x
,
y
+
5
,
if
parent
[
1
]
is
commit
.
space
"l-2,5,4,0,-2,-5"
,
d1
=
[
0
,
5
]
"L"
,
x
,
y
+
10
,
d2
=
[
0
,
10
]
"L"
,
parentX2
,
y
+
10
,
arrow
=
"l-2,5,4,0,-2,-5"
"L"
,
parentX2
,
parentY
-
5
,
"L"
,
parentX1
,
parentY
])
else
if
parent
[
1
]
<
commit
.
space
.
attr
(
d1
=
[
3
,
3
]
stroke
:
@
colors
[
commit
.
space
]
d2
=
[
7
,
5
]
"stroke-width"
:
2
)
arrow
=
"l5,0,-2,4,-3,-4"
else
else
r
d1
=
[
-
3
,
3
]
.
path
([
d2
=
[
-
7
,
5
]
"M"
,
x
+
3
,
y
+
3
,
arrow
=
"l-5,0,2,4,3,-4"
"l5,0,-2,4,-3,-4"
,
"L"
,
x
+
7
,
y
+
5
,
# Start point
route
=
[
"M"
,
x
+
d1
[
0
],
y
+
d1
[
1
]]
# Add arrow if not first parent
if
i
>
0
route
.
push
(
arrow
)
# Circumvent if overlap
if
commit
.
space
isnt
parentCommit
.
space
or
commit
.
space
isnt
parent
[
1
]
route
.
push
(
"L"
,
x
+
d2
[
0
],
y
+
d2
[
1
],
"L"
,
parentX2
,
y
+
10
,
"L"
,
parentX2
,
y
+
10
,
"L"
,
parentX2
,
parentY
-
5
,
"L"
,
parentX2
,
parentY
-
5
,
"L"
,
parentX1
,
parentY
]
)
)
.
attr
(
stroke
:
@
colors
[
commit
.
space
]
# End point
"stroke-width"
:
2
)
route
.
push
(
"L"
,
parentX1
,
parentY
)
else
r
r
.
path
([
.
path
(
route
)
"M"
,
x
-
3
,
y
+
3
,
"l-5,0,2,4,3,-4"
,
"L"
,
x
-
7
,
y
+
5
,
"L"
,
parentX2
,
y
+
10
,
"L"
,
parentX2
,
parentY
-
5
,
"L"
,
parentX1
,
parentY
])
.
attr
(
.
attr
(
stroke
:
@
colors
[
parentCommit
.
space
]
stroke
:
color
"stroke-width"
:
2
)
"stroke-width"
:
2
)
markCommit
:
(
x
,
y
,
commit
,
graphHeight
)
->
markCommit
:
(
x
,
y
,
commit
,
graphHeight
)
->
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment