[py-svn] r6951 - in py/dist/py: . execnet path/fspy path/svn path/svnwc path/test test

hpk at codespeak.net hpk at codespeak.net
Fri Oct 15 13:29:06 CEST 2004


Author: hpk
Date: Fri Oct 15 13:29:06 2004
New Revision: 6951

Added:
   py/dist/py/path/svn/svncommon.py
      - copied unchanged from r6950, py/dist/py/path/svn/common.py
   py/dist/py/path/svn/svntestbase.py
      - copied, changed from r6950, py/dist/py/path/test/svncommonfs.py
   py/dist/py/path/svn/test_urlcommand.py
      - copied, changed from r6950, py/dist/py/path/svn/test_command.py
   py/dist/py/path/svn/test_wccommand.py
      - copied, changed from r6950, py/dist/py/path/svnwc/test_command.py
   py/dist/py/path/svn/urlcommand.py
      - copied, changed from r6950, py/dist/py/path/svn/command.py
   py/dist/py/path/svn/wccommand.py
      - copied, changed from r6950, py/dist/py/path/svnwc/command.py
Removed:
   py/dist/py/path/fspy/pypath_test.py
   py/dist/py/path/svn/command.py
   py/dist/py/path/svn/common.py
   py/dist/py/path/svn/test_command.py
   py/dist/py/path/svnwc/
   py/dist/py/path/test/svncommonfs.py
Modified:
   py/dist/py/__init__.py
   py/dist/py/execnet/register.py
   py/dist/py/path/test/test_api.py
   py/dist/py/pytest.conf
   py/dist/py/test/cmdline.py
Log:
- hah! the power of export name control has let me do

  a large implementation level refactoring for the 
  svn-paths "py.path.svnurl" and "py.path.svnwc" 
  without affecting any outside callers/users of the
  API. IMHO this shows that "export name control" is
  the way to go ... because one can reorganize the 
  implementation 

    a) without affecting the caller side 

    b) without requiring the caller side to follow
       funny IInterface schemes but simply see 
       "normal" python object from the outside 



Modified: py/dist/py/__init__.py
==============================================================================
--- py/dist/py/__init__.py	(original)
+++ py/dist/py/__init__.py	Fri Oct 15 13:29:06 2004
@@ -3,8 +3,8 @@
     'path.local':         './path/local/local.LocalPath',
     'path.checker':       './path/common.checker', 
     'path.invchecker':    './path/common.invchecker', 
-    'path.svnurl':        './path/svn/command.SvnCommandPath',
-    'path.svnwc':         './path/svnwc/command.SvnWCCommandPath',
+    'path.svnurl':        './path/svn/urlcommand.SvnCommandPath',
+    'path.svnwc':         './path/svn/wccommand.SvnWCCommandPath',
     'path.fspy':          './path/fspy/fspy.Fspy',
     'path.NotFound':      './path/error.FileNotFound',
     'path.Denied':        './path/error.PermissionDenied', 

Modified: py/dist/py/execnet/register.py
==============================================================================
--- py/dist/py/execnet/register.py	(original)
+++ py/dist/py/execnet/register.py	Fri Oct 15 13:29:06 2004
@@ -47,7 +47,10 @@
             self.trace("could not receive child PID")
         else:
             self.trace("waiting for pid %s" % pid) 
-            os.waitpid(pid, 0) 
+            try:
+                os.waitpid(pid, 0) 
+            except OSError: 
+                self.trace("child process %s already dead?" %pid) 
 
 class SocketGateway(InstallableGateway):
     def __init__(self, host, port): 

