Bug 78800 - just checking for CVS subdir is not reliable enough
Summary: just checking for CVS subdir is not reliable enough
Status: RESOLVED FIXED
Alias: None
Product: cervisia
Classification: Applications
Component: general (show other bugs)
Version: 2.1.1
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Christian Loose
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-31 13:59 UTC by Hendrik Sattler
Modified: 2004-04-01 11:47 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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;