[py-svn] r8660 - in py/dist/py/path/svn: . testing

hpk at codespeak.net hpk at codespeak.net
Fri Jan 28 13:20:22 CET 2005


Author: hpk
Date: Fri Jan 28 13:20:22 2005
New Revision: 8660

Modified:
   py/dist/py/path/svn/testing/test_wccommand.py
   py/dist/py/path/svn/wccommand.py
Log:
sanitize the .svn versioned() checks 
(it seems subversion changed somehow its output) 


Modified: py/dist/py/path/svn/testing/test_wccommand.py
==============================================================================
--- py/dist/py/path/svn/testing/test_wccommand.py	(original)
+++ py/dist/py/path/svn/testing/test_wccommand.py	Fri Jan 28 13:20:22 2005
@@ -98,6 +98,7 @@
 
     def test_versioned(self):
         assert self.root.check(versioned=1)
+        assert self.root.join('.svn').check(versioned=0) 
         assert self.root.join('samplefile').check(versioned=1)
         assert not self.root.join('notexisting').check(versioned=1)
         notexisting = self.root.join('hello').localpath

Modified: py/dist/py/path/svn/wccommand.py
==============================================================================
--- py/dist/py/path/svn/wccommand.py	(original)
+++ py/dist/py/path/svn/wccommand.py	Fri Jan 28 13:20:22 2005
@@ -310,9 +310,12 @@
                 if e.err.find('Path is not a working copy directory') != -1:
                     raise py.error.ENOENT(self, e.err)
                 raise
-            if output.find('Not a versioned resource') != -1:
+            output = output.lower() 
+            if output.find('not a versioned resource') != -1:
                 raise py.error.ENOENT(self, output)
-            info = InfoSvnWCCommand(path.local(self.strpath), output)
+            info = InfoSvnWCCommand(output)
+            if info.path != self.localpath: 
+                raise py.error.ENOENT(self, "not a versioned resource") 
             cache.info[self] = info
         self.rev = info.rev
         return info
@@ -327,7 +330,7 @@
             fil = common.fnmatch(fil)
         # XXX unify argument naming with LocalPath.listdir
         def notsvn(path):
-            return not path.get('basename') == '.svn'
+            return path.basename != '.svn' 
 
         paths = []
         for localpath in self.localpath.listdir(notsvn):
@@ -355,13 +358,15 @@
             self.path = path.localpath
         def versioned(self):
             try:
-                s = self.svnwcpath.status()
+                s = self.svnwcpath.info()
+            except py.error.ENOENT: 
+                return False 
             except py.process.cmdexec.Error, e:
                 if e.err.find('is not a working copy')!=-1:
                     return False
                 raise
             else:
-                return self.svnwcpath in s.allpath(ignored=0,unknown=0, deleted=0)
+                return True 
 
     def log(self, rev_start=None, rev_end=1, verbose=False):
         from py.__impl__.path.svn.command import _Head, LogEntry
@@ -424,7 +429,7 @@
         return l
 
 class InfoSvnWCCommand:
-    def __init__(self, path, output):
+    def __init__(self, output):
         # Path: test
         # URL: http://codespeak.net/svn/std.path/trunk/dist/std.path/test
         # Repository UUID: fd0d7bf2-dfb6-0310-8d31-b7ecfe96aada
@@ -450,7 +455,8 @@
             raise ValueError, "Not a versioned resource %r" % path
         self.kind = d['nodekind'] == 'directory' and 'dir' or d['nodekind']
         self.rev = int(d['revision'])
-        self.size = path.size()
+        self.path = py.path.local(d['path'])
+        self.size = self.path.size()
         if 'lastchangedrev' in d:
             self.created_rev = int(d['lastchangedrev'])
             self.last_author = d['lastchangedauthor']



More information about the pytest-commit mailing list