subversion-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philip Martin <phi...@codematters.co.uk>
Subject Re: Unable to shelve changes when using custom diff-cmd
Date Wed, 27 Jun 2018 11:33:59 GMT
Csongor Pal <cpal@feralinteractive.com> writes:

> I ran into an issue with svn shelve on my setup. I use the following
> script as my diff-cmd to open diffs with FileMerge on macOS:
> svn-diffwrap.sh
> <https://gist.github.com/dtjm/523243/6975de552166beb08943fe8a44f8b5ddbb29a875#file-svn-diffwrap-sh>
>
> When running an svn shelve command I get the diffs opened up in
> FileMerge and the command fails with: svn: E200009: No changes were
> shelved
>
> When I remove the diff-cmd setting from the config file svn shelve
> works as expected, but is there a way to have both features work at
> the same time?
>
> I'm using svn, version 1.10.0 (r1827917) on macOS 10.13.

The shelve feature in 1.10 relies on a valid diff being written to
standard output.  If the configured diff_cmd invokes a GUI and doesn't
write a diff to stdout then attempts to shelve will fail.

Trunk/1.11 doesn't have this problem because the shelve code no longer
relies on diff writing to stdout.  The long term fix for 1.10 might be
to change the Subversion code so that shelve always runs the internal
diff.

In the short term, a 1.10 user might be able to fix the problem by
making the configured diff_cmd detect when output to stdout is required.
In this case diff_cmd is a shell script so perhaps using test's -t to
determine whether stdout is a terminal would work:

if [ -t 1 ] ; then
   # original script to invoke custom diff
   ...
else
   # write standard diff to stdout
   diff "$1" "$2" "$3" "$4" "$5" "$6" "$7"
fi

That may not work if using some sort of GUI Subversion client which
always redirects stdout.  In that case a solution might be to make the
configured diff_cmd always write a diff to stdout in addition to
whatever else it does.

-- 
Philip

Mime
View raw message