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
iv
gitlab-ce
Commits
e7c930a5
Commit
e7c930a5
authored
Jun 14, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add imported boolean to project. Prevent shell from creating repo after it was imported
parent
da98cebc
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
10 deletions
+21
-10
app/contexts/projects/create_context.rb
app/contexts/projects/create_context.rb
+1
-0
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+1
-1
app/models/project.rb
app/models/project.rb
+4
-0
app/observers/project_observer.rb
app/observers/project_observer.rb
+8
-8
db/migrate/20130614132337_add_improted_to_project.rb
db/migrate/20130614132337_add_improted_to_project.rb
+5
-0
db/schema.rb
db/schema.rb
+2
-1
No files found.
app/contexts/projects/create_context.rb
View file @
e7c930a5
...
...
@@ -51,6 +51,7 @@ module Projects
if
shell
.
import_repository
(
@project
.
path_with_namespace
,
@project
.
import_url
)
# We should create satellite for imported repo
@project
.
satellite
.
create
unless
@project
.
satellite
.
exists?
@project
.
imported
=
true
true
else
@project
.
errors
.
add
(
:import_url
,
'cannot clone repo'
)
...
...
app/helpers/application_helper.rb
View file @
e7c930a5
...
...
@@ -142,7 +142,7 @@ module ApplicationHelper
end
def
user_color_scheme_class
COLOR_SCHEMES
[
current_user
.
try
(
:color_scheme_id
)]
COLOR_SCHEMES
[
current_user
.
try
(
:color_scheme_id
)]
if
defined?
(
current_user
)
end
# Define whenever show last push event
...
...
app/models/project.rb
View file @
e7c930a5
...
...
@@ -413,6 +413,10 @@ class Project < ActiveRecord::Base
!
(
forked_project_link
.
nil?
||
forked_project_link
.
forked_from_project
.
nil?
)
end
def
imported?
imported
end
def
rename_repo
old_path_with_namespace
=
File
.
join
(
namespace_dir
,
path_was
)
new_path_with_namespace
=
File
.
join
(
namespace_dir
,
path
)
...
...
app/observers/project_observer.rb
View file @
e7c930a5
class
ProjectObserver
<
BaseObserver
def
after_create
(
project
)
unless
project
.
forked?
return
true
if
project
.
forked?
||
project
.
imported?
GitlabShellWorker
.
perform_async
(
:add_repository
,
project
.
path_with_namespace
...
...
@@ -8,7 +9,6 @@ class ProjectObserver < BaseObserver
log_info
(
"
#{
project
.
owner
.
name
}
created a new project
\"
#{
project
.
name_with_namespace
}
\"
"
)
end
end
def
after_update
(
project
)
project
.
send_move_instructions
if
project
.
namespace_id_changed?
...
...
db/migrate/20130614132337_add_improted_to_project.rb
0 → 100644
View file @
e7c930a5
class
AddImprotedToProject
<
ActiveRecord
::
Migration
def
change
add_column
:projects
,
:imported
,
:boolean
,
default:
false
,
null:
false
end
end
db/schema.rb
View file @
e7c930a5
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
:version
=>
2013061
3173246
)
do
ActiveRecord
::
Schema
.
define
(
:version
=>
2013061
4132337
)
do
create_table
"deploy_keys_projects"
,
:force
=>
true
do
|
t
|
t
.
integer
"deploy_key_id"
,
:null
=>
false
...
...
@@ -172,6 +172,7 @@ ActiveRecord::Schema.define(:version => 20130613173246) do
t
.
string
"issues_tracker_id"
t
.
boolean
"snippets_enabled"
,
:default
=>
true
,
:null
=>
false
t
.
datetime
"last_activity_at"
t
.
boolean
"imported"
,
:default
=>
false
,
:null
=>
false
end
add_index
"projects"
,
[
"creator_id"
],
:name
=>
"index_projects_on_owner_id"
...
...
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