]> git.lyx.org Git - lyx.git/blobdiff - src/LyXVC.cpp
Inset::forceLTR() only determines whether explicit switches are needed
[lyx.git] / src / LyXVC.cpp
index ed0a7991434845c15068d74ed9f4d933bcac28f1..7e7e770b10791fc9eae0c526f1c35d1db33619e3 100644 (file)
@@ -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;
        }
 
@@ -98,13 +98,13 @@ bool LyXVC::file_found_hook(FileName const & fn)
 
 bool LyXVC::file_not_found_hook(FileName const & fn)
 {
-       // Check if file is under RCS.
-       // This happens if we are trying to load non existent
-       // file on disk, but existent in ,v version.
+       // Check if file is under version control.
+       // 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 =
@@ -158,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
@@ -197,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;
 }