|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r49420 - trunk/tools/inspect
From: bdawes_at_[hidden]
Date: 2008-10-21 11:43:48
Author: bemandawes
Date: 2008-10-21 11:43:47 EDT (Tue, 21 Oct 2008)
New Revision: 49420
URL: http://svn.boost.org/trac/boost/changeset/49420
Log:
If revision not found in inspect root, try directory svn_info one level up
Text files modified:
trunk/tools/inspect/inspect.cpp | 24 +++++++++++++++++-------
1 files changed, 17 insertions(+), 7 deletions(-)
Modified: trunk/tools/inspect/inspect.cpp
==============================================================================
--- trunk/tools/inspect/inspect.cpp (original)
+++ trunk/tools/inspect/inspect.cpp 2008-10-21 11:43:47 EDT (Tue, 21 Oct 2008)
@@ -104,13 +104,7 @@
// get info (as a string) if inspect_root is svn working copy --------------//
- string info( const fs::path & inspect_root )
- {
- string rev;
- string repos;
- fs::path entries( inspect_root / ".svn" / "entries" );
- fs::ifstream entries_file( entries );
- if ( entries_file )
+ void extract_info( fs::ifstream & entries_file, string & rev, string & repos )
{
std::getline( entries_file, rev );
std::getline( entries_file, rev );
@@ -118,6 +112,22 @@
std::getline( entries_file, rev ); // revision number as a string
std::getline( entries_file, repos ); // repository as a string
}
+
+ string info( const fs::path & inspect_root )
+ {
+ string rev( "?" );
+ string repos( "unknown" );
+ fs::path entries( inspect_root / ".svn" / "entries" );
+ fs::ifstream entries_file( entries );
+ if ( entries_file )
+ extract_info( entries_file, rev, repos );
+ else
+ {
+ entries = inspect_root / ".." / "svn_info" / ".svn" / "entries";
+ fs::ifstream entries_file( entries );
+ if ( entries_file )
+ extract_info( entries_file, rev, repos );
+ }
return repos + " at revision " + rev;
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk