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
Léo-Paul Géneau
gitlab-ce
Commits
fe370b1c
Commit
fe370b1c
authored
Jun 14, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new export stuff and view
parent
3f7ed550
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
12 deletions
+26
-12
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+6
-0
app/models/project.rb
app/models/project.rb
+0
-10
app/views/projects/edit.html.haml
app/views/projects/edit.html.haml
+19
-1
lib/gitlab/import_export/project_creator.rb
lib/gitlab/import_export/project_creator.rb
+1
-1
No files found.
app/helpers/projects_helper.rb
View file @
fe370b1c
...
...
@@ -348,4 +348,10 @@ module ProjectsHelper
message
.
strip
.
gsub
(
Gitlab
.
config
.
gitlab_shell
.
repos_path
.
chomp
(
'/'
),
"[REPOS PATH]"
)
end
def
db_export_list
YAML
.
load_file
(
Gitlab
::
ImportExport
.
config_file
)[
'project_tree'
].
map
do
|
relation
|
relation
.
is_a?
(
Hash
)
?
relation
.
keys
.
first
.
to_s
:
relation
.
to_s
end
+
[
'notes'
,
'merge_request_diffs'
]
end
end
app/models/project.rb
View file @
fe370b1c
...
...
@@ -348,16 +348,6 @@ class Project < ActiveRecord::Base
joins
(
join_body
).
reorder
(
'join_note_counts.amount DESC'
)
end
def
create_from_import_job
(
current_user_id
:,
tmp_file
:,
namespace_id
:,
project_path
:)
job_id
=
ProjectImportWorker
.
perform_async
(
current_user_id
,
tmp_file
,
namespace_id
,
project_path
)
if
job_id
Rails
.
logger
.
info
"Import job started for export
#{
tmp_file
}
with job ID
#{
job_id
}
"
else
Rails
.
logger
.
error
"Import job failed to start for
#{
tmp_file
}
"
end
end
end
def
team
...
...
app/views/projects/edit.html.haml
View file @
fe370b1c
...
...
@@ -129,9 +129,27 @@
Generates a compressed export file of the project and sends a link to download the export.
.col-lg-9
=
link_to
'
Generate new expor
t'
,
export_namespace_project_path
(
@project
.
namespace
,
@project
),
=
link_to
'
Export projec
t'
,
export_namespace_project_path
(
@project
.
namespace
,
@project
),
method: :post
,
class:
"btn btn-default"
%p
.append-bottom-0
%p
.row.prepend-top-default
Clicking on Export project, will produce a compressed file that will be sent as a link to your registered e-mail address.
.bs-callout.bs-callout-info
%p
.append-bottom-0
%p
The following items will be exported:
%ul
%li
Project and wiki repository
%li
Project uploads
%li
DB items, including configuration
%ul
-
db_export_list
.
each
do
|
export_relation
|
%li
%code
#{
export_relation
}
%hr
-
if
can?
current_user
,
:archive_project
,
@project
.row.prepend-top-default
...
...
lib/gitlab/import_export/project_creator.rb
View file @
fe370b1c
...
...
@@ -2,7 +2,7 @@ module Gitlab
module
ImportExport
class
ProjectCreator
def
initialize
(
namespace_id
,
current_user
,
)
def
initialize
(
namespace_id
,
current_user
)
@repo
=
repo
@namespace
=
Namespace
.
find_by_id
(
namespace_id
)
@current_user
=
current_user
...
...
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