From: "Célestin Matte" <celestin.matte@ensimag.fr>
To: git@vger.kernel.org
Cc: benoit.person@ensimag.fr, matthieu.moy@grenoble-inp.fr,
"Célestin Matte" <celestin.matte@ensimag.fr>
Subject: [PATCH v2 03/22] git-remote-mediawiki: Always end a subroutine with a return
Date: Fri, 7 Jun 2013 23:42:04 +0200 [thread overview]
Message-ID: <1370641344-4253-4-git-send-email-celestin.matte@ensimag.fr> (raw)
In-Reply-To: <1370641344-4253-1-git-send-email-celestin.matte@ensimag.fr>
Follow Subroutines::RequireFinalReturn
Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
---
contrib/mw-to-git/git-remote-mediawiki.perl | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl
index e60793a..bbde9fd 100755
--- a/contrib/mw-to-git/git-remote-mediawiki.perl
+++ b/contrib/mw-to-git/git-remote-mediawiki.perl
@@ -198,12 +198,14 @@ sub mw_connect_maybe {
exit 1;
}
}
+ return;
}
## Functions for listing pages on the remote wiki
sub get_mw_tracked_pages {
my $pages = shift;
get_mw_page_list(\@tracked_pages, $pages);
+ return;
}
sub get_mw_page_list {
@@ -219,6 +221,7 @@ sub get_mw_page_list {
get_mw_first_pages(\@slice, $pages);
@some_pages = @some_pages[51..$#some_pages];
}
+ return;
}
sub get_mw_tracked_categories {
@@ -241,6 +244,7 @@ sub get_mw_tracked_categories {
$pages->{$page->{title}} = $page;
}
}
+ return;
}
sub get_mw_all_pages {
@@ -260,6 +264,7 @@ sub get_mw_all_pages {
foreach my $page (@{$mw_pages}) {
$pages->{$page->{title}} = $page;
}
+ return;
}
# queries the wiki for a set of pages. Meant to be used within a loop
@@ -290,6 +295,7 @@ sub get_mw_first_pages {
$pages->{$page->{title}} = $page;
}
}
+ return;
}
# Get the list of pages to be fetched according to configuration.
@@ -358,6 +364,7 @@ sub get_all_mediafiles {
foreach my $page (@{$mw_pages}) {
$pages->{$page->{title}} = $page;
}
+ return;
}
sub get_linked_mediafiles {
@@ -404,6 +411,7 @@ sub get_linked_mediafiles {
@titles = @titles[($batch+1)..$#titles];
}
+ return;
}
sub get_mw_mediafile_for_page_revision {
@@ -579,6 +587,7 @@ sub mediawiki_smudge_filename {
sub literal_data {
my ($content) = @_;
print STDOUT "data ", bytes::length($content), "\n", $content;
+ return;
}
sub literal_data_raw {
@@ -589,6 +598,7 @@ sub literal_data_raw {
binmode STDOUT, ":raw";
print STDOUT "data ", bytes::length($content), "\n", $content;
binmode STDOUT, ":encoding(UTF-8)";
+ return;
}
sub mw_capabilities {
@@ -600,6 +610,7 @@ sub mw_capabilities {
print STDOUT "list\n";
print STDOUT "push\n";
print STDOUT "\n";
+ return;
}
sub mw_list {
@@ -608,11 +619,13 @@ sub mw_list {
print STDOUT "? refs/heads/master\n";
print STDOUT "\@refs/heads/master HEAD\n";
print STDOUT "\n";
+ return;
}
sub mw_option {
print STDERR "remote-helper command 'option $_[0]' not yet implemented\n";
print STDOUT "unsupported\n";
+ return;
}
sub fetch_mw_revisions_for_page {
@@ -734,6 +747,7 @@ sub import_file_revision {
print STDOUT "N inline :$n\n";
literal_data("mediawiki_revision: " . $commit{mw_revision});
print STDOUT "\n\n";
+ return;
}
# parse a sequence of
@@ -754,6 +768,7 @@ sub get_more_refs {
die("Invalid command in a '$cmd' batch: ". $_);
}
}
+ return;
}
sub mw_import {
@@ -763,6 +778,7 @@ sub mw_import {
mw_import_ref($ref);
}
print STDOUT "done\n";
+ return;
}
sub mw_import_ref {
@@ -806,6 +822,7 @@ sub mw_import_ref {
# thrown saying that HEAD is referring to unknown object 0000000000000000000
# and the clone fails.
}
+ return;
}
sub mw_import_ref_by_pages {
@@ -1112,6 +1129,7 @@ sub mw_push {
print STDERR " git pull --rebase\n";
print STDERR "\n";
}
+ return;
}
sub mw_push_revision {
--
1.7.9.5
next prev parent reply other threads:[~2013-06-07 21:44 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-07 21:42 [PATCH v2 00/22] git-remote-mediawiki: Follow perlcritic's recommandations Célestin Matte
2013-06-07 21:42 ` [PATCH v2 01/22] git-remote-mediawiki: Replace :utf8 by :encoding(UTF-8) Célestin Matte
2013-06-07 21:42 ` [PATCH v2 02/22] git-remote-mediawiki: Use the Readonly module instead of the constant pragma Célestin Matte
2013-06-08 3:23 ` Jeff King
2013-06-08 8:51 ` Benoît Person
2013-06-08 13:01 ` Célestin Perdu
2013-06-08 17:31 ` Jeff King
2013-06-08 18:27 ` Matthieu Moy
2013-06-07 21:42 ` Célestin Matte [this message]
2013-06-07 21:42 ` [PATCH v2 04/22] git-remote-mediawiki: Move a variable declaration at the top of the code Célestin Matte
2013-06-07 21:42 ` [PATCH v2 05/22] git-remote-mediawiki: Change syntax of map calls Célestin Matte
2013-06-07 21:42 ` [PATCH v2 06/22] git-remote-mediawiki: Rewrite unclear line of instructions Célestin Matte
2013-06-07 21:42 ` [PATCH v2 07/22] git-remote-mediawiki: Change style of some regular expressions Célestin Matte
2013-06-08 0:12 ` Eric Sunshine
2013-06-07 21:42 ` [PATCH v2 08/22] git-remote-mediawiki: Add newline in the end of die() error messages Célestin Matte
2013-06-07 21:42 ` [PATCH v2 09/22] git-remote-mediawiki: Change the name of a variable Célestin Matte
2013-06-07 21:42 ` [PATCH v2 10/22] git-remote-mediawiki: Turn double-negated expressions into simple expressions Célestin Matte
2013-06-07 21:42 ` [PATCH v2 11/22] git-remote-mediawiki: Remove unused variable $entry Célestin Matte
2013-06-07 21:42 ` [PATCH v2 12/22] git-remote-mediawiki: Rename a variable ($last) which has the name of a keyword Célestin Matte
2013-06-07 21:42 ` [PATCH v2 13/22] git-remote-mediawiki: Assign a variable as undef and make proper indentation Célestin Matte
2013-06-07 21:42 ` [PATCH v2 14/22] git-remote-mediawiki: Check return value of open + remove import of unused open2 Célestin Matte
2013-06-08 0:14 ` Eric Sunshine
2013-06-08 15:54 ` Célestin Matte
2013-06-08 18:41 ` Matthieu Moy
2013-06-08 18:45 ` Célestin Matte
2013-06-08 19:04 ` Matthieu Moy
2013-06-09 4:52 ` Eric Sunshine
2013-06-07 21:42 ` [PATCH v2 15/22] git-remote-mediawiki: Put long code into a subroutine Célestin Matte
2013-06-08 0:27 ` Eric Sunshine
2013-06-07 21:42 ` [PATCH v2 16/22] git-remote-mediawiki: Modify strings for a better coding-style Célestin Matte
2013-06-08 0:39 ` Eric Sunshine
2013-06-08 20:32 ` Célestin Matte
2013-06-09 4:44 ` Eric Sunshine
2013-06-07 21:42 ` [PATCH v2 17/22] git-remote-mediawiki: Brace file handles for print for more clarity Célestin Matte
2013-06-08 0:42 ` Eric Sunshine
2013-06-07 21:42 ` [PATCH v2 18/22] git-remote-mediawiki: Replace "unless" statements with negated "if" statements Célestin Matte
2013-06-07 21:42 ` [PATCH v2 19/22] git-remote-mediawiki: Don't use quotes for empty strings Célestin Matte
2013-06-07 21:42 ` [PATCH v2 20/22] git-remote-mediawiki: Put non-trivial numeric values in constants Célestin Matte
2013-06-07 21:42 ` [PATCH v2 21/22] git-remote-mediawiki: Fix a typo ("mediwiki" instead of "mediawiki") Célestin Matte
2013-06-07 21:42 ` [PATCH v2 22/22] git-remote-mediawiki: Clearly rewrite double dereference Célestin Matte
2013-06-07 23:34 ` Eric Sunshine
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1370641344-4253-4-git-send-email-celestin.matte@ensimag.fr \
--to=celestin.matte@ensimag.fr \
--cc=benoit.person@ensimag.fr \
--cc=git@vger.kernel.org \
--cc=matthieu.moy@grenoble-inp.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).