• 
      

    Always run svn log --xml non-interactively

    Review Request #7205 — Created April 14, 2015 and submitted

    Information

    RBTools
    release-0.7.x
    dd20b9d...

    Reviewers

    We cannot run svn log --xml interactively because the authentication
    prompts are intermixed with the svn log output. This results in
    exceptions when attempting to parse the XML and leads to cryptic error
    messages.

    This patch replaces all svn log --xml usage with non-interactive usage
    and checks for a specific error code to determine if there was an
    authentication error. Authentication errors are written to the console
    with directions on how to rectify them using the SVN authenticaiton
    command line options.

    Ran unit tests.

    Ran rbt diff in an SVN repository with specific revisions with a
    remote repository over HTTP with authentication. RBTools exited with
    an error that prompted me to enter my SVN credentials on the
    command-line.

    Description From Last Updated

    We cannot run svn log interactively...

    gmyersgmyers

    Should this also mention the forthcoming --svn-prompt-password option as an alternative to --svn-password?

    gmyersgmyers
    reviewbot
    1. Tool: PEP8 Style Checker
      Processed Files:
          rbtools/clients/svn.py
          rbtools/clients/errors.py
      
      
      
      Tool: Pyflakes
      Processed Files:
          rbtools/clients/svn.py
          rbtools/clients/errors.py
      
      
    2. 
        
    gmyers
    1. Would there be any value in running all svn commands with the --non-interactive option? I think the --svn-password and --svn-prompt-password options provided by rbt eliminate any real need to run in an interactive fashion, and as svn log --xml has shown running in interactive mode can lead to problems.

      Along these lines, if this change was made then you might want to evaluate all svn commands for the E215004 error, which could possibly be more trouble than it is worth. As it stands now, I think the call to svn log --xml will always be called first in any scenario where svn needs to access the remote server, and thus authentication issues always get checked and the user informed. But, in the future if there was a new svn command requiring remote access added prior to the svn log --xml call then there could be authentication errors that are not explicitly obvious.

      1. The issue with running all svn commands this way is that this requires separating the error stream from the output stream. In all other cases, the output and error streams are returned interwoven so that it looks natural when printed. Lots machinery depends on this behaviour. I think we should limit the --non-interactive option to commands that can hit the network.

    2. rbtools/clients/svn.py (Diff revision 1)
       
       
      Show all issues

      We cannot run svn log interactively...

    3. rbtools/clients/svn.py (Diff revision 1)
       
       
       
       
      Show all issues
      Should this also mention the forthcoming --svn-prompt-password option as an alternative to --svn-password?
      1. This was written ebfore the --svn-prompt-password option. I'll update this.

    4. 
        
    brennie
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          rbtools/clients/svn.py
          rbtools/clients/errors.py
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          rbtools/clients/svn.py
          rbtools/clients/errors.py
      
      
    2. 
        
    gmyers
    1. Ship It!
    2. 
        
    brennie
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-0.7.x (e7df277)