26 |
26 |
# allow user to browse the repository within
|
27 |
27 |
# Redmine even for private project. If you want to share repositories
|
28 |
28 |
# through Redmine.pm, you need to use the apache owner.
|
|
29 |
# -g, --group=GROUP group of the repository. (default: root)
|
29 |
30 |
# --scm=SCM the kind of SCM repository you want to create (and register) in
|
30 |
31 |
# Redmine (default: Subversion). reposman is able to create Git
|
31 |
32 |
# and Subversion repositories. For all other kind (Bazaar,
|
... | ... | |
68 |
69 |
['--svn-dir', '-s', GetoptLong::REQUIRED_ARGUMENT],
|
69 |
70 |
['--redmine-host', '-r', GetoptLong::REQUIRED_ARGUMENT],
|
70 |
71 |
['--owner', '-o', GetoptLong::REQUIRED_ARGUMENT],
|
|
72 |
['--group', '-g', GetoptLong::REQUIRED_ARGUMENT],
|
71 |
73 |
['--url', '-u', GetoptLong::REQUIRED_ARGUMENT],
|
72 |
74 |
['--command' , '-c', GetoptLong::REQUIRED_ARGUMENT],
|
73 |
75 |
['--scm', GetoptLong::REQUIRED_ARGUMENT],
|
... | ... | |
84 |
86 |
$redmine_host = ''
|
85 |
87 |
$repos_base = ''
|
86 |
88 |
$svn_owner = 'root'
|
|
89 |
$svn_group = 'root'
|
87 |
90 |
$use_groupid = true
|
88 |
91 |
$svn_url = false
|
89 |
92 |
$test = false
|
... | ... | |
126 |
129 |
when '--svn-dir'; $repos_base = arg.dup
|
127 |
130 |
when '--redmine-host'; $redmine_host = arg.dup
|
128 |
131 |
when '--owner'; $svn_owner = arg.dup; $use_groupid = false;
|
|
132 |
when '--group'; $svn_group = arg.dup; $use_groupid = false;
|
129 |
133 |
when '--url'; $svn_url = arg.dup
|
130 |
134 |
when '--scm'; $scm = arg.dup.capitalize; log("Invalid SCM: #{$scm}", :exit => true) unless SUPPORTED_SCM.include?($scm)
|
131 |
135 |
when '--command'; $command = arg.dup
|
... | ... | |
189 |
193 |
if RUBY_PLATFORM =~ /mswin/
|
190 |
194 |
yield if block_given?
|
191 |
195 |
else
|
192 |
|
uid, gid = Etc.getpwnam($svn_owner).uid, ($use_groupid ? Etc.getgrnam(project.identifier).gid : 0)
|
|
196 |
uid, gid = Etc.getpwnam($svn_owner).uid, ($use_groupid ? Etc.getgrnam(project.identifier).gid : Etc.getgrnam($svn_group).gid)
|
193 |
197 |
right = project.is_public ? 0775 : 0770
|
194 |
198 |
yield if block_given?
|
195 |
199 |
Find.find(repos_path) do |f|
|