Skip to content

Commit

Permalink
Add slomo option
Browse files Browse the repository at this point in the history
If the slomo option is enabled sleeps are inserted into the script.  This
means that if things are going to go wrong at least they will go wrong
slowly.
  • Loading branch information
wmanley committed Mar 13, 2012
1 parent 8c7e0a5 commit 9a4d84f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions svnExport.pl
Expand Up @@ -35,6 +35,7 @@
my $SVN_TRUNK_EXT; # default: "trunk"

my $dry_run=0;
my $slomo=0;

sub checked_system {
if ($dry_run) {
Expand All @@ -46,6 +47,14 @@ sub checked_system {
}
}

# slomo_sleep calls are inserted after making changes to svn, so that if this
# script goes wrong at least it will go wrong slowly
sub slomo_sleep {
if ($slomo) {
sleep(10);
}
}

# globmatch("abc*ghi", "abcdefghi") == "def"
sub globmatch {
my ($glob, $text) = @_;
Expand Down Expand Up @@ -121,6 +130,7 @@ sub branchfromparent
#Do the branching
checked_system("svn copy --parents $svn_from\@$svnrev $svn_to -m \"Branch for $branch\"") == 0
or die "Could not create branch";
slomo_sleep();
}

# Create the first branch - the one for which no parent can be found.
Expand Down Expand Up @@ -165,6 +175,8 @@ sub createfirst

# temp dir is no longer needed - we'll commit the diffs from now
system("rm -rf \"$SVN_ROOT/$project\"");

slomo_sleep();
}

# Find the parent and branch point by looping back through the branch rev-list
Expand Down Expand Up @@ -394,6 +406,8 @@ sub processbranch

#Clean up the commit message file.
unlink("$COMMIT_MESG/$revision");

slomo_sleep();
}
close(BRANCHREVS);
}
Expand Down

0 comments on commit 9a4d84f

Please sign in to comment.