aboutsummaryrefslogtreecommitdiffstats
path: root/copypage.pl
diff options
context:
space:
mode:
authorRhonda D'Vine <alfie>2008-10-16 17:07:15 +0000
committerRhonda D'Vine <alfie>2008-10-16 17:07:15 +0000
commit02e1869e35d88fc30d55f138de083342124cfbaf (patch)
tree4f98813b9de5cf91eaa42b914c6e04252802a232 /copypage.pl
parentcb2134843b4c556b1ece34bff7f5907eb85a3a24 (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-xcopypage.pl16
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;

© 2014-2024 Faster IT GmbH | imprint | privacy policy