parameters: (directory, svn_url_regex)
return_statement: return None, None
docstring: Fetch the Subversion URL and revision through Git.
  
    Errors are swallowed.
  
    Returns:
      A tuple containing the Subversion URL and revision.
docstring_summary: Fetch the Subversion URL and revision through Git.
docstring_tokens: Fetch the Subversion URL and revision through Git .
function: def FetchGitSVNURLAndRevision(directory, svn_url_regex):
    """
    Fetch the Subversion URL and revision through Git.
  
    Errors are swallowed.
  
    Returns:
      A tuple containing the Subversion URL and revision.
    """
    proc = RunGitCommand(directory, ['log', '-1',
                                     '--grep=git-svn-id', '--format=%b'])
    if proc:
      output = proc.communicate()[0].strip()
      if proc.returncode == 0 and output:
        # Extract the latest SVN revision and the SVN URL.
        # The target line is the last "git-svn-id: ..." line like this:
        # git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85528 0039d316....
        match = _GIT_SVN_ID_REGEX.search(output)
        if match:
          revision = match.group(2)
          url_match = svn_url_regex.search(match.group(1))
          if url_match:
            url = url_match.group(2)
          else:
            url = ''
          return url, revision
    return None, None
function_tokens: def FetchGitSVNURLAndRevision ( directory , svn_url_regex ) : proc = RunGitCommand ( directory , [ 'log' , '-1' , '--grep=git-svn-id' , '--format=%b' ] ) if proc : output = proc . communicate ( ) [ 0 ] . strip ( ) if proc . returncode == 0 and output : # Extract the latest SVN revision and the SVN URL. # The target line is the last "git-svn-id: ..." line like this: # git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85528 0039d316.... match = _GIT_SVN_ID_REGEX . search ( output ) if match : revision = match . group ( 2 ) url_match = svn_url_regex . search ( match . group ( 1 ) ) if url_match : url = url_match . group ( 2 ) else : url = '' return url , revision return None , None