@@ -28,8 +28,8 @@ def run!
28
28
else
29
29
clone!
30
30
end
31
- fix_tags
32
31
fix_branches
32
+ fix_tags
33
33
optimize_repos
34
34
end
35
35
@@ -41,8 +41,8 @@ def parse(args)
41
41
options [ :nominimizeurl ] = false
42
42
options [ :rootistrunk ] = false
43
43
options [ :trunk ] = 'trunk'
44
- options [ :branches ] = 'branches'
45
- options [ :tags ] = 'tags'
44
+ options [ :branches ] = [ ]
45
+ options [ :tags ] = [ ]
46
46
options [ :exclude ] = [ ]
47
47
options [ :revision ] = nil
48
48
options [ :username ] = nil
@@ -88,11 +88,11 @@ def parse(args)
88
88
end
89
89
90
90
opts . on ( '--branches BRANCHES_PATH' , 'Subpath to branches from repository URL (default: branches)' ) do |branches |
91
- options [ :branches ] = branches
91
+ options [ :branches ] << branches
92
92
end
93
93
94
94
opts . on ( '--tags TAGS_PATH' , 'Subpath to tags from repository URL (default: tags)' ) do |tags |
95
- options [ :tags ] = tags
95
+ options [ :tags ] << tags
96
96
end
97
97
98
98
opts . on ( '--rootistrunk' , 'Use this if the root level of the repo is equivalent to the trunk and there are no tags or branches' ) do
@@ -153,6 +153,15 @@ def parse(args)
153
153
end
154
154
155
155
@opts . parse! args
156
+
157
+ # Set default branches and tags if not explicitely configured
158
+ if ! options [ :branches ] . nil? && options [ :branches ] . length == 0
159
+ options [ :branches ] << 'branches'
160
+ end
161
+ if ! options [ :tags ] . nil? && options [ :tags ] . length == 0
162
+ options [ :tags ] << 'tags'
163
+ end
164
+
156
165
options
157
166
end
158
167
@@ -203,8 +212,12 @@ def clone!
203
212
cmd += "--no-minimize-url "
204
213
end
205
214
cmd += "--trunk=#{ trunk } " unless trunk . nil?
206
- cmd += "--tags=#{ tags } " unless tags . nil?
207
- cmd += "--branches=#{ branches } " unless branches . nil?
215
+ tags . each do |tags |
216
+ cmd += "--tags=#{ tags } "
217
+ end unless tags . nil?
218
+ branches . each do |branches |
219
+ cmd += "--branches=#{ branches } "
220
+ end unless branches . nil?
208
221
209
222
cmd += @url
210
223
@@ -336,7 +349,7 @@ def fix_branches
336
349
337
350
svn_branches . each do |branch |
338
351
branch = branch . gsub ( /^svn\/ / , '' ) . strip
339
- if @options [ :rebase ] && ( @local . include? ( branch ) || branch == 'trunk' )
352
+ if @options [ :rebase ] && ( @local . include? ( branch ) || branch == 'trunk' ) && ! ( branch == 'trunk' && @options [ :trunk ] . nil? )
340
353
lbranch = branch
341
354
lbranch = 'master' if branch == 'trunk'
342
355
if @options [ :bare ] && _repos != '' && __cmd != ''
0 commit comments