parameters: (local_filename)
return_statement: return [root, path, rev]
docstring: Calls svn info to extract the repository, path, and revision.
docstring_summary: Calls svn info to extract the repository, path, and revision.
docstring_tokens: Calls svn info to extract the repository path and revision .
function: def ExtractSvnInfo(local_filename):
    """Calls svn info to extract the repository, path, and revision."""
    # We call svn.bat to make sure and get the depot tools SVN and not cygwin.
    srctool = subprocess.Popen(['svn.bat', 'info', local_filename],
                               stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    info = srctool.stdout.read()
    res = srctool.wait()
    if res != 0:
      return None
    # Hack up into a dictionary of the fields printed by svn info.
    vals = dict((y.split(': ', 2) for y in info.split('\r\n') if y))
  
    root = vals['Repository Root']
    if not vals['URL'].startswith(root):
      raise "URL is not inside of the repository root?!?"
    path = vals['URL'][len(root):]
    rev  = int(vals['Revision'])
  
    return [root, path, rev]
function_tokens: def ExtractSvnInfo ( local_filename ) : # We call svn.bat to make sure and get the depot tools SVN and not cygwin. srctool = subprocess . Popen ( [ 'svn.bat' , 'info' , local_filename ] , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) info = srctool . stdout . read ( ) res = srctool . wait ( ) if res != 0 : return None # Hack up into a dictionary of the fields printed by svn info. vals = dict ( ( y . split ( ': ' , 2 ) for y in info . split ( '\r\n' ) if y ) ) root = vals [ 'Repository Root' ] if not vals [ 'URL' ] . startswith ( root ) : raise "URL is not inside of the repository root?!?" path = vals [ 'URL' ] [ len ( root ) : ] rev = int ( vals [ 'Revision' ] ) return [ root , path , rev ]