comparison revisions.pl.in @ 972:d66ab756c75b

Change the way the version is printed (more verbose, with short hash) If the user has patches managed by the mq extension, the version and hash printed are those of the qparent revision (the revision the patches were applied on top of) instead of tip. Also fixes a bug: print LLVM revision even if there are local modifications to it. Sorry for the long line in the perl file. I have no idea how to break it up.
author Frits van Bommel <fvbommel wxs.nl>
date Tue, 17 Feb 2009 01:13:18 +0100
parents a331ce9bc749
children f0b6549055ab
comparison
equal deleted inserted replaced
971:985104c0f1db 972:d66ab756c75b
7 7
8 my $llvm_src = `perl @LLVM_CONFIG@ --src-root`; 8 my $llvm_src = `perl @LLVM_CONFIG@ --src-root`;
9 9
10 my $llvm_rev = `svnversion $llvm_src`; 10 my $llvm_rev = `svnversion $llvm_src`;
11 11
12 if ($llvm_rev =~ s/(\d+)\s+$/$1/) { 12 if ($llvm_rev =~ s/(\d+M?)\s+$/$1/) {
13 $llvm_rev = qq!#define LLVM_REV "LLVM rev.$llvm_rev"! 13 $llvm_rev = qq!#define LLVM_REV "LLVM rev. $llvm_rev"!
14 } else { 14 } else {
15 my $llvm_lib = `perl @LLVM_CONFIG@ --libdir`; 15 my $llvm_lib = `perl @LLVM_CONFIG@ --libdir`;
16 $llvm_lib =~ s/\s+$//; 16 $llvm_lib =~ s/\s+$//;
17 $llvm_rev = ctime(stat($llvm_lib)->mtime) if (-d $llvm_lib); 17 $llvm_rev = ctime(stat($llvm_lib)->mtime) if (-d $llvm_lib);
18 $llvm_rev = qq!#include "llvm/Config/config.h"\n#define LLVM_REV PACKAGE_STRING" ($llvm_rev)"!; 18 $llvm_rev = qq!#include "llvm/Config/config.h"\n#define LLVM_REV PACKAGE_STRING" ($llvm_rev)"!;
19 } 19 }
20 20
21 my $ldc_rev = `hg -R@PROJECT_SOURCE_DIR@ tip --template {rev}`; 21 my $ldc_rev = `hg -R@PROJECT_SOURCE_DIR@ log -r qparent --template '{rev}:{node|short} ({date|isodate})' 2>/dev/null || hg -R@PROJECT_SOURCE_DIR@ tip --template '{rev}:{node|short} ({date|isodate})'`;
22 22
23 my $out = qq!#ifndef LDC_VERSIONS_H 23 my $out = qq!#ifndef LDC_VERSIONS_H
24 #define LDC_VERSIONS_H 24 #define LDC_VERSIONS_H
25 25
26 $llvm_rev 26 $llvm_rev
27 #define LDC_REV "rev.$ldc_rev" 27 #define LDC_REV "rev. $ldc_rev"
28 28
29 #endif // LDC_VERSIONS_H\n!; 29 #endif // LDC_VERSIONS_H\n!;
30 30
31 my $revh; 31 my $revh;
32 my $old = ""; 32 my $old = "";