mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Remove partial support for non-buffer files in VCS
This reverts a small part of0526eb9d
and gets rid of the double calls of SVN::findFile() and GIT::findFile(). Please note that git detection does currently not work because of26dd4d0c
.
This commit is contained in:
parent
d25afed517
commit
ceb2303e2b
@ -327,7 +327,6 @@ string LyXVC::toggleReadOnly()
|
||||
return log;
|
||||
}
|
||||
case VCS::NOLOCKING:
|
||||
case VCS::UNVERSIONED:
|
||||
break;
|
||||
}
|
||||
return string();
|
||||
@ -337,7 +336,7 @@ string LyXVC::toggleReadOnly()
|
||||
bool LyXVC::inUse() const
|
||||
{
|
||||
if (vcs)
|
||||
return vcs->status() != VCS::UNVERSIONED;
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -124,6 +124,8 @@ bool VCS::checkparentdirs(FileName const & file, std::string const & pathname)
|
||||
|
||||
RCS::RCS(FileName const & m, Buffer * b) : VCS(b)
|
||||
{
|
||||
// Here we know that the buffer file is either already in RCS or
|
||||
// about to be registered
|
||||
master_ = m;
|
||||
scanMaster();
|
||||
}
|
||||
@ -404,7 +406,7 @@ bool RCS::toggleReadOnlyEnabled()
|
||||
// This got broken somewhere along lfuns dispatch reorganization.
|
||||
// reloadBuffer would be needed after this, but thats problematic
|
||||
// since we are inside Buffer::dispatch.
|
||||
// return return status() != UNVERSIONED;
|
||||
// return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -513,6 +515,8 @@ bool RCS::prepareFileRevisionEnabled()
|
||||
|
||||
CVS::CVS(FileName const & m, Buffer * b) : VCS(b)
|
||||
{
|
||||
// Here we know that the buffer file is either already in CVS or
|
||||
// about to be registered
|
||||
master_ = m;
|
||||
have_rev_info_ = false;
|
||||
scanMaster();
|
||||
@ -553,7 +557,6 @@ void CVS::scanMaster()
|
||||
LYXERR(Debug::LYXVC, "\tlooking for `" << tmpf << '\'');
|
||||
string line;
|
||||
static regex const reg("/(.*)/(.*)/(.*)/(.*)/(.*)");
|
||||
vcstatus = UNVERSIONED;
|
||||
while (getline(ifs, line)) {
|
||||
LYXERR(Debug::LYXVC, "\t line: " << line);
|
||||
if (contains(line, tmpf)) {
|
||||
@ -1139,6 +1142,8 @@ bool CVS::prepareFileRevisionEnabled()
|
||||
|
||||
SVN::SVN(FileName const & m, Buffer * b) : VCS(b)
|
||||
{
|
||||
// Here we know that the buffer file is either already in SVN or
|
||||
// about to be registered
|
||||
master_ = m;
|
||||
locked_mode_ = 0;
|
||||
scanMaster();
|
||||
@ -1173,12 +1178,8 @@ FileName const SVN::findFile(FileName const & file)
|
||||
|
||||
void SVN::scanMaster()
|
||||
{
|
||||
// vcstatus code other than UNVERSIONED is somewhat superflous,
|
||||
// vcstatus code is somewhat superflous,
|
||||
// until we want to implement read-only toggle for svn.
|
||||
FileName f = findFile(owner_->fileName());
|
||||
if (f.empty()) {
|
||||
vcstatus = UNVERSIONED;
|
||||
} else {
|
||||
vcstatus = NOLOCKING;
|
||||
if (checkLockMode()) {
|
||||
if (isLocked())
|
||||
@ -1186,7 +1187,6 @@ void SVN::scanMaster()
|
||||
else
|
||||
vcstatus = UNLOCKED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1813,6 +1813,8 @@ bool SVN::toggleReadOnlyEnabled()
|
||||
|
||||
GIT::GIT(FileName const & m, Buffer * b) : VCS(b)
|
||||
{
|
||||
// Here we know that the buffer file is either already in GIT or
|
||||
// about to be registered
|
||||
master_ = m;
|
||||
scanMaster();
|
||||
}
|
||||
@ -1867,12 +1869,8 @@ FileName const GIT::findFile(FileName const & file)
|
||||
|
||||
void GIT::scanMaster()
|
||||
{
|
||||
// vcstatus code other than UNVERSIONED is somewhat superflous,
|
||||
// vcstatus code is somewhat superflous,
|
||||
// until we want to implement read-only toggle for git.
|
||||
FileName f = findFile(owner_->fileName());
|
||||
if (f.empty())
|
||||
vcstatus = UNVERSIONED;
|
||||
else
|
||||
vcstatus = NOLOCKING;
|
||||
}
|
||||
|
||||
|
@ -33,9 +33,6 @@ public:
|
||||
UNLOCKED,
|
||||
LOCKED,
|
||||
NOLOCKING,
|
||||
/// This file is not in version control, but it could be aded
|
||||
/// (because the path is under version control)
|
||||
UNVERSIONED,
|
||||
};
|
||||
|
||||
VCS(Buffer * b) : owner_(b) {}
|
||||
|
Loading…
Reference in New Issue
Block a user