Deleted: /py/dist/py/path/fspy/pypath_test.py
==============================================================================
--- /py/dist/py/path/fspy/pypath_test.py	Fri Oct 15 13:29:06 2004
+++ (empty file)
@@ -1,168 +0,0 @@
-import sys, os
-from py import path, test
-from py.__impl__.path.pypath import pypath 
-
-class TestPyPath:
-    root = path.py(pypath.__name__) 
-
-    def test_join(self):
-        p = self.root.join('PyPath')
-        obj = p.resolve()
-        assert obj is path.py 
-
-    def test_listdir_module(self):
-        l = self.root.listdir()
-        basenames = [x.basename for x in l]
-        dlist = dir(pypath)
-        for name in dlist:
-            assert name in basenames
-        for name in basenames:
-            assert name in dlist
-
-    def test_listdir_class(self):
-        l = self.root.join('PyPath').listdir()
-        basenames = [x.basename for x in l]
-        dlist = dir(pypath.PyPath)
-        for name in dlist:
-            assert name in basenames
-        for name in basenames:
-            assert name in dlist
-
-    def listobj(self):
-        l = self.root.listobj(basestarts='path')
-        assert len(l) == 1
-        assert l[0] == path 
-
-    def test_visit(self):
-        PyPath = pypath.PyPath 
-        l = list(self.root.visit(path.checker(basename='PyPath')))
-        assert len(l) == 1
-        obj = l[0]
-        assert str(obj).endswith('path.pypath.pypath.PyPath')
-        assert obj.resolve() is PyPath
-
-    def test_visit_fnmatch(self):
-        PyPath = pypath.PyPath 
-        l = list(self.root.visit('PyPath'))
-        assert len(l) == 1
-        obj = l[0]
-        assert str(obj).endswith('path.pypath.pypath.PyPath')
-        assert obj.resolve() is PyPath
-
-    def test_specified_base_empty_path(self):
-        p = path.py('', ns=ExampleClass) 
-        l = p.listdir()
-        basenames = [x.basename for x in l]
-        assert 'testattr' in basenames
-
-    def test_join_from_empty(self):
-        p = path.py('') 
-        n = p.join('tokenize')
-        assert str(n) == 'tokenize'
-
-        p = path.py('', ns=os) 
-        n = p.join('getlogin')
-        assert str(n) == 'getlogin'
-
-    def test_unspecifiedpypath_lists_modules(self):
-        p = path.py('') 
-        l = p.listdir()
-        for i in l:
-            assert '.' not in str(i)
-
-        for j in sys.modules:
-            for i in l:
-                if j.startswith(str(i)):
-                    break
-            else:
-                self.fail("%s is not in sys.modules")
-
-    def test_main_works(self):
-        m = path.py('__main__') 
-        import __main__
-        assert m.resolve() is __main__
-
-    def test_relto(self):
-        m1 = path.py('a.b.c.d')
-        m2 = path.py('a.b')
-        m3 = path.py('')
-        res = m1.relto(m2)
-        assert str(res) == 'c.d'
-        assert m2.relto(m3) == str(m2)
-
-    def test_basename(self):
-        m1 = path.py('a.b.hello')
-        assert m1.basename == 'hello'
-        assert m1.check(basename='hello')
-        assert not m1.check(basename='nono')
-        assert m1.check(basestarts='he')
-        assert not m1.check(basestarts='42')
-
-    def test_dirpath(self):
-        m1 = path.py('a.b.hello')
-        m2 = path.py('a.b') 
-        m3 = path.py('a') 
-        m4 = path.py() 
-        assert m1.dirpath() == m2 
-        assert m2.dirpath() == m3 
-        assert m3.dirpath() == m4 
-
-    def test_function(self):
-        class A:
-            i = 3
-            def func(self):
-                pass
-        p = path.py('func', ns=A)
-        assert p.check(func=1)
-        p = path.py('i', ns=A)
-        assert p.check(func=0)
-
-    def test_hashing_equality(self):
-        x = path.py('os.path')
-        y = path.py('os.path')
-        assert x == y 
-        assert hash(x) == hash(y) 
-
-    def test_parents(self):
-        x = path.py('os.path.abspath')
-        l = x.parts() 
-        assert len(l) == 4 
-        assert path.py('') == l[0]
-        assert path.py('os') == l[1]
-        assert path.py('os.path') == l[2]
-        assert path.py('os.path.abspath') == l[3]
-        
-class TestEval:
-    disabled = True
-    def test_funccall(self):
-        p = path.py('os.path.join("a", "b")')
-        s = p.resolve()
-        assert s == os.path.join("a", "b")
-
-    def test_invalid1(self):
-        p = path.py('os.path.qwe("a", "b")')
-        s = test.raises(path.NotFound, "p.resolve()")
-
-    def test_syntaxerror(self):
-        p = path.py('os.path.qwe("a", ')
-        s = test.raises(ValueError, "p.resolve()")
-
-class TestErrors: 
-    def test_FileNotFound(self):
-        p = path.py('somesuch')
-        test.raises(path.NotFound, p.resolve)
-        p = path.py('email.whatever')
-        test.raises(path.NotFound, p.resolve)
-
-    def test_attributeerror(self):
-        p = path.py('os.path.qabspath')
-        test.raises(path.NotFound, p.resolve)
-
-    #def test_ImportError():
-    #    p = path.py('__std.utest.test.data.failingimport.someattr') 
-    #    utest.raises(ImportError, p.resolve)
-
-class ExampleClass:
-    testattr = 1
-
-test.main()

