• 
      

    Change _handle_empty_files() to call _run_svn() rather than execute.

    Review Request #6875 — Created Feb. 1, 2015 and submitted — Latest diff uploaded

    Information

    RBTools
    master
    5634172...

    Reviewers

    In svn.py, _handle_empty_files() directly calls execute(diff_cmd,...) to invoke the 'svn diff' command. However this does not operate as expected because the diff_cmd list does not contain 'svn' as the first entry. This leads to an error message when running 'rbt diff':

    $ rbt diff -d
    >>> RBTools 0.7.1 alpha 0 (dev)
    >>> Python 2.7.5 (default, Jun 17 2014, 18:11:42)
    [GCC 4.8.2 20140120 (Red Hat 4.8.2-16)]
    >>> Running on Linux-3.10.0-123.13.2.el7.x86_64-x86_64-with-centos-7.0.1406-Core
    >>> Home = /home/gmyers
    >>> Current directory = /home/gmyers/wc3
    >>> Checking for a Subversion repository...
    >>> Running: svn info --non-interactive
    >>> Running: diff --version
    >>> repository info: Path: file:///home/gmyers/svn_repo/myrepo, Base path: /,
    Supports changesets: False
    >>> Making HTTP GET request to http://localhost:8080/api/
    >>> Cached response for HTTP GET http://localhost:8080/api/ expired and was
    modified
    >>> Running: svn info --non-interactive
    >>> Running: diff --version
    >>> repository info: Path: file:///home/gmyers/svn_repo/myrepo, Base path: /,
    Supports changesets: False
    >>> Running: svn status --ignore-externals
    >>> Running: svn info .
    >>> Running: svn diff --diff-cmd=diff --notice-ancestry -r BASE
    >>> Running: svn info trunk/a.txt
    >>> Running: svn info trunk
    >>> Running: diff --diff-cmd=diff --notice-ancestry -r BASE --no-diff-deleted
    >>> Command exited with rc 2: ['diff', '--diff-cmd=diff', '--notice-ancestry',
    '-r', 'BASE', '--no-diff-deleted']

    diff: unrecognized option '--diff-cmd=diff'
    diff: Try 'diff --help' for more information.
    <snip>

    Fix is to switch from calling execute() to calling self._run_svn() following the recipe in a2890ae. It appears that this single instance of execute() was overlooked between a2890ae and bfec7b3. _run_svn() will prepend 'svn' to command line resulting in the intended 'svn diff' actually being executed.

    Executed 'rbt diff -d' after change and error message ralted to calling diff with an unknown option goes away.