Add support for bzr checkouts (similar to git checkouts) to make-version.pl.

Also, add modelines.

svn path=/trunk/; revision=44920
This commit is contained in:
Evan Huus 2012-09-15 16:09:07 +00:00
parent 201c4c45bf
commit 37f0380998
1 changed files with 35 additions and 1 deletions

View File

@ -182,7 +182,7 @@ sub read_svn_info {
}
close (CFGNMAKE);
}
if ($revision == 0) {
if ($revision == 0 and -d "$srcdir/.git") {
# Try git...
eval {
@ -208,6 +208,26 @@ sub read_svn_info {
1;
};
}
if ($revision == 0 and -d "$srcdir/.bzr") {
# Try bzr...
eval {
use warnings "all";
no warnings "all";
$svn_info_cmd = "(cd $srcdir; bzr log -l 1)";
$line = qx{$svn_info_cmd};
if (defined($line)) {
if ($line =~ /timestamp: \S+ (\d{4})-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)/) {
$last_change = timegm($6, $5, $4, $3, $2 - 1, $1);
}
if ($line =~ /svn revno: (\d+) \(on (\S+)\)/) {
$revision = $1;
$repo_path = $2;
}
}
1;
};
}
# 'svn info' failed or the user really wants us to dig around in .svn/entries
@ -610,3 +630,17 @@ make-version.pl [options] [source directory]
Options can be used in any combination. If none are specified B<--set-svn>
is assumed.
#
# Editor modelines - http://www.wireshark.org/tools/modelines.html
#
# Local variables:
# c-basic-offset: 8
# tab-width: 8
# indent-tabs-mode: t
# End:
#
# vi: set shiftwidth=8 tabstop=8 noexpandtab:
# :indentSize=8:tabSize=8:noTabs=false:
#
#