Deleted: /py/dist/py/path/svn/command.py
==============================================================================
--- /py/dist/py/path/svn/command.py	Fri Oct 15 13:29:06 2004
+++ (empty file)
@@ -1,231 +0,0 @@
-"""
-
-module defining a subversion path object based on the external
-command 'svn'. 
-
-"""
-
-import os, sys, time, re
-from py import path, process
-from py.__impl__.path import common 
-from py.__impl__.path import error 
-from py.__impl__.path.svn import common as svncommon 
-
-class SvnCommandPath(svncommon.SvnPathBase):
-    def __new__(cls, path, rev=None): 
-        if isinstance(path, cls): 
-            if path.rev == rev:
-                return path 
-        self = object.__new__(cls)
-        self.strpath = path.rstrip('/')
-        self.rev = rev
-        return self
-
-    def __repr__(self):
-        if self.rev == -1:
-            return 'svnurl(%r)' % self.strpath 
-        else:
-            return 'svnurl(%r, %r)' % (self.strpath, self.rev) 
-
-    def _svn(self, cmd, *args):
-        if self.rev is None: 
-            l = ['svn %s' % cmd]
-        else:
-            l = ['svn %s -r %d' % (cmd, self.rev)]
-        args = map(lambda x: '"%s"' % str(x), args)
-        l.extend(args)
-        l.append(str(self.strpath))
-        # fixing the locale because we can't otherwise parse
-        string = svncommon.fixlocale() + " ".join(l)
-        #print "execing", string
-        out = process.cmdexec(string)
-        return out
-
-    def _svnwrite(self, cmd, *args):
-        l = ['svn %s' % cmd]
-        args = map(lambda x: '"%s"' % str(x), args)
-        l.extend(args)
-        l.append(str(self.strpath))
-        # fixing the locale because we can't otherwise parse
-        string = svncommon.fixlocale() + " ".join(l)
-        #print "execing", string
-        out = process.cmdexec(string)
-        return out
-
-    def open(self, mode='r'):
-        assert 'w' not in mode and 'a' not in mode, "XXX not implemented for svn cmdline" 
-        assert self.check(file=1) # svn cat returns an empty file otherwise
-        def popen(cmd):
-            return os.popen(cmd)
-        if self.rev is None:
-            return popen(svncommon.fixlocale() + 
-                            'svn cat "%s"' % (self.strpath, ))
-        else:
-            return popen(svncommon.fixlocale() + 
-                            'svn cat -r %s "%s"' % (self.rev, self.strpath))
-
-    def mkdir(self, commit_msg=None):
-        if commit_msg:
-            self._svnwrite('mkdir', '-m', commit_msg)
-        else:
-            self._svnwrite('mkdir')
-
-    def copy(self, target, msg='auto'):
-        if getattr(target, 'rev', None) is not None: 
-            raise path.Invalid("target can't have a revision: %r" % target)
-        process.cmdexec("svn copy -m %r %s %s" %(msg, str(self), str(target)))
-
-    def remove(self, rec=1, msg='auto'):
-        if self.rev is not None:
-            raise path.Invalid("cannot remove revisioned object: %r" % self)
-        process.cmdexec("svn rm -m %r %s" %(msg, str(self)))
-
-    def _propget(self, name):
-        res = self._svn('propget', name)
-        return res[:-1] # strip trailing newline
-
-    def _proplist(self):
-        res = self._svn('proplist')
-        lines = res.split('\n')
-        lines = map(str.strip, lines[1:])
-        return svncommon.PropListDict(self, lines)
-
-    def _listdir_nameinfo(self):
-        """ return sequence of name-info directory entries of self """
-        try:
-            res = self._svn('ls', '-v')
-        except process.cmdexec.Error, e:
-            if e.err.find('non-existent in that revision') != -1:
-                raise error.FileNotFound(self, e.err)
-            elif e.err.find('not part of a repository')!=-1:
-                raise IOError, e.err
-            elif e.err.find('Unable to open')!=-1:
-                raise IOError, e.err
-            elif e.err.lower().find('method not allowed')!=-1:
-                raise IOError, e.err
-            raise 
-        lines = res.split('\n')
-        nameinfo_seq = []
-        for lsline in lines:
-            if lsline:
-                info = InfoSvnCommand(lsline)
-                nameinfo_seq.append((info._name, info))
-        return nameinfo_seq
-
-    def log(self, rev_start=None, rev_end=1, verbose=False):
-        assert self.check() #make it simpler for the pipe
-        rev_start = rev_start is None and _Head or rev_start
-        rev_end = rev_end is None and _Head or rev_end
-
-        if rev_start is _Head and rev_end == 1:
-            rev_opt = ""
-        else:
-            rev_opt = "-r %s:%s" % (rev_start, rev_end)
-        verbose_opt = verbose and "-v" or ""
-        xmlpipe =  os.popen(svncommon.fixlocale() +
-                      'svn log --xml %s %s "%s"' % 
-                      (rev_opt, verbose_opt, self.strpath))
-        from xml.dom import minidom
-        tree = minidom.parse(xmlpipe)
-        result = []
-        for logentry in filter(None, tree.firstChild.childNodes):
-            if logentry.nodeType == logentry.ELEMENT_NODE:
-                result.append(LogEntry(logentry))
-        return result
-
-#01234567890123456789012345678901234567890123467
-#   2256      hpk        165 Nov 24 17:55 __init__.py
-#
-class InfoSvnCommand:
-    #lspattern = re.compile(r'(\D*)(\d*)\s*(\w*)\s*(
-    def __init__(self, line):
-        # this is a typical line from 'svn ls http://...'
-        #_    1127      jum        0 Jul 13 15:28 branch/
-        l = [line[:7], line[7:16], line[16:27], line[27:40], line[41:]]
-        l = map(str.lstrip, l)
-
-        self._name = l.pop()
-        if self._name[-1] == '/':
-            self._name = self._name[:-1]
-            self.kind = 'dir'
-        else:
-            self.kind = 'file'
-        #self.has_props = l.pop(0) == 'P'
-        self.created_rev = int(l[0])
-        self.last_author = l[1]
-        self.size = l[2] and int(l[2]) or 0
-        datestr = l[3]
-        self.mtime = parse_time_with_missing_year(datestr)
-        self.time = self.mtime * 1000000
-
-    def __eq__(self, other):
-        return self.__dict__ == other.__dict__
-
-
-#____________________________________________________
-#
-# helper functions
-#____________________________________________________
-def parse_time_with_missing_year(timestr):
-    """ analyze the time part from a single line of "svn ls -v" 
-    the svn output doesn't show the year makes the 'timestr'
-    ambigous. 
-    """
-    t_now = time.gmtime()
-
-    tparts = timestr.split()
-    month = time.strptime(tparts.pop(0), '%b')[1]
-    day = time.strptime(tparts.pop(0), '%d')[2]
-    last = tparts.pop(0) # year or hour:minute 
-    try:
-        year = time.strptime(last, '%Y')[0]
-        hour = minute = 0
-    except ValueError:
-        hour, minute = time.strptime(last, '%H:%M')[3:5]
-        year = t_now[0]
-
-        t_result = (year, month, day, hour, minute, 0,0,0,0)
-        if t_result > t_now:
-            year -= 1
-    t_result = (year, month, day, hour, minute, 0,0,0,0)
-    return time.mktime(t_result)
-
-class PathEntry:
-    def __init__(self, ppart):
-        self.strpath = ppart.firstChild.nodeValue.encode('UTF-8')
-        self.action = ppart.getAttribute('action').encode('UTF-8')
-        if self.action == 'A':
-            self.copyfrom_path = ppart.getAttribute('copyfrom-path').encode('UTF-8')
-            if self.copyfrom_path:
-                self.copyfrom_rev = int(ppart.getAttribute('copyfrom-rev'))
-
-class LogEntry:
-    def __init__(self, logentry):
-        self.rev = int(logentry.getAttribute('revision'))
-        for lpart in filter(None, logentry.childNodes):
-            if lpart.nodeType == lpart.ELEMENT_NODE:
-                if lpart.nodeName == u'author':
-                    self.author = lpart.firstChild.nodeValue.encode('UTF-8')
-                elif lpart.nodeName == u'msg':
-                    if lpart.firstChild:
-                        self.msg = lpart.firstChild.nodeValue.encode('UTF-8')
-                    else:
-                        self.msg = ''
-                elif lpart.nodeName == u'date':
-                    #2003-07-29T20:05:11.598637Z
-                    timestr = lpart.firstChild.nodeValue.encode('UTF-8')   
-                    self.date = svncommon.parse_apr_time(timestr)
-                elif lpart.nodeName == u'paths':
-                    self.strpaths = []
-                    for ppart in filter(None, lpart.childNodes):
-                        if ppart.nodeType == ppart.ELEMENT_NODE:
-                            self.strpaths.append(PathEntry(ppart))
-    def __repr__(self):
-        return '<Logentry rev=%d author=%s date=%s>' % (
-            self.rev, self.author, self.date)
-                            
-
-class _Head:
-    def __str__(self):
-        return "HEAD"
-

