X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLyXVC.cpp;h=7e7e770b10791fc9eae0c526f1c35d1db33619e3;hb=5366666c831b6ad726e848a60d738b57ec8b0501;hp=b18bcdfee37ebb3b6a10711f39ab7bdca2be44ac;hpb=750af391396ee60c95e20f3cf5ac06b1804860b5;p=lyx.git diff --git a/src/LyXVC.cpp b/src/LyXVC.cpp index b18bcdfee3..7e7e770b10 100644 --- a/src/LyXVC.cpp +++ b/src/LyXVC.cpp @@ -58,9 +58,9 @@ bool LyXVC::fileInVC(FileName const & fn) return true; if (!CVS::findFile(fn).empty()) return true; - if (!SVN::findFile(fn).empty()) + if (SVN::findFile(fn)) return true; - if (!GIT::findFile(fn).empty()) + if (GIT::findFile(fn)) return true; return false; } @@ -80,13 +80,13 @@ bool LyXVC::file_found_hook(FileName const & fn) return true; } // Check if file is under SVN - if (!(found_file = SVN::findFile(fn)).empty()) { - vcs_.reset(new SVN(found_file, owner_)); + if (SVN::findFile(fn)) { + vcs_.reset(new SVN(owner_)); return true; } // Check if file is under GIT - if (!(found_file = GIT::findFile(fn)).empty()) { - vcs_.reset(new GIT(found_file, owner_)); + if (GIT::findFile(fn)) { + vcs_.reset(new GIT(owner_)); return true; } @@ -99,13 +99,12 @@ bool LyXVC::file_found_hook(FileName const & fn) bool LyXVC::file_not_found_hook(FileName const & fn) { // Check if file is under version control. - // This happens if we are trying to load does not exist. - // It may yet exist in the repository and so could be - // checked out. + // This happens if we are trying to load file that does not exist. + // It may yet exist in the repository and so could be checked out. bool foundRCS = !RCS::findFile(fn).empty(); bool foundCVS = foundRCS ? false : !CVS::findFile(fn).empty(); - bool foundSVN = (foundRCS || foundCVS) ? false : !SVN::findFile(fn).empty(); - bool foundGIT = (foundRCS || foundCVS || foundSVN) ? false : !GIT::findFile(fn).empty(); + bool foundSVN = (foundRCS || foundCVS) ? false : SVN::findFile(fn); + bool foundGIT = (foundRCS || foundCVS || foundSVN) ? false : GIT::findFile(fn); if (foundRCS || foundCVS || foundSVN || foundGIT) { docstring const file = makeDisplayPath(fn.absFileName(), 20); docstring const text = @@ -159,14 +158,14 @@ bool LyXVC::registrer() if (!found.empty()) { LYXERR(Debug::LYXVC, "LyXVC: registering " << to_utf8(filename.displayName()) << " with GIT"); - vcs_.reset(new GIT(found, owner_)); + vcs_.reset(new GIT(owner_)); } else { found = VCS::checkParentDirs(filename, ".svn/entries"); if (!found.empty()) { LYXERR(Debug::LYXVC, "LyXVC: registering " << to_utf8(filename.displayName()) << " with SVN"); - vcs_.reset(new SVN(found, owner_)); + vcs_.reset(new SVN(owner_)); } else { // We only need to check the current directory, since CVS meta-data @@ -198,8 +197,6 @@ bool LyXVC::registrer() } if (response.empty()) response = _("(no initial description)"); - // FIXME This will fail with svn if the current directory has not - // itself been added. vcs_->registrer(to_utf8(response)); return true; }