~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/svn.py

  • Committer: William Grant
  • Date: 2009-05-26 02:10:08 UTC
  • Revision ID: grantw@unimelb.edu.au-20090526021008-hnka598yacu5w6da
Always set isdir = False in the file browser template filling.

Previously we used os.path.isdir outside the jail, which was terribly
unreliable and prone to crashing. We should do it properly once we can get
server-side access to the jails.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
    except pysvn.ClientError:
49
49
        return False
50
50
 
 
51
def revision_is_dir(client, path, revision):
 
52
    """Returns True if the given path+revision is a directory.
 
53
    @raises a pysvn.ClientError if it does not exist.
 
54
    """
 
55
    # XXX I *think* the first element of the list is the requested object, and
 
56
    # subsequent items are its possible children (so ignore them).
 
57
    list_object, _ = client.list(path, revision=revision)[0]
 
58
    # list_object is a PySvnList object
 
59
    return list_object.kind == pysvn.node_kind.dir
 
60
 
51
61
class PysvnListStatWrapper:
52
62
    '''Wrap a pysvn listing object to look somewhat like a result of
53
63
       os.stat.