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
d7accda1
Commit
d7accda1
authored
Aug 07, 2015
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show incompatible projects in Bitbucket import status
See #1871
parent
a1e6fc15
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
6 deletions
+37
-6
CHANGELOG
CHANGELOG
+1
-0
app/controllers/import/bitbucket_controller.rb
app/controllers/import/bitbucket_controller.rb
+1
-0
app/views/import/bitbucket/status.html.haml
app/views/import/bitbucket/status.html.haml
+28
-5
lib/gitlab/bitbucket_import/client.rb
lib/gitlab/bitbucket_import/client.rb
+4
-0
spec/controllers/import/bitbucket_controller_spec.rb
spec/controllers/import/bitbucket_controller_spec.rb
+3
-1
No files found.
CHANGELOG
View file @
d7accda1
Please view this file on the master branch, on stable branches it's out of date.
v 7.14.0 (unreleased)
- Show incompatible projects in Bitbucket import status (Stan Hu)
- Fix coloring of diffs on MR Discussion-tab (Gert Goet)
- Fix "Network" and "Graphs" pages for branches with encoded slashes (Stan Hu)
- Fix errors deleting and creating branches with encoded slashes (Stan Hu)
...
...
app/controllers/import/bitbucket_controller.rb
View file @
d7accda1
...
...
@@ -22,6 +22,7 @@ class Import::BitbucketController < Import::BaseController
def
status
@repos
=
client
.
projects
@incompatible_repos
=
client
.
incompatible_projects
@already_added_projects
=
current_user
.
created_projects
.
where
(
import_type:
"bitbucket"
)
already_added_projects_names
=
@already_added_projects
.
pluck
(
:import_source
)
...
...
app/views/import/bitbucket/status.html.haml
View file @
d7accda1
...
...
@@ -3,11 +3,16 @@
%i
.fa.fa-bitbucket
Import projects from Bitbucket
%p
.light
Select projects you want to import.
%hr
%p
=
button_tag
'Import all projects'
,
class:
"btn btn-success js-import-all"
-
if
@repos
.
any?
%p
.light
Select projects you want to import.
%hr
%p
-
if
@incompatible_repos
.
any?
=
button_tag
'Import all compatible projects'
,
class:
"btn btn-success js-import-all"
-
else
=
button_tag
'Import all projects'
,
class:
"btn btn-success js-import-all"
%table
.table.import-jobs
%thead
...
...
@@ -41,6 +46,24 @@
=
"
#{
repo
[
"owner"
]
}
/
#{
repo
[
"slug"
]
}
"
%td
.import-actions.job-status
=
button_tag
"Import"
,
class:
"btn js-add-to-import"
-
@incompatible_repos
.
each
do
|
repo
|
%tr
{
id:
"repo_#{repo["
owner
"]}___#{repo["
slug
"]}"
}
%td
=
link_to
"
#{
repo
[
"owner"
]
}
/
#{
repo
[
"slug"
]
}
"
,
"https://bitbucket.org/
#{
repo
[
"owner"
]
}
/
#{
repo
[
"slug"
]
}
"
,
target:
"_blank"
%td
.import-target
%td
.import-actions-job-status
=
label_tag
"Incompatible Project"
,
nil
,
class:
"label label-danger"
-
if
@incompatible_repos
.
any?
%p
One or more of your Bitbucket projects cannot be imported into GitLab
directly because they use Subversion or Mercurial for version control,
rather than Git. Please convert
=
link_to
"them to Git,"
,
"https://www.atlassian.com/git/tutorials/migrating-overview"
and go through the
=
link_to
"import flow"
,
status_import_bitbucket_path
again.
:coffeescript
new ImporterStatus("
#{
jobs_import_bitbucket_path
}
", "
#{
import_bitbucket_path
}
")
lib/gitlab/bitbucket_import/client.rb
View file @
d7accda1
...
...
@@ -87,6 +87,10 @@ module Gitlab
JSON
.
parse
(
get
(
"/api/1.0/user/repositories"
).
body
).
select
{
|
repo
|
repo
[
"scm"
]
==
"git"
}
end
def
incompatible_projects
JSON
.
parse
(
get
(
"/api/1.0/user/repositories"
).
body
).
reject
{
|
repo
|
repo
[
"scm"
]
==
"git"
}
end
private
def
get
(
url
)
...
...
spec/controllers/import/bitbucket_controller_spec.rb
View file @
d7accda1
...
...
@@ -39,12 +39,14 @@ describe Import::BitbucketController do
it
"assigns variables"
do
@project
=
create
(
:project
,
import_type:
'bitbucket'
,
creator_id:
user
.
id
)
stub_client
(
projects:
[
@repo
])
client
=
stub_client
(
projects:
[
@repo
])
allow
(
client
).
to
receive
(
:incompatible_projects
).
and_return
([])
get
:status
expect
(
assigns
(
:already_added_projects
)).
to
eq
([
@project
])
expect
(
assigns
(
:repos
)).
to
eq
([
@repo
])
expect
(
assigns
(
:incompatible_repos
)).
to
eq
([])
end
it
"does not show already added project"
do
...
...
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