I know that everyone is incredibly busy preparing 1.7, but would
someone please review and commit this patch?  I don't want to see it
slip to 1.8.

Attached are the patch, the log message, and the two TGZ archives of
DUMP files (for the tests).  They are the same as before, except that
I diff'ed against revision 1082876 and included message IDs of
referenced threads in the log message.


On Mon, Feb 21, 2011 at 1:31 PM, Gavin Beau Baumanis
<gav...@thespidernet.com> wrote:
>
> Hi Everyone,
>
> I have logged this submission in the issue tracker.
>
> #3817 refers.
> http://subversion.tigris.org/issues/show_bug.cgi?id=3817
[[[
Add a command line option (--source-prop-encoding) to the svnsync init, sync,
and copy-revprops subcommands that allows the user to specify the character
encoding of translatable properties from the source repository. This is needed
to allow svnsync to sync some older Subversion repositories that have
properties that were not encoded in UTF-8.

As discussed at:
  http://thread.gmane.org/gmane.comp.version-control.subversion.user/100020
    Message-ID: loom.20100909t000542...@post.gmane.org
  http://thread.gmane.org/gmane.comp.version-control.subversion.devel/122518
    Message-ID: aanlktimyfxpkos9okcd3tv8tdjznhb6y0awbxnt+r...@mail.gmail.com
  http://thread.gmane.org/gmane.comp.version-control.subversion.devel/122550
    Message-ID: aanlktik11jljxnnqgbunzwenyjj5_yutut0wksbey...@mail.gmail.com
  http://thread.gmane.org/gmane.comp.version-control.subversion.devel/124731
    Message-ID: aanlktikjd3bwbigqwkjdeakub49-wjawszj8iyzae...@mail.gmail.com
  http://thread.gmane.org/gmane.comp.version-control.subversion.devel/125057
    Message-ID: aanlktin48eyejig4tyvptovelygr1rfxk-_tkjhwo...@mail.gmail.com
  http://thread.gmane.org/gmane.comp.version-control.subversion.devel/125783
    Message-ID: AANLkTimjj48xt4s=zOqC6GxoPPEdLpfSB9YmBY=7b...@mail.gmail.com

Most of the changes exist to pass the argument to --source-prop-encoding through
to the functions that need it (mainly normalize_string() in
subversion/svnsync/sync.c).

* subversion/svnsync/main.c
  (svnsync__opt) Add svnsync_opt_source_encoding.
  (svnsync_cmd_table): Add svnsync_opt_source_encoding to the list of
    acceptable options for the init, sync, and copy-revprops subcommands.
  (svnsync_options): Add a description of the --source-prop-encoding option.
  (opt_baton_t, subcommand_baton_t): Add the SOURCE_PROP_ENCODING field.
  (log_properties_normalized): Document the QUIET parameter.
  (copy_revprops): Add the SOURCE_PROP_ENCODING parameter. Pass it through to
    svnsync_normalize_revprops().
  (make_subcommand_baton): Set the SOURCE_PROP_ENCODING field of the resulting
    subcommand_baton_t object to the value of SOURCE_PROP_ENCODING from the
    opt_baton_t object.
  (do_initialize, do_synchronize, do_copy_revprops, replay_rev_started,
   replay_rev_finished): Pass SOURCE_PROP_ENCODING to svnsync_* functions and
    copy_revprops().
  (main): Handle the case when the command line option is
    --source-prop-encoding. Set the SOURCE_PROP_ENCODING field of the
    opt_baton_t object to either OPT_ARG or NULL.

* subversion/svnsync/sync.c
  (normalize_string): Add the SOURCE_PROP_ENCODING parameter. Always call
    svn_subst_translate_string2(). Switch to the "two pools" (result & scratch
    pools) pattern.
  (svnsync_normalize_revprops): Add the SOURCE_PROP_ENCODING parameter. Pass the
    value through to normalize_string().
  (edit_baton_t): Add the SOURCE_PROP_ENCODING field.
  (change_file_prop, change_dir_prop): Pass SOURCE_PROP_ENCODING from the edit
    baton to normalize_string().
  (svnsync_get_sync_editor): Add the SOURCE_PROP_ENCODING parameter.

* subversion/svnsync/sync.h
  (svnsync_normalize_revprops): Add the SOURCE_PROP_ENCODING parameter. Update
    the documentation of the function.
  (svnsync_get_sync_editor): Add the SOURCE_PROP_ENCODING parameter. Update the
    documentation of the function.

* subversion/tests/cmdline/svnrdump_tests.py
  (copy_bad_line_endings2_dump): New test case.
  (test_list): Add copy_bad_line_endings2_dump.

* subversion/tests/cmdline/svnsync_tests.py
  (run_sync): Add the SOURCE_PROP_ENCODING parameter. Build up the command line
    arguments to `svnsync synchronize`.
  (run_copy_revprops): Add the SOURCE_PROP_ENCODING parameter. Build up the
    command line arguments to `svnsync copy-revprops`.
  (run_init): Add the SOURCE_PROP_ENCODING parameter. Build up the command line
    arguments to `svnsync initialize`.
  (setup_and_sync): Add the SOURCE_PROP_ENCODING parameter. Pass the value
    through to run_init(), run_sync(), and run_copy_revprops().
  (run_test): Add the SOURCE_PROP_ENCODING parameter. Pass the value through to
    setup_and_sync().
  (copy_bad_line_endings2): New test case.
  (copy_bad_encoding): New test case.
  (identity_copy): New test case.
  (test_list): Add copy_bad_line_endings2, copy_bad_encoding, and identity_copy.

* subversion/tests/cmdline/svnrsync_tests_data/copy-bad-line-endings2.dump
  A dump of a repository with the following features:
  1. The log message (`svn:log` revision property) of revision 1 has CRLF line
     endings.
  2. The log message of revision 2 has CR line endings.
  3. Revision 3 introduces an `svn:ignore` node property with CRLF line endings.
  4. Revision 4 introduces a custom node property, `x:related-to`, with CRLF
     line endings.

* subversion/tests/cmdline/svnrsync_tests_data/
                                            copy-bad-line-endings2.expected.dump
  A dump of the expected result of using svnrdump to dump
  copy-bad-line-endings2.dump.

* subversion/tests/cmdline/svnsync_tests_data/copy-bad-encoding.dump
  A dump of a repository with the following feature: The log message and an
  `svn:ignore` node prop of revision 1 are encoded in ISO-8859-3.

* subversion/tests/cmdline/svnsync_tests_data/copy-bad-encoding.expected.dump
  A dump of the expected result of using svnsync to sync copy-bad-encoding.dump
  with `--source-prop-encoding ISO-8859-3`.

* subversion/tests/cmdline/svnsync_tests_data/copy-bad-line-endings2.dump
  Copy of ../svnrsync_tests_data/copy-bad-line-endings2.dump.

* subversion/tests/cmdline/svnsync_tests_data/
                                            copy-bad-line-endings2.expected.dump
  A dump of the expected result of using svnsync to sync
  copy-bad-line-endings2.dump.
]]]

Attachment: copy-bad-encoding_dumps.tar.gz
Description: GNU Zip compressed data

Attachment: copy-bad-line-endings2_dumps.tar.gz
Description: GNU Zip compressed data

Reply via email to