Revision 442:753f1380d6bc extra/svn/.svn/text-base
| extra/svn/.svn/text-base/reposman.rb.svn-base | ||
|---|---|---|
| 7 | 7 |
# == Usage |
| 8 | 8 |
# |
| 9 | 9 |
# reposman [OPTIONS...] -s [DIR] -r [HOST] |
| 10 |
#
|
|
| 10 |
# |
|
| 11 | 11 |
# Examples: |
| 12 | 12 |
# reposman --svn-dir=/var/svn --redmine-host=redmine.example.net --scm subversion |
| 13 | 13 |
# reposman -s /var/git -r redmine.example.net -u http://svn.example.net --scm git |
| ... | ... | |
| 57 | 57 |
# -q, --quiet no log |
| 58 | 58 |
# |
| 59 | 59 |
# == References |
| 60 |
#
|
|
| 60 |
# |
|
| 61 | 61 |
# You can find more information on the redmine's wiki : http://www.redmine.org/wiki/redmine/HowTos |
| 62 | 62 |
|
| 63 | 63 |
|
| ... | ... | |
| 205 | 205 |
log("retrieved #{projects.size} projects", :level => 1)
|
| 206 | 206 |
|
| 207 | 207 |
def set_owner_and_rights(project, repos_path, &block) |
| 208 |
if RUBY_PLATFORM =~ /mswin/
|
|
| 208 |
if mswin?
|
|
| 209 | 209 |
yield if block_given? |
| 210 | 210 |
else |
| 211 | 211 |
uid, gid = Etc.getpwnam($svn_owner).uid, ($use_groupid ? Etc.getgrnam(project.identifier).gid : Etc.getgrnam($svn_group).gid) |
| ... | ... | |
| 225 | 225 |
def owner_name(file) |
| 226 | 226 |
mswin? ? |
| 227 | 227 |
$svn_owner : |
| 228 |
Etc.getpwuid( File.stat(file).uid ).name
|
|
| 228 |
Etc.getpwuid( File.stat(file).uid ).name |
|
| 229 | 229 |
end |
| 230 |
|
|
| 230 |
|
|
| 231 | 231 |
def mswin? |
| 232 | 232 |
(RUBY_PLATFORM =~ /(:?mswin|mingw)/) || (RUBY_PLATFORM == 'java' && (ENV['OS'] || ENV['os']) =~ /windows/i) |
| 233 | 233 |
end |
| ... | ... | |
| 246 | 246 |
repos_path = File.join($repos_base, project.identifier).gsub(File::SEPARATOR, File::ALT_SEPARATOR || File::SEPARATOR) |
| 247 | 247 |
|
| 248 | 248 |
if File.directory?(repos_path) |
| 249 |
|
|
| 250 | 249 |
# we must verify that repository has the good owner and the good |
| 251 | 250 |
# rights before leaving |
| 252 | 251 |
other_read = other_read_right?(repos_path) |
| ... | ... | |
| 304 | 303 |
log("\trepository #{repos_path} not registered in Redmine: #{e.message}");
|
| 305 | 304 |
end |
| 306 | 305 |
end |
| 307 |
|
|
| 308 | 306 |
log("\trepository #{repos_path} created");
|
| 309 | 307 |
end |
| 310 |
|
|
| 311 | 308 |
end |
| 312 |
|
|
Also available in: Unified diff