Yasuhito Futatsuki

* tools/dev/wc-format.py (get_format):

Avoid comparison between str and int, which is not allowed on Python 3.

* STATUS: Nominate r1878413.
autogen.sh: Remove per SWIG bindings checked files on release mode.

The .swig_pl_checked, .swig_py_checked, .swig_rb_checked files are

created by 'make -f autogen-standalone.mk autogen-swig' if this script

run on release mode, however they should not exist before users run

the configure script.

* autogen.sh

Remove .swig_pl_checked, .swig_py_checked, and .swig_rb_checked files

after generating SWIG language bindings source files when the script

runs on release mode.

configure: Add new option to specify path to swig bindings targets

Before this commit, it was not possible to use distinct Python

installations for the build system and test suite on the one hand,

and for building language bindings against on the other hand.

So we introduce new variable "SWIG_PY_PYTHON" for a target of

the SWIG Python bindings and a configure option to specify it.

Also, for the symmetry we introduce "SWIG_PL_PERL" and

"SWIG_RB_RUBY" for the Perl and Ruby SWIG bindings, and options

to specify them.

* configure.ac ():

- Use variables "SWIG_PL_PERL", "SWIG_PY_PYTHON", "SWIG_RB_RUBY" for

targets of the SWIG Perl, Python, Ruby bindings instead of "PERL",

"PYTHON", "RUBY".

- Introduce --with-swig-perl, --with-swig-python, --with-swig-ruby

options for setting variables "SWIG_PL_PERL", "SWIG_PY_PYTHON",

"SWIG_RB_RUBY".

* Makefile.in, build/ac-macros/swig.m4 ():

Use variables "SWIG_PL_PERL", "SWIG_PY_PYTHON", "SWIG_RB_RUBY" for

targets of the SWIG Perl, Python, Ruby bindings instead of "PERL",

"PYTHON", "RUBY".

* subversion/bindings/swig/INSTALL

(BUILDING SWIG BINDINGS FOR SVN ON UNIX step 2):

- Describe how to specify the path to the target language interpreters

with the new options, instead of using environment variables.

- Fix the name of glue libraries.

Review by: danielsh

* STATUS: Nominate r1876662.
* STATUS: Nominate r1876707, r1876734, r1877318, r1877712, r1878141, r1878142, r1878143, r1878144.
* subversion/tests/cmdline/svndumpfilter_tests.py (filter_and_return_output)

Use list complehension instead of map function, which returns iterator

on Python 3, to get EOL translated list of lines on Windows.

Reported by: jcorvel

Tested by: jcorvel

* subversion/tests/cmdline/svntest/main.py (wait_on_pipe):

Accept any sequence of bytes even if it is not valid UTF-8 character

sequence.

Reported by: jcorvel

Tested by: jcorvel

Fix eol style treatment in command tests on Windows.

[in subversion/tests/cmdline]

* merge_tests.py (merge_conflict_markers_matching_eol,

merge_eolstyle_handling),

* patch_tests.py (patch_no_svn_eol_style,

patch_with_svn_eol_style,

patch_with_svn_eol_style_uncommitted),

* update_tests.py (conflict_markers_matching_eol,

update_eol_style_handling):

Specify keep_eol_style = True evne if platform is Windows.

* merge_tests.py (merge_conflict_markers_matching_eol),

* patch_tests.py (patch_no_svn_eol_style,

patch_with_svn_eol_style,

patch_with_svn_eol_style_uncommitted),

* update_tests.py (conflict_markers_matching_eol):

Use binary mode to write file contents for strict eol style.

* merge_tests.py (merge_conflict_markers_matching_eol),

* patch_tests.py (patch_with_svn_eol_style,

patch_with_svn_eol_style_uncommitted),

* conflict_markers_matching_eol):

Switch per platform eol value for 'native' svn:eol-style

* svntest/wc.py (State.from_wc):

