RCS case is more complicated

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35314 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Pavel Sanda 2010-09-07 12:12:31 +00:00
parent db1f90a7f8
commit 1512439fa4
2 changed files with 9 additions and 2 deletions

View File

@ -111,6 +111,9 @@ public:
* which is interpreted as how many revision back from the current
* one do we want. rev=0 is reserved for the last (committed) revision.
* We need rev to be string, since in various VCS revision is not integer.
* If RCS addressed by a single number, it is automatically used
* as the last number in the whole revision specification (it applies
* for retrieving normal revisions (rev>0) or backtracking (rev<0).
*/
bool prepareFileRevision(std::string const & rev, std::string & f);
/// Does the current VC supports this operation?

View File

@ -293,8 +293,12 @@ bool RCS::prepareFileRevision(string const &revis, string & f)
if (isStrInt(rev)) {
int back = convert<int>(rev);
if (back > 0)
return false;
// if positive use as the last number in the whole revision string
if (back > 0) {
string base;
rsplit(version_, base , '.' );
rev = base + "." + rev;
}
if (back == 0)
rev = version_;
// we care about the last number from revision string