Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
fe370b1c
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fe370b1c
编写于
6月 14, 2016
作者:
J
James Lopez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
new export stuff and view
上级
3f7ed550
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
26 addition
and
12 deletion
+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
未找到文件。
app/helpers/projects_helper.rb
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录