Hi gang,
from svn import diff
diff.svn_diff_hunk_readline_diff_text(1,2,3)
On older subversion installs this used to work. Well, not the 1,2,3
part, but it now barfs with:
Traceback (most recent call last):
File "foo.py", line 1, in <module>
from svn import diff
ImportError: cannot import name 'diff' from 'svn'
(/usr/local/lib/python3.7/site-packages/svn/__init__.py)
(homebrew installed Python3 and homebrew installed Subversion 1.10.2
which does the python bindings silently)
Ben Rasser had previously written a "svn-diff to JSON" thing that
worked very well -
https://stackoverflow.com/questions/20381507/whats-the-best-way-to-turn-a-subversion-diff-into-json
- and now it doesn't, and I think it is because the C function and the
Swig gen'd Python for that has moved/renamed or has gone. I looked at
release notes an couldn't see a mention of that, though.
Advice?
Curiously, python2 still has the diff module inside 'svn' and barfs on
the parameters to the svn_diff_hunk_readline_diff_text function. I say
that but I am not sure if the homebrew install for Subversion does the
python setup for **all** of 1) homebrew's python2 which v2.7.15 today,
2) homebrew's python3 - v3.7, and 3) the mac's python v2.7.10. I mean
versus obey some other PATH or arg setting which directs homebrew to
focus on one or more of those.
Lastly, if someone knows how to edit
https://formulae.brew.sh/formula/subversion they should perhaps remove
the obsolete args like --with-python which is now default.
- Paul