summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-04-14 13:13:18 +0200
committerDouwe Maan <douwe@gitlab.com>2015-04-14 13:13:18 +0200
commitf6cb42f3d197b7920207088f5fa5f5161be90905 (patch)
treed8b55bbafe976ddc34b8eb76b1e61b33c1d39483
parentdfe659c16de6f9ad38e429b89131df20276e21d4 (diff)
downloadgitlab-ce-f6cb42f3d197b7920207088f5fa5f5161be90905.tar.gz
Add comment number to imported Google Code comments.
-rw-r--r--lib/gitlab/google_code_import/importer.rb6
-rw-r--r--spec/lib/gitlab/google_code_import/importer_spec.rb1
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/gitlab/google_code_import/importer.rb b/lib/gitlab/google_code_import/importer.rb
index 07eccfa4db8..eaa8c6bc6d3 100644
--- a/lib/gitlab/google_code_import/importer.rb
+++ b/lib/gitlab/google_code_import/importer.rb
@@ -52,7 +52,7 @@ module Gitlab
deleted_issues = []
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
last_id += 1
@@ -116,14 +116,14 @@ module Gitlab
end
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")
author = mask_email(raw_comment["author"]["name"])
date = DateTime.parse(raw_comment["published"]).to_formatted_s(:long)
body = []
- body << "*By #{author} on #{date}*"
+ body << "*Comment #{raw_comment["id"]} by #{author} on #{date}*"
body << "---"
content = format_content(raw_comment["content"])
diff --git a/spec/lib/gitlab/google_code_import/importer_spec.rb b/spec/lib/gitlab/google_code_import/importer_spec.rb
index 9ff972b2111..370d4410104 100644
--- a/spec/lib/gitlab/google_code_import/importer_spec.rb
+++ b/spec/lib/gitlab/google_code_import/importer_spec.rb
@@ -57,6 +57,7 @@ describe Gitlab::GoogleCodeImport::Importer do
note = project.issues.first.notes.first
expect(note).to_not be_nil
+ expect(note.note).to include("Comment 1")
expect(note.note).to include("thilo...")
expect(note.note).to include("November 18, 2009 05:14")
expect(note.note).to include("applied, thanks.")