Deleted: /py/dist/py/path/svn/common.py
==============================================================================
--- /py/dist/py/path/svn/common.py	Fri Oct 15 13:29:06 2004
+++ (empty file)
@@ -1,277 +0,0 @@
-"""
-module with a base subversion path object. 
-"""
-import os, sys, time, re
-from py import path, process
-from py.__impl__.path import error
-from py.__impl__.path import common
-
-#_______________________________________________________________
-
-class SvnPathBase(common.FSPathBase):
-    """ Base implementation for SvnPath implementations. """
-    sep = '/'
-
-    def _geturl(self):
-        return self.strpath
-    url = property(_geturl, None, None, "url of this svn-path.")
-
-    def __str__(self):
-        """ return a string representation (including rev-number) """
-        return self.strpath 
-
-    def __hash__(self):
-        return hash(self.strpath)
-
-    def new(self, **kw):
-        """ create a modified version of this path. A 'rev' argument
-            indicates a new revision.  
-            the following keyword arguments modify various path parts:
-
-              http://host.com/repo/path/file.ext 
-              |-----------------------|          dirname
-                                        |------| basename
-                                        |--|     purebasename
-                                            |--| ext
-        """
-        obj = object.__new__(self.__class__)
-        obj.rev = kw.get('rev', self.rev)
-
-        if 'basename' in kw:
-            if 'purebasename' in kw or 'ext' in kw:
-                raise ValueError("invalid specification")
-        else:
-            pb = kw.setdefault('purebasename', self.get('purebasename'))
-            ext = kw.setdefault('ext', self.get('ext'))
-            if ext and not ext.startswith('.'):
-                ext = '.' + ext
-            kw['basename'] = pb + ext
-
-        kw.setdefault('dirname', self.get('dirname'))
-        kw.setdefault('sep', self.sep)
-        if kw['basename']: 
-            obj.strpath = "%(dirname)s%(sep)s%(basename)s" % kw
-        else:
-            obj.strpath = "%(dirname)s" % kw
-        return obj
-
-    def get(self, spec):
-        """ get specified parts of the path.  'arg' is a string
-            with comma separated path parts. The parts are returned
-            in exactly the order of the specification. 
-    
-            you may specify the following parts: 
-
-            http://host.com/repo/path/file.ext 
-            |-----------------------|          dirname
-                                      |------| basename
-                                      |--|     purebasename
-                                          |--| ext
-        """
-        res = []
-        parts = self.strpath.split(self.sep)
-        for name in spec.split(','):
-            name = name.strip()
-            if name == 'dirname':
-                res.append(self.sep.join(parts[:-1]))
-            elif name == 'basename':
-                res.append(parts[-1])
-            else:
-                basename = parts[-1]
-                i = basename.rfind('.')
-                if i == -1:
-                    purebasename, ext = basename, ''
-                else:
-                    purebasename, ext = basename[:i], basename[i:]
-                if name == 'purebasename':
-                    res.append(purebasename)
-                elif name == 'ext':
-                    res.append(ext)
-                else:
-                    raise NameError, "Don't know part %r" % name
-        if len(res) == 1:
-            return res[0]
-        elif len(res) == 0:
-            return None
-        return res
-
-    def __eq__(self, other):
-        """ return true if path and rev attributes each match """
-        return (str(self) == str(other) and 
-               (self.rev == other.rev or self.rev == other.rev))
-
-    def __ne__(self, other):
-        return not self == other
-
-    def join(self, *args):
-        """ return a new Path (with the same revision) which is composed 
-            of the self Path followed by 'args' path components.
-        """
-        if not args:
-            return self
-        
-        args = tuple([arg.strip(self.sep) for arg in args])
-        parts = (self.strpath, ) + args
-        newpath = self.__class__(self.sep.join(parts), self.rev)
-        return newpath
-
-    def dirpath(self, *args):
-        """ return the directory Path of the current Path. """
-        return self.new(basename='').join(*args)
-
-    def propget(self, name):
-        """ return the content of the given property. """
-        value = self._propget(name)
-        return value
-
-    def proplist(self):
-        """ list all property names. """
-        content = self._proplist()
-        return content
-
-    # XXX unify argument naming with LocalPath.listdir
-    def listdir(self, fil=None, sort=None):
-        """ return a sequence of Paths.  
-
-        listdir will return either a tuple or a list of paths
-        depending on implementation choices. 
-        """
-        if isinstance(fil, str):
-            fil = common.fnmatch(fil)
-        nameinfo_seq = self._listdir_nameinfo() 
-        paths = self._make_path_tuple(nameinfo_seq)
-
-        if fil or sort:
-            paths = filter(fil, paths)
-            paths = isinstance(paths, list) and paths or list(paths)
-            if callable(sort):
-                paths.sort(sort)
-            elif sort:
-                paths.sort()
-        return paths
-
-    def info(self):
-        """ return an Info structure with svn-provided information. """
-        parent = self.dirpath()
-        nameinfo_seq = parent._listdir_nameinfo() 
-        bn = self.basename
-        for name, info in nameinfo_seq:
-            if name == bn: 
-                return info 
-        raise error.FileNotFound(self)
-
-    def size(self):
-        """ Return the size of the file content of the Path. """
-        return self.info().size
-
-    def mtime(self):
-        """ Return the last modification time of the file. """
-        return self.info().mtime
-
-    def relto(self, rel):
-        """ Return a string which is the relative part of the Path to 'rel'. 
-
-        If the Path is not relative to the given base, return an empty string. 
-        """
-        relpath = rel.strpath
-        if self.strpath.startswith(relpath):
-            return self.strpath[len(relpath)+1:]
-        return ""
-
-
-    # shared help methods
-
-    def _make_path_tuple(self, nameinfo_seq):
-        """ return a tuple of paths from a nameinfo-tuple sequence.
-        """
-        #assert self.rev is not None, "revision of %s should not be None here" % self
-        res = []
-        for name, info in nameinfo_seq:
-            child = self.join(name)
-            res.append(child)
-        return tuple(res)
-
-
-    #def _childmaxrev(self):
-    #    """ return maximum revision number of childs (or self.rev if no childs) """
-    #    rev = self.rev
-    #    for name, info in self._listdir_nameinfo():
-    #        rev = max(rev, info.created_rev)
-    #    return rev
-
-    #def _getlatestrevision(self):
-    #    """ return latest repo-revision for this path. """
-    #    url = self.strpath 
-    #    path = self.__class__(url, None)
-    #
-    #    # we need a long walk to find the root-repo and revision
-    #    while 1:
-    #        try:
-    #            rev = max(rev, path._childmaxrev())
-    #            previous = path
-    #            path = path.dirpath()
-    #        except (IOError, process.cmdexec.Error):
-    #            break
-    #    if rev is None: 
-    #        raise IOError, "could not determine newest repo revision for %s" % self
-    #    return rev
-
-    class Checkers(common.FSCheckers):
-        def _info(self):
-            try:
-                return self._infocache
-            except AttributeError:
-                self._infocache = self.path.info()
-                return self._infocache
-
-        def dir(self):
-            try:
-                return self._info().kind == 'dir'
-            except IOError:
-                return self._listdirworks()
-
-        def _listdirworks(self):
-            try:
-                self.path.listdir()
-            except error.FileNotFound:
-                return False
-            else:
-                return True
-
-        def file(self):
-            try:
-                return self._info().kind == 'file'
-            except (IOError, error.FileNotFound):
-                return False
-
-        def exists(self):
-            try:
-                return self._info()
-            except IOError:
-                return self._listdirworks()
-
-def parse_apr_time(timestr):
-    i = timestr.rfind('.')
-    if i == -1:
-        raise ValueError, "could not parse %s" % timestr
-    timestr = timestr[:i]
-    parsedtime = time.strptime(timestr, "%Y-%m-%dT%H:%M:%S")
-    return time.mktime(parsedtime)
-
-class PropListDict(dict):
-    """ a Dictionary which fetches values (InfoSvnCommand instances) lazily"""
-    def __init__(self, path, keynames):
-        dict.__init__(self, [(x, None) for x in keynames])
-        self.path = path
-
-    def __getitem__(self, key):
-        value = dict.__getitem__(self, key)
-        if value is None:
-            value = self.path.propget(key)
-            dict.__setitem__(self, key, value)
-        return value
-
-def fixlocale():
-    if sys.platform != 'win32':
-        return 'LC_ALL=C '
-    return ''

