[PATCH] Detect cvs & svn directories more accurately



Use os.path.isdir() instead of exists() as it more accurately detects
a CVS or subversion handled working copy.

-- 
Vincent Legoll
Index: vc/cvs.py
===================================================================
--- vc/cvs.py	(révision 1157)
+++ vc/cvs.py	(copie de travail)
@@ -35,7 +35,7 @@
     PATCH_INDEX_RE = "^Index:(.*)$"
 
     def __init__(self, location):
-        if not os.path.exists("%s/CVS"% location):
+        if not os.path.isdir("%s/CVS" % location):
             raise ValueError
         self.root = location
 
Index: vc/svn.py
===================================================================
--- vc/svn.py	(révision 1157)
+++ vc/svn.py	(copie de travail)
@@ -34,7 +34,7 @@
     PATCH_INDEX_RE = "^Index:(.*)$"
 
     def __init__(self, location):
-        if not os.path.exists("%s/.svn"%location):
+        if not os.path.isdir("%s/.svn" % location):
             raise ValueError()
         self.root = location
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]