Re: [PATCH/RFC] Export file attachements in git-remote-mediawiki
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Jun 5, 2012, 17:05 UTC
- Message-ID
- <vpq62b5g047.fsf@bauges.imag.fr>
- In-Reply-To
- <59db730bded272b60cbd16806c757660@ensibm.imag.fr>
nguyenki <nguyenki@ensibm.imag.fr> writes:
Show 10 quoted lines
>>> @@ -642,8 +651,14 @@ sub mw_push_file {
>>> my $old_sha1 = $diff_info_split[2];
>>> my $page_created = ($old_sha1 eq NULL_SHA1);
>>> my $page_deleted = ($new_sha1 eq NULL_SHA1);
>>> + my $file_deleted = ($new_sha1 eq NULL_SHA1);
>>
>> This line looks suspiciously similar to the previous one. Do you need
>> another variable for the same value?
> Yes, it's true. I just want the code to be more visible. Because, when
> we delete a file attachment, it's not a page wiki.I still don't see a reason to have two variables for the same thing. If $page_deleted is not a good name, then rename the variable to something more general (e.g. $path_deleted ?)
Show 9 quoted lines
>>> + else {
>>> + print STDERR "$complete_file_name is not supported on
>>> this version of Mediawiki.\n"
>>
>> It's not a matter of version, it's a matter of configuration.
> What do you think if i change it like:
> else {
> print STDERR "$complete_file_name is not a permitted file
> type. Check your configuration for more information\n"That's better, but it doesn't tell the user which configuration to check (Git's one, or the wiki's one).
-- Matthieu Moy http://www-verimag.imag.fr/~moy/