Copied: py/dist/py/path/svn/svntestbase.py (from r6950, py/dist/py/path/test/svncommonfs.py)
==============================================================================
--- py/dist/py/path/test/svncommonfs.py	(original)
+++ py/dist/py/path/svn/svntestbase.py	Fri Oct 15 13:29:06 2004
@@ -1,6 +1,6 @@
 import py
 from py import path, test, process
-from py.__impl__.path.test.fscommon import CommonFSTests 
+from py.__impl__.path.test.fscommon import CommonFSTests
 from py.__impl__.path.svn import cache 
 
 class CommonSvnTests(CommonFSTests):

Deleted: /py/dist/py/path/svn/test_command.py
==============================================================================
--- /py/dist/py/path/svn/test_command.py	Fri Oct 15 13:29:06 2004
+++ (empty file)
@@ -1,23 +0,0 @@
-import sys, os
-import py
-from py.__impl__.path.test import svncommonfs
-from py.__impl__.path.svnwc.test_command import getrepowc 
-
-class TestSvnCommandPath(svncommonfs.CommonCommandAndBindingTests):
-    def __init__(self):
-        repo, wc = getrepowc() 
-        self.root = py.path.svnurl(repo)
-
-    def xtest_copy_file(self):
-        raise py.test.run.Skipped(msg="XXX fix svnurl first")
-
-    def xtest_copy_dir(self):
-        raise py.test.run.Skipped(msg="XXX fix svnurl first")
-
-    def XXXtest_info_log(self):
-        url = self.root.join("samplefile")
-        res = url.log(rev_start=1155, rev_end=1155, verbose=True)
-        assert res[0].revision == 1155 and res[0].author == "jum"
-        from time import gmtime
-        t = gmtime(res[0].date)
-        assert t.tm_year == 2003 and t.tm_mon == 7 and t.tm_mday == 17

