File tree 1 file changed +15
-0
lines changed
src/derhasi/RedmineToGit/Command 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,12 @@ protected function configure()
113
113
'Maximum filesize for attachments in bytes ' ,
114
114
'0 '
115
115
)
116
+ ->addOption (
117
+ 'ensureAttachments ' ,
118
+ NULL ,
119
+ InputOption::VALUE_NONE ,
120
+ 'Makes sure the attachments from the current version are downloaded '
121
+ )
116
122
;
117
123
}
118
124
@@ -216,6 +222,8 @@ protected function buildWikiVersions() {
216
222
217
223
$ this ->wikiVersions = array ();
218
224
225
+ $ ensure_attachments = $ this ->currentInput ->getOption ('ensureAttachments ' );
226
+
219
227
// Show a progress bar for featching wiki page information.
220
228
$ this ->currentOutput ->writeln ("<info>Fetching wiki page information from API ...</info> " );
221
229
$ progress = $ this ->getHelperSet ()->get ('progress ' );
@@ -234,6 +242,13 @@ protected function buildWikiVersions() {
234
242
$ this ->wikiVersions [$ key ] = $ version ;
235
243
}
236
244
}
245
+ // In the case we want to ensure the attachments, we need to process the
246
+ // last version again.
247
+ elseif ($ ensure_attachments && $ current_version == $ index_version ) {
248
+ $ version = $ page ->loadVersion ($ index_version );
249
+ $ key = $ version ->updated_on . '- ' . $ version ->title . '- ' . $ version ->version ;
250
+ $ this ->wikiVersions [$ key ] = $ version ;
251
+ }
237
252
238
253
// advances the progress bar 1 unit
239
254
$ progress ->advance ();
You can’t perform that action at this time.
0 commit comments