Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
41c06c31
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,发现更多精彩内容 >>
提交
41c06c31
编写于
6月 02, 2016
作者:
J
James Lopez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactoring more things based on MR feedback
上级
a9fdf62b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
7 deletion
+13
-7
lib/gitlab/import_export/import_service.rb
lib/gitlab/import_export/import_service.rb
+2
-1
lib/gitlab/import_export/relation_factory.rb
lib/gitlab/import_export/relation_factory.rb
+3
-3
lib/gitlab/import_export/repo_restorer.rb
lib/gitlab/import_export/repo_restorer.rb
+7
-2
lib/gitlab/import_export/shared.rb
lib/gitlab/import_export/shared.rb
+1
-1
未找到文件。
lib/gitlab/import_export/import_service.rb
浏览文件 @
41c06c31
...
...
@@ -45,7 +45,8 @@ module Gitlab
def
wiki_restorer
Gitlab
::
ImportExport
::
RepoRestorer
.
new
(
path_to_bundle:
wiki_repo_path
,
shared:
@shared
,
project:
ProjectWiki
.
new
(
project_tree
.
project
))
project:
ProjectWiki
.
new
(
project_tree
.
project
),
wiki:
true
)
end
def
uploads_restorer
...
...
lib/gitlab/import_export/relation_factory.rb
浏览文件 @
41c06c31
...
...
@@ -30,7 +30,7 @@ module Gitlab
set_note_author
if
@relation_name
==
:notes
update_user_references
update_project_references
reset_tokens
if
@relation_name
==
'Ci::Trigger'
reset_
ci_
tokens
if
@relation_name
==
'Ci::Trigger'
generate_imported_object
end
...
...
@@ -95,10 +95,10 @@ module Gitlab
end
end
def
reset_tokens
def
reset_
ci_
tokens
return
unless
Gitlab
::
ImportExport
.
reset_tokens?
# If we import/export a project to the same instance, tokens will have to be rese
ated
.
# If we import/export a project to the same instance, tokens will have to be rese
t
.
@relation_hash
[
'token'
]
=
nil
end
...
...
lib/gitlab/import_export/repo_restorer.rb
浏览文件 @
41c06c31
...
...
@@ -3,14 +3,15 @@ module Gitlab
class
RepoRestorer
include
Gitlab
::
ImportExport
::
CommandLineUtil
def
initialize
(
project
:,
shared
:,
path_to_bundle
:)
def
initialize
(
project
:,
shared
:,
path_to_bundle
:
,
wiki:
false
)
@project
=
project
@path_to_bundle
=
path_to_bundle
@shared
=
shared
@wiki
=
wiki
end
def
restore
return
true
unless
File
.
exists?
(
@path_to_bundle
)
return
false
unless
File
.
exists?
(
@path_to_bundle
)
||
wiki?
FileUtils
.
mkdir_p
(
path_to_repo
)
...
...
@@ -29,6 +30,10 @@ module Gitlab
def
path_to_repo
@project
.
repository
.
path_to_repo
end
def
wiki?
@wiki
end
end
end
end
lib/gitlab/import_export/shared.rb
浏览文件 @
41c06c31
...
...
@@ -10,7 +10,7 @@ module Gitlab
end
def
export_path
@export_path
||=
Gitlab
::
ImportExport
.
export_path
(
relative_path:
@
opts
[
:relative_path
])
@export_path
||=
Gitlab
::
ImportExport
.
export_path
(
relative_path:
opts
[
:relative_path
])
end
def
error
(
error
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录