Use io.open() explicitly to specify 'newline' parameter for universal

newline, even on Python 2. With this change, '\r' end of line chracters in

files are also translated to '\n' if keep_eol_style=False (or unspicified)

on Python 2. Also explicitly specify encoding to 'utf-8' not to be affected

by Python's file system encoding.

Reported by: jcorvel

Tested by: jcorvel

Follow-up to r187712: entries-dump: Use escape string-typed value for two

more char * type values.

* subversion/tests/cmdline/entries-dump.c

(print_prefix): Add new Python function _to_str and then use it in

Entry.set_strval.

(print_as_bytes): New function.

(str_value):

- Quote human-readable value when print it.

- Use print_as_bytes to print the value of "value"

(entries_dump):

- Use iterpool in the loop to print each entry.

- Use an escaped string for the key value of the "entries" dict object.

(tree_dump_dir): Use an escaped string for the key value of the "dirs"

dict object.

Reported by: jcorvel

Tested by: jcorvel

* STATUS: Nominate r1877960.
* INSTALL (I.C.12): Add Note that non-release mode is required for building

SWIG Python 2 bindings.

* subversion/bindings/swig/INSTALL

(BUILDING SWIG BINDINGS FOR SVN ON UNIX, Step 2): Add description how to

confirm that the ./configure could find SWIG path correctly.

Review by: danielsh

Use safe bytes literals when set string values in working copy entries.

* subversion/tests/cmdline/entries-dump.c

(print_prefix): New function.

(str_value):

- Add argument to specify pool.

- Print human readable value of "value" as is in comment, then set it

as str value by using hex escaped bytes literal.

(entries_dump): Add pool argument to str_value() calls.

(main):

- Print "Entry" class definition as prefix before entry_dump() or tree_dump()

- Style fix on if statement (using blocks).

(): Add include files for assert() and svn_xml_escape_attr_cstring()

* subversion/tests/cmdline/svntest/main.py

(run_entiresdump, run_entriesdump_tree): Move definition of "Entry" class

into generated code by entries-dump execution.

Review By: danielsh

* build/generator/gen_win_dependencies.py (GenDependenciesBase._find_python):

Fix differences of SWIG_PY_OPTS between Unix and Windows.

(Just same logic as function SVN_FIND_SWIG in build/ac-macros/swig.m4)

Patch by: Jun Omae <jun66j5{_AT_}gmail.com>

Fix svnrdump tests on Windows with Python 3

* subversion/tests/cmdline/svntest/actions.py (run_and_verify_svnrdump):

Use list complehension instead of map function, which returns iterator

on Python 3, to get EOL translated list of lines on Windows.

Reported by: jcorvel

Tested by: jcorvel

Follow-up to 1877300: Fix incorrect exception name.

* subversion/tests/cmdline/svndumpfilter_tests.py (match_empty_prefix)

* subversion/tests/cmdline/svndumpfilter_tests.py (match_empty_prefix):

Fix qualified name of exception

Make gen-make.py --debug work with Python 3

* gen-make.py (main): Specify key to sort dependency targets.

Reported by: jcorvel

Tested by: jcorvel

Reviewed by: jcorvel

danielsh

* subversion/tests/cmdline/blame_tests.py (blame_youngest_to_oldest):

Use svntest.main.file_write to avoid end of line conversion.

Reported by: jcorvel

Tested by: jcorvel

Escape special characters in path when construct expected output regex.

* subversion/tests/cmdline/svntest/actions.py (_run_and_verify_resolve)

Reported by: jcorvel

Tested by: jcorvel

Avoid check for SWIG version for Python bindings when --witout-swig is passed.

* build/ac-macros/swig.m4 (SVN_FIND_SWIG):

Found by: brane

Review by: cmpilato

jamessan

* STATUS: Nominate r1876016, r1876050.
Follow-up to r1876016: Refine INSTALL doc for SWIG bindings

The changes are mainly:

