Bug 78800

Summary: just checking for CVS subdir is not reliable enough
Product: [Applications] cervisia Reporter: Hendrik Sattler <sattler2000>
Component: generalAssignee: Christian Loose <christian.loose>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 2.1.1   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:

Description Hendrik Sattler 2004-03-31 13:59:44 UTC
Version:           2.1.1 (using KDE KDE 3.2.1)
Installed from:    Debian testing/unstable Packages

Hi,

cervisia does a completely wrong thing if I simply name a subfolder CVS. It then thinks that this is a valid cvs folder.

However, this very simple check is not reliable. You should check the files in the CVS subdir instead (read: no more and no less than the ususal files in the CVS subdir created by cvs).

HS
Comment 1 Christian Loose 2004-03-31 17:14:48 UTC
So far this wasn't seen as a problem, but I agree that the test for a CVS controlled folder should be made safer.

Thanks for the report.

Christian
Comment 2 Frerich Raabe 2004-04-01 11:47:28 UTC
CVS commit by raabe: 

- Look harder for whether a directory really is under CVS control by not
  only checking for the 'CVS/' subdirectory but also looking for some
  files which always seem to be there ("Entries", "Repository" and "Root").
CCMAIL:78800-done@bugs.kde.org


  M +4 -1      repository.cpp   1.13


--- kdesdk/cervisia/cvsservice/repository.cpp  #1.12:1.13
@@ -133,5 +133,8 @@ bool Repository::setWorkingCopy(const QS
     // is this really a cvs-controlled directory?
     const QFileInfo cvsDirInfo(path + "/CVS");
-    if( !cvsDirInfo.exists() || !cvsDirInfo.isDir() )
+    if( !cvsDirInfo.exists() || !cvsDirInfo.isDir() ||
+        !QFile::exists( cvsDirInfo.dirPath() + "/Entries" ) ||
+        !QFile::exists( cvsDirInfo.dirPath() + "/Repository" ) ||
+        !QFile::exists( cvsDirInfo.dirPath() + "/Root" ) )
         return false;