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

« back to all changes in this revision

Viewing changes to ivle/fileservice_lib/action.py

Return the file's revision from svnrepostat.

Show diffs side-by-side

added added

removed removed

Lines of Context:
738
738
def action_svnrepostat(req, fields):
739
739
    """Discovers whether a path exists in a repo under the IVLE SVN root.
740
740
 
 
741
    If it does exist, returns a dict containing its metadata.
 
742
 
741
743
    Reads fields: 'path'
742
744
    """
743
745
    path = fields.getfirst('path')
744
746
    url = ivle.conf.svn_addr + "/" + path
745
 
    svnclient.exception_style = 1 
 
747
    svnclient.exception_style = 1
746
748
 
747
749
    try:
748
750
        svnclient.callback_get_login = get_login
749
 
        svnclient.info2(url)
 
751
        info = svnclient.info2(url,
 
752
            revision=pysvn.Revision(pysvn.opt_revision_kind.head))[0][1]
 
753
        return {'svnrevision': info['rev'].number
 
754
                  if info['rev'] and
 
755
                     info['rev'].kind == pysvn.opt_revision_kind.number
 
756
                  else None}
750
757
    except pysvn.ClientError, e:
751
758
        # Error code 170000 means ENOENT in this revision.
752
759
        if e[1][0][1] == 170000: