diff options
author | Valery Sizov <valery@gitlab.com> | 2016-12-19 20:44:57 +0200 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2016-12-19 20:48:08 +0200 |
commit | 5b0ebbe5b4c18c136aad2a53898c1a6441d39a9d (patch) | |
tree | a984bf0c2ff5fa499ae66a01e266c1c04bec4799 /lib/gitlab/bitbucket_import/importer.rb | |
parent | 2c49c1af660a8e69446be442df81f9beaf0cf168 (diff) | |
download | gitlab-ce-5b0ebbe5b4c18c136aad2a53898c1a6441d39a9d.tar.gz |
Add Wiki import to BB importer
Diffstat (limited to 'lib/gitlab/bitbucket_import/importer.rb')
-rw-r--r-- | lib/gitlab/bitbucket_import/importer.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/gitlab/bitbucket_import/importer.rb b/lib/gitlab/bitbucket_import/importer.rb index 7d2f92d577a..44323b47dca 100644 --- a/lib/gitlab/bitbucket_import/importer.rb +++ b/lib/gitlab/bitbucket_import/importer.rb @@ -1,6 +1,8 @@ module Gitlab module BitbucketImport class Importer + include Gitlab::ShellAdapter + LABELS = [{ title: 'bug', color: '#FF0000' }, { title: 'enhancement', color: '#428BCA' }, { title: 'proposal', color: '#69D100' }, @@ -18,6 +20,7 @@ module Gitlab end def execute + import_wiki import_issues import_pull_requests handle_errors @@ -55,6 +58,16 @@ module Gitlab @repo ||= client.repo(project.import_source) end + def import_wiki + return if project.wiki.repository_exists? + + path_with_namespace = "#{project.path_with_namespace}.wiki" + import_url = project.import_url.sub(/\.git\z/, ".git/wiki") + gitlab_shell.import_repository(project.repository_storage_path, path_with_namespace, import_url) + rescue StandardError => e + errors << { type: :wiki, errors: e.message } + end + def import_issues return unless repo.issues_enabled? |