Copied: py/dist/py/path/svn/test_urlcommand.py (from r6950, py/dist/py/path/svn/test_command.py)
==============================================================================
--- py/dist/py/path/svn/test_command.py	(original)
+++ py/dist/py/path/svn/test_urlcommand.py	Fri Oct 15 13:29:06 2004
@@ -1,9 +1,9 @@
 import sys, os
 import py
-from py.__impl__.path.test import svncommonfs
-from py.__impl__.path.svnwc.test_command import getrepowc 
+from py.__impl__.path.svn.svntestbase import CommonCommandAndBindingTests 
+from py.__impl__.path.svn.test_wccommand import getrepowc 
 
-class TestSvnCommandPath(svncommonfs.CommonCommandAndBindingTests):
+class TestSvnCommandPath(CommonCommandAndBindingTests):
     def __init__(self):
         repo, wc = getrepowc() 
         self.root = py.path.svnurl(repo)

Copied: py/dist/py/path/svn/test_wccommand.py (from r6950, py/dist/py/path/svnwc/test_command.py)
==============================================================================
--- py/dist/py/path/svnwc/test_command.py	(original)
+++ py/dist/py/path/svn/test_wccommand.py	Fri Oct 15 13:29:06 2004
@@ -1,5 +1,5 @@
 import py
