From 02e1869e35d88fc30d55f138de083342124cfbaf Mon Sep 17 00:00:00 2001 From: Rhonda D'Vine Date: Thu, 16 Oct 2008 17:07:15 +0000 Subject: Open the files _after_ we try to retrieve the VCS revision so we don't leave empty new files in case of troubles CVS version numbers copypage.pl: 1.29 -> 1.30 --- copypage.pl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'copypage.pl') diff --git a/copypage.pl b/copypage.pl index 027236f1906..a89a4e2f211 100755 --- a/copypage.pl +++ b/copypage.pl @@ -223,14 +223,7 @@ sub copy undef $dsttitle; } - # Open the files - open SRC, $srcfile - or die "Could not read $srcfile ($!)\n"; - - open DST, ">$dstfile" - or die "Could not create $dstfile ($!)\n"; - - # Retrieve CVS revision number + # Retrieve VCS revision number my %vcsinfo = vcs_file_info( $srcfile ); if ( not %vcsinfo or not exists $vcsinfo{'cmt_rev'} ) @@ -238,6 +231,13 @@ sub copy die "Could not get revision number for `$srcfile' - bug in script?\n"; } + # Open the files + open SRC, $srcfile + or die "Could not read $srcfile ($!)\n"; + + open DST, ">$dstfile" + or die "Could not create $dstfile ($!)\n"; + # Copy the file and insert the revision number my $insertedrevision = 0; -- cgit v1.2.3