diff -r 70af8cdbad5a -r cc818568a7ec lib/version.PL --- a/lib/version.PL Wed Dec 30 23:42:56 2015 +0100 +++ b/lib/version.PL Thu Dec 31 19:01:39 2015 +0100 @@ -1,6 +1,14 @@ #! /usr/bin/perl -my $output = shift; +my $outfile = shift; + chomp(my $version = `hg log -r . --template '{latesttag}-{latesttagdistance}-{node|short}\n'`); +my $now = localtime; -open(STDOUT, '>', $output) or die "Can't open $output: $!\n"; -print qq{[% vcs.version = "$version"; %]\n}; +open(my $output, '>', $_ = $outfile) or die "Can't open $_: $!\n"; + +print {$output} <<_; +[%# autogenerated at $now by $0 %] +[% vcs.version = "$version"; %] +_ + +utime 0, 0 => $outfile;