- Use passive voice

- Rearrange information to put the common case first and rarer cases

nearer the end

* subversion/bindings/swig/INSTALL

(STATUS OF THE SWIG BINDINGS,

BUILDING SWIG BINDINGS FOR SVN ON UNIX Step 1,

BUILDING SWIG BINDINGS FOR SVN ON UNIX Step 3): Refine expressions.

Patch by: danielsh

Explain SWIG is needed for building Python 2 bindings.

Since Subversion distibution 1.14.0 and later will ship with SWIG Python

bindings *.c source code for Python 3, clarify *.c source files for Python 2

and Python 3 are different and incompatible, and describe how to clear

incompatible intermediate files.

* subversion/bindings/swig/INSTALL

(STATUS OF THE SWIG BINDINGS):

Add explanation about supported Python version and distribution tarball.

(BUILDING SWIG BINDINGS FOR SVN ON UNIX Step 1):

Add new case that SWIG is needed for Python 2 bindings.

(BUILDING SWIG BINDINGS FOR SVN ON UNIX Step 2):

Update Python and perl version in commadline example.

(BUILDING SWIG BINDINGS FOR SVN ON UNIX Step 3):

Insert optional step to clear intermediate files previously generated.

(everywhere) Strip trailing white space in the end of line.

Fix handling for non-ascii characters on internal path and stderr

* tools/hook-scripts/validate-files.py

(docstring): Add note to handle non-ascii path and/or stderr output.

(Commands.svnlook_changed):

+ Decode changed paths as 'utf-8' explicitly on Python 3 and leave them as

('utf-8' encoded) bytes in Python 2.7

+ Decode stderr out message from svnlook as sys.stderr.encoding

(Commands.user_command): Decode stderr out message from user commands as

sys.stderr.encoding

Use configparser.ConfigParser instead of configparser.SafeConfigParser in py3

On Python 3.2, configparser.Configparser implementation is replaced by one it

was configparser.SafeConfigParser before 3.2, and SafeConfigParser class is

only an alias for compatibility on Python >= 3.2. So we use

ConfigParser.SafeConfigParser in Python 2.7 and configparser.ConfigParser in

Python 3 for the base class of our Config class.

* tools/hook-scripts/validate-files.py

(ConfigParser): New valiable to absorb difference of package and class name

(class Config): Use ConfigParser as base class

Follow up to 1872398: Use 0 for default smtp_port instead of smtplib.SMTP_PORT

* tools/hook-scripts/mailer/mailer.py (SMTPOutput.finish):

Use 0 instead of smtplib.SMTP_PORT if general.smtp_port is unspecified.

* tools/hook-scripts/mailer/mailer.conf.example ([general]):

Add comment for smtp_port, it is use 465 for SMTP-over-SSL to connect.

Found by: danielsh

Add new option smtp_port to specifiy the port to connect

* tools/hook-scripts/mailer/mailer.py (SMTPOutput.finish):

Specify the port number to connect for SMTP/SMTP_SSL explicitly, by new option

general.smtp_port.

* tools/hook-scripts/mailer/mailer.conf.example ([genral]):

New option 'smtp_port'

Use importlib package on Python >= 3.5, instead of imp package

* build/run_tets.py

(): Import importlib.util if Python >= 3.5, else import imp as it is

(TestHarness._run_py_test): Use recipe to import a source module from

absolute path [1] for Python >= 3.5

[1] https://docs.python.org/3/library/importlib.html#importing-a-source-file-directly

Review by: danielsh

hartmannathan

Fix implementation of svn_client_status_func_t function for swig-py

* subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h

(svn_swig_py_client_status_func): Fix type from void to svn_error_t *.

* subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c

(svn_swig_py_client_status_func): Fix type from void to svn_error_t *.

- Remove the code to save/restore Python Error context.

- Remove the code to clear C API error status

- Return error status as it is

Reported by: stsp