Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
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
nexedi
gitlab-shell
Commits
de4349c1
Commit
de4349c1
authored
May 18, 2013
by
ash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Log failure conditions encountered during mv-projects.
parent
06e6e879
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
lib/gitlab_projects.rb
lib/gitlab_projects.rb
+15
-6
No files found.
lib/gitlab_projects.rb
View file @
de4349c1
...
@@ -76,14 +76,24 @@ class GitlabProjects
...
@@ -76,14 +76,24 @@ class GitlabProjects
def
mv_project
def
mv_project
new_path
=
ARGV
.
shift
new_path
=
ARGV
.
shift
return
false
unless
new_path
unless
new_path
$logger
.
error
"mv-project failed: no destination path provided."
return
false
end
new_full_path
=
File
.
join
(
repos_path
,
new_path
)
new_full_path
=
File
.
join
(
repos_path
,
new_path
)
# check if source repo exists
# verify that the source repo exists
# and target repo does not exist
unless
File
.
exists?
(
full_path
)
return
false
unless
File
.
exists?
(
full_path
)
$logger
.
error
"mv-project failed: source path <
#{
full_path
}
> does not exist."
return
false
if
File
.
exists?
(
new_full_path
)
return
false
end
# ...and that the target repo does not exist
if
File
.
exists?
(
new_full_path
)
$logger
.
error
"mv-project failed: destination path <
#{
new_full_path
}
> already exists."
return
false
end
$logger
.
info
"Moving project
#{
@project_name
}
from <
#{
full_path
}
> to <
#{
new_full_path
}
>."
$logger
.
info
"Moving project
#{
@project_name
}
from <
#{
full_path
}
> to <
#{
new_full_path
}
>."
FileUtils
.
mv
(
full_path
,
new_full_path
)
FileUtils
.
mv
(
full_path
,
new_full_path
)
...
@@ -115,7 +125,6 @@ class GitlabProjects
...
@@ -115,7 +125,6 @@ class GitlabProjects
up_hook_path
=
File
.
join
(
ROOT_PATH
,
'hooks'
,
'update'
)
up_hook_path
=
File
.
join
(
ROOT_PATH
,
'hooks'
,
'update'
)
"ln -s
#{
pr_hook_path
}
#{
dest_path
}
/hooks/post-receive && ln -s
#{
up_hook_path
}
#{
dest_path
}
/hooks/update"
"ln -s
#{
pr_hook_path
}
#{
dest_path
}
/hooks/post-receive && ln -s
#{
up_hook_path
}
#{
dest_path
}
/hooks/update"
end
end
end
end
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