diff options
author | Rhonda D'Vine <alfie> | 2008-10-16 17:07:15 +0000 |
---|---|---|
committer | Rhonda D'Vine <alfie> | 2008-10-16 17:07:15 +0000 |
commit | 02e1869e35d88fc30d55f138de083342124cfbaf (patch) | |
tree | 4f98813b9de5cf91eaa42b914c6e04252802a232 /copypage.pl | |
parent | cb2134843b4c556b1ece34bff7f5907eb85a3a24 (diff) |
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
Diffstat (limited to 'copypage.pl')
-rwxr-xr-x | copypage.pl | 16 |
1 files changed, 8 insertions, 8 deletions
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; |