git-remote-mediawiki: replace "unless" statements with negated "if" statements
Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Célestin Matte committed
Jun 14, 2013 at 15:50 UTC
b8b4e1b385f058695e7860748d959cb01eecc330
1 file changed
+6
-6
contrib/mw-to-git/git-remote-mediawiki.perl
+6
-6
@@ -82,11 +82,11 @@ $shallow_import = ($shallow_import eq 'true');
82
# - by_rev: perform one query per new revision on the remote wiki
83
# - by_page: query each tracked page for new revision
84
my $fetch_strategy = run_git("config --get remote.${remotename}.fetchStrategy");
85
-unless ($fetch_strategy) {
85
+if (!$fetch_strategy) {
86
$fetch_strategy = run_git('config --get mediawiki.fetchStrategy');
87
}
88
chomp($fetch_strategy);
89
-unless ($fetch_strategy) {
89
+if (!$fetch_strategy) {
90
$fetch_strategy = 'by_page';
91
}
92
@@ -108,7 +108,7 @@ my %basetimestamps;
108
# deterministic, this means everybody gets the same sha1 for each
109
# MediaWiki revision.
110
my $dumb_push = run_git("config --get --bool remote.${remotename}.dumbPush");
111
-unless ($dumb_push) {
111
+if (!$dumb_push) {
112
$dumb_push = run_git('config --get --bool mediawiki.dumbPush');
113
}
114
chomp($dumb_push);
@@ -667,7 +667,7 @@ sub fetch_mw_revisions_for_page {
667
push(@page_revs, $page_rev_ids);
668
$revnum++;
669
}
670
- last unless $result->{'query-continue'};
670
+ last if (!$result->{'query-continue'});
671
$query->{rvstartid} = $result->{'query-continue'}->{revisions}->{rvstartid};
672
}
673
if ($shallow_import && @page_revs) {
@@ -1239,7 +1239,7 @@ sub mw_push_revision {
1239
die("Unknown error from mw_push_file()\n");
1240
}
1241
}
1242
- unless ($dumb_push) {
1242
+ if (!$dumb_push) {
1243
run_git(qq(notes --ref=${remotename}/mediawiki add -f -m "mediawiki_revision: ${mw_revision}" ${sha1_commit}));
1244
run_git(qq(update-ref -m "Git-MediaWiki push" refs/mediawiki/${remotename}/master ${sha1_commit} ${sha1_child}));
1245
}
@@ -1320,7 +1320,7 @@ sub get_mw_namespace_id {
1320
my $ns = $namespace_id{$name};
1321
my $id;
1322
1323
- unless (defined $ns) {
1323
+ if (!defined $ns) {
1324
print {*STDERR} "No such namespace ${name} on MediaWiki.\n";
1325
$ns = {is_namespace => 0};
1326
$namespace_id{$name} = $ns;