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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
371a141b
Commit
371a141b
authored
Feb 12, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-02-12
parents
dcb0fe88
bbfec704
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
79 additions
and
5 deletions
+79
-5
app/assets/javascripts/pages/projects/tree/show/index.js
app/assets/javascripts/pages/projects/tree/show/index.js
+1
-1
app/views/projects/commits/_commit.html.haml
app/views/projects/commits/_commit.html.haml
+1
-1
changelogs/unreleased/4826-geo-wikisyncservice-attempts-to-sync-projects.yml
...ed/4826-geo-wikisyncservice-attempts-to-sync-projects.yml
+5
-0
lib/gitlab/import_export/importer.rb
lib/gitlab/import_export/importer.rb
+3
-2
lib/gitlab/import_export/wiki_restorer.rb
lib/gitlab/import_export/wiki_restorer.rb
+23
-0
spec/lib/gitlab/import_export/wiki_restorer_spec.rb
spec/lib/gitlab/import_export/wiki_restorer_spec.rb
+45
-0
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+1
-1
No files found.
app/assets/javascripts/pages/projects/tree/show/index.js
View file @
371a141b
...
...
@@ -15,7 +15,7 @@ export default () => {
$
(
'
#tree-slider
'
).
waitForImages
(()
=>
ajaxGet
(
document
.
querySelector
(
'
.js-tree-content
'
).
dataset
.
logsPath
));
const
commitPipelineStatusEl
=
document
.
getElementById
(
'
commit-pipeline-status
'
);
const
commitPipelineStatusEl
=
document
.
querySelector
(
'
.js-
commit-pipeline-status
'
);
const
statusLink
=
document
.
querySelector
(
'
.commit-actions .ci-status-link
'
);
if
(
statusLink
!=
null
)
{
statusLink
.
remove
();
...
...
app/views/projects/commits/_commit.html.haml
View file @
371a141b
...
...
@@ -58,7 +58,7 @@
-
if
commit
.
status
(
ref
)
=
render_commit_status
(
commit
,
ref:
ref
)
#
commit-pipeline-status
{
data:
{
endpoint:
pipelines_project_commit_path
(
project
,
commit
.
id
)
}
}
.js-
commit-pipeline-status
{
data:
{
endpoint:
pipelines_project_commit_path
(
project
,
commit
.
id
)
}
}
=
link_to
commit
.
short_id
,
link
,
class:
"commit-sha btn btn-transparent btn-link"
=
clipboard_button
(
text:
commit
.
id
,
title:
_
(
"Copy commit SHA to clipboard"
))
=
link_to_browse_code
(
project
,
commit
)
...
...
changelogs/unreleased/4826-geo-wikisyncservice-attempts-to-sync-projects.yml
0 → 100644
View file @
371a141b
---
title
:
Create empty wiki when import from GitLab and wiki is not there
merge_request
:
author
:
type
:
fixed
lib/gitlab/import_export/importer.rb
View file @
371a141b
...
...
@@ -50,9 +50,10 @@ module Gitlab
end
def
wiki_restorer
Gitlab
::
ImportExport
::
Repo
Restorer
.
new
(
path_to_bundle:
wiki_repo_path
,
Gitlab
::
ImportExport
::
Wiki
Restorer
.
new
(
path_to_bundle:
wiki_repo_path
,
shared:
@shared
,
project:
ProjectWiki
.
new
(
project_tree
.
restored_project
))
project:
ProjectWiki
.
new
(
project_tree
.
restored_project
),
wiki_enabled:
@project
.
wiki_enabled?
)
end
def
uploads_restorer
...
...
lib/gitlab/import_export/wiki_restorer.rb
0 → 100644
View file @
371a141b
module
Gitlab
module
ImportExport
class
WikiRestorer
<
RepoRestorer
def
initialize
(
project
:,
shared
:,
path_to_bundle
:,
wiki_enabled
:)
super
(
project:
project
,
shared:
shared
,
path_to_bundle:
path_to_bundle
)
@wiki_enabled
=
wiki_enabled
end
def
restore
@project
.
wiki
if
create_empty_wiki?
super
end
private
def
create_empty_wiki?
!
File
.
exist?
(
@path_to_bundle
)
&&
@wiki_enabled
end
end
end
end
spec/lib/gitlab/import_export/wiki_restorer_spec.rb
0 → 100644
View file @
371a141b
require
'spec_helper'
describe
Gitlab
::
ImportExport
::
WikiRestorer
do
describe
'restore a wiki Git repo'
do
let!
(
:project_with_wiki
)
{
create
(
:project
,
:wiki_repo
)
}
let!
(
:project_without_wiki
)
{
create
(
:project
)
}
let!
(
:project
)
{
create
(
:project
)
}
let
(
:export_path
)
{
"
#{
Dir
.
tmpdir
}
/project_tree_saver_spec"
}
let
(
:shared
)
{
Gitlab
::
ImportExport
::
Shared
.
new
(
relative_path:
project
.
full_path
)
}
let
(
:bundler
)
{
Gitlab
::
ImportExport
::
WikiRepoSaver
.
new
(
project:
project_with_wiki
,
shared:
shared
)
}
let
(
:bundle_path
)
{
File
.
join
(
shared
.
export_path
,
Gitlab
::
ImportExport
.
project_bundle_filename
)
}
let
(
:restorer
)
do
described_class
.
new
(
path_to_bundle:
bundle_path
,
shared:
shared
,
project:
project
.
wiki
,
wiki_enabled:
true
)
end
before
do
allow
(
Gitlab
::
ImportExport
).
to
receive
(
:storage_path
).
and_return
(
export_path
)
bundler
.
save
end
after
do
FileUtils
.
rm_rf
(
export_path
)
Gitlab
::
Shell
.
new
.
remove_repository
(
project_with_wiki
.
wiki
.
repository_storage_path
,
project_with_wiki
.
wiki
.
disk_path
)
Gitlab
::
Shell
.
new
.
remove_repository
(
project
.
wiki
.
repository_storage_path
,
project
.
wiki
.
disk_path
)
end
it
'restores the wiki repo successfully'
do
expect
(
restorer
.
restore
).
to
be
true
end
describe
"no wiki in the bundle"
do
let
(
:bundler
)
{
Gitlab
::
ImportExport
::
WikiRepoSaver
.
new
(
project:
project_without_wiki
,
shared:
shared
)
}
it
'creates an empty wiki'
do
expect
(
restorer
.
restore
).
to
be
true
expect
(
project
.
wiki_repository_exists?
).
to
be
true
end
end
end
end
spec/models/ci/build_spec.rb
View file @
371a141b
...
...
@@ -1432,7 +1432,7 @@ describe Ci::Build do
[
{
key:
'CI'
,
value:
'true'
,
public:
true
},
{
key:
'GITLAB_CI'
,
value:
'true'
,
public:
true
},
{
key:
'GITLAB_FEATURES'
,
value:
''
,
public:
true
},
{
key:
'GITLAB_FEATURES'
,
value:
project
.
namespace
.
features
.
join
(
','
)
,
public:
true
},
{
key:
'CI_SERVER_NAME'
,
value:
'GitLab'
,
public:
true
},
{
key:
'CI_SERVER_VERSION'
,
value:
Gitlab
::
VERSION
,
public:
true
},
{
key:
'CI_SERVER_REVISION'
,
value:
Gitlab
::
REVISION
,
public:
true
},
...
...
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