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
Tatuya Kamada
gitlab-ce
Commits
f6cb42f3
Commit
f6cb42f3
authored
Apr 14, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add comment number to imported Google Code comments.
parent
dfe659c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
lib/gitlab/google_code_import/importer.rb
lib/gitlab/google_code_import/importer.rb
+3
-3
spec/lib/gitlab/google_code_import/importer_spec.rb
spec/lib/gitlab/google_code_import/importer_spec.rb
+1
-0
No files found.
lib/gitlab/google_code_import/importer.rb
View file @
f6cb42f3
...
@@ -52,7 +52,7 @@ module Gitlab
...
@@ -52,7 +52,7 @@ module Gitlab
deleted_issues
=
[]
deleted_issues
=
[]
issues
=
repo
.
raw_data
[
"issues"
][
"items"
]
issues
=
repo
.
raw_data
[
"issues"
][
"items"
]
issues
.
each
_with_index
do
|
raw_issue
,
i
|
issues
.
each
do
|
raw_issue
|
while
raw_issue
[
"id"
]
>
last_id
+
1
while
raw_issue
[
"id"
]
>
last_id
+
1
last_id
+=
1
last_id
+=
1
...
@@ -116,14 +116,14 @@ module Gitlab
...
@@ -116,14 +116,14 @@ module Gitlab
end
end
def
import_issue_comments
(
issue
,
comments
)
def
import_issue_comments
(
issue
,
comments
)
comments
.
each
_with_index
do
|
raw_comment
,
i
|
comments
.
each
do
|
raw_comment
|
next
if
raw_comment
.
has_key?
(
"deletedBy"
)
next
if
raw_comment
.
has_key?
(
"deletedBy"
)
author
=
mask_email
(
raw_comment
[
"author"
][
"name"
])
author
=
mask_email
(
raw_comment
[
"author"
][
"name"
])
date
=
DateTime
.
parse
(
raw_comment
[
"published"
]).
to_formatted_s
(
:long
)
date
=
DateTime
.
parse
(
raw_comment
[
"published"
]).
to_formatted_s
(
:long
)
body
=
[]
body
=
[]
body
<<
"*
B
y
#{
author
}
on
#{
date
}
*"
body
<<
"*
Comment
#{
raw_comment
[
"id"
]
}
b
y
#{
author
}
on
#{
date
}
*"
body
<<
"---"
body
<<
"---"
content
=
format_content
(
raw_comment
[
"content"
])
content
=
format_content
(
raw_comment
[
"content"
])
...
...
spec/lib/gitlab/google_code_import/importer_spec.rb
View file @
f6cb42f3
...
@@ -57,6 +57,7 @@ describe Gitlab::GoogleCodeImport::Importer do
...
@@ -57,6 +57,7 @@ describe Gitlab::GoogleCodeImport::Importer do
note
=
project
.
issues
.
first
.
notes
.
first
note
=
project
.
issues
.
first
.
notes
.
first
expect
(
note
).
to_not
be_nil
expect
(
note
).
to_not
be_nil
expect
(
note
.
note
).
to
include
(
"Comment 1"
)
expect
(
note
.
note
).
to
include
(
"thilo..."
)
expect
(
note
.
note
).
to
include
(
"thilo..."
)
expect
(
note
.
note
).
to
include
(
"November 18, 2009 05:14"
)
expect
(
note
.
note
).
to
include
(
"November 18, 2009 05:14"
)
expect
(
note
.
note
).
to
include
(
"applied, thanks."
)
expect
(
note
.
note
).
to
include
(
"applied, thanks."
)
...
...
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