-from py.__impl__.path.test.svncommonfs import CommonSvnTests
+from py.__impl__.path.svn.svntestbase import CommonSvnTests
 from py.__impl__.path.test.fscommon import setuptestfs 
 
 # make a wc directory out of a given root url

Copied: py/dist/py/path/svn/urlcommand.py (from r6950, py/dist/py/path/svn/command.py)
==============================================================================
--- py/dist/py/path/svn/command.py	(original)
+++ py/dist/py/path/svn/urlcommand.py	Fri Oct 15 13:29:06 2004
@@ -9,7 +9,7 @@
 from py import path, process
 from py.__impl__.path import common 
 from py.__impl__.path import error 
-from py.__impl__.path.svn import common as svncommon 
+from py.__impl__.path.svn import svncommon 
 
 class SvnCommandPath(svncommon.SvnPathBase):
     def __new__(cls, path, rev=None): 

Copied: py/dist/py/path/svn/wccommand.py (from r6950, py/dist/py/path/svnwc/command.py)
==============================================================================
--- py/dist/py/path/svnwc/command.py	(original)
+++ py/dist/py/path/svn/wccommand.py	Fri Oct 15 13:29:06 2004
@@ -13,7 +13,7 @@
 import py 
 from py.__impl__.path import common 
 from py.__impl__.path.svn import cache
-from py.__impl__.path.svn import common as svncommon 
+from py.__impl__.path.svn import svncommon 
 
 DEBUG = 0
 

Deleted: /py/dist/py/path/test/svncommonfs.py
==============================================================================
--- /py/dist/py/path/test/svncommonfs.py	Fri Oct 15 13:29:06 2004
+++ (empty file)
@@ -1,106 +0,0 @@
-import py
-from py import path, test, process
-from py.__impl__.path.test.fscommon import CommonFSTests 
-from py.__impl__.path.svn import cache 
-
-class CommonSvnTests(CommonFSTests):
-
-    def setup_method(self, meth):
-        bn = meth.func_name 
-        if bn.startswith('test_remove') or bn.startswith('test_move'):
-            raise py.test.run.Skipped(msg=
-                "tests for (re)move require better svn state management")
-
-    def test_propget(self):
-        url = self.root.join("samplefile")
-        value = url.propget('svn:eol-style')
-        assert value == 'native'
-
-    def test_proplist(self):
-        url = self.root.join("samplefile")
-        res = url.proplist()
-        assert res['svn:eol-style'] == 'native'
-
-    def test_info(self):
-        url = self.root.join("samplefile")
-        res = url.info()
-        assert res.size > len("samplefile") and res.created_rev >= 0
-
-    def xxxtest_info_log(self):
-        url = self.root.join("samplefile")
-        res = url.log(rev_start=1155, rev_end=1155, verbose=True)
-        assert res[0].revision == 1155 and res[0].author == "jum"
-        from time import gmtime
-        t = gmtime(res[0].date)
-        assert t.tm_year == 2003 and t.tm_mon == 7 and t.tm_mday == 17
-
-class CommonCommandAndBindingTests(CommonSvnTests):
-    def test_trailing_slash_is_stripped(self):
-        # XXX we need to test more normalizing properties
-        url = self.root.join("/")
-        assert self.root == url
-
-    #def test_different_revs_compare_unequal(self):
-    #    newpath = self.root.new(rev=1199)
-    #    assert newpath != self.root
-
-    def test_exists_svn_root(self):
-        assert self.root.check()
-
-    #def test_not_exists_rev(self):
-    #    url = self.root.__class__(self.rooturl, rev=500)
-    #    assert url.check(exists=0)
-
-    #def test_nonexisting_listdir_rev(self):
-    #    url = self.root.__class__(self.rooturl, rev=500)
-    #    raises(error.FileNotFound, url.listdir)
-
-    #def test_newrev(self):
-    #    url = self.root.new(rev=None) 
-    #    assert url.rev == None
-    #    assert url.strpath == self.root.strpath
-    #    url = self.root.new(rev=10)
-    #    assert url.rev == 10
-
-    #def test_info_rev(self):
-    #    url = self.root.__class__(self.rooturl, rev=1155)
-    #    url = url.join("samplefile")
-    #    res = url.info()
-    #    assert res.size > len("samplefile") and res.created_rev == 1155
-
-    # the following tests are easier if we have a path class 
-    def test_repocache_simple(self):
-        repocache = cache.RepoCache()
-        repocache.put(self.root.strpath, 42) 
-        url, rev = repocache.get(self.root.join('test').strpath)
-        assert rev == 42 
-        assert url == self.root.strpath
-
-    def test_repocache_notimeout(self):
-        repocache = cache.RepoCache()
-        repocache.timeout = 0
-        repocache.put(self.root.strpath, self.root.rev)
-        url, rev = repocache.get(self.root.strpath)
-        assert rev == -1
-        assert url == self.root.strpath
-
-    def test_repocache_outdated(self):
-        repocache = cache.RepoCache()
-        repocache.put(self.root.strpath, 42, timestamp=0)
-        url, rev = repocache.get(self.root.join('test').strpath)
-        assert rev == -1
-        assert url == self.root.strpath
-
-    def _test_getreporev(self):
-        """ this test runs so slow it's usually disabled """
-        old = cache.repositories.repos 
-        try:
-            _repocache.clear()
-            root = self.root.new(rev=-1)
-            url, rev = cache.repocache.get(root.strpath)
-            assert rev>=0
-            assert url == svnrepourl
-        finally:
-            repositories.repos = old
-
-#cache.repositories.put(svnrepourl, 1200, 0)

Modified: py/dist/py/path/test/test_api.py
==============================================================================
--- py/dist/py/path/test/test_api.py	(original)
+++ py/dist/py/path/test/test_api.py	Fri Oct 15 13:29:06 2004
@@ -1,5 +1,5 @@
 from py import path, test
-from py.__impl__.path.svnwc.test_command import getrepowc 
+from py.__impl__.path.svn.test_wccommand import getrepowc 
 
 class TestAPI:
     def __init__(self):

Modified: py/dist/py/pytest.conf
==============================================================================
--- py/dist/py/pytest.conf	(original)
+++ py/dist/py/pytest.conf	Fri Oct 15 13:29:06 2004
@@ -1,5 +1,5 @@
 # standard options (modified from cmdline) 
-pythonexecutable = 'python2.2'
+#pythonexecutable = 'python2.2'
 
 verbose = 0 
 nocapture = False 

Modified: py/dist/py/test/cmdline.py
==============================================================================
--- py/dist/py/test/cmdline.py	(original)
+++ py/dist/py/test/cmdline.py	Fri Oct 15 13:29:06 2004
@@ -57,7 +57,7 @@
     for fn in filenames:
         fullfn = current.join(fn, abs=1)
         if fullfn.check(file=1):
-            yield test.collect.Execfile(fullfn)
+            yield test.collect.Module(fullfn)
         elif fullfn.check(dir=1):
             yield test.collect.Directory(fullfn)
         else:



More information about the pytest-commit mailing list