You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Pavel Fedin <so...@rambler.ru> on 2006/12/18 12:38:36 UTC

--native-eol for checkout and update commands

 Hello!

 This patch adds --native-eol argument support for checkout and update
commands.
 I've written it because i have to work with a reposity hosting
cross-platform project. I work on the project at home using Linux OS
and synchronise my tree with the repository under Windows at work (i
don't have Internet access at home). The repository has svn:eol-style=native
for text files and it creates problems for me when i bring the code
tree from work to home on a USB flash and try to compile it.
 Probably this should be also added for some other commands like
switch, i just don't use them so i've left it out for now. Anyway now
this should be extremely easy to add.

-- 
Best regards,
 Pavel                          mailto:sonic_amiga@rambler.ru

Re[2]: --native-eol for checkout and update commands

Posted by Pavel Fedin <so...@rambler.ru>.
Hello Madan,

Monday, December 18, 2006, 4:18:34 PM, you wrote:

>     To be honest, I do not understand the need for the patch

 In fact i've described the need. Okay, may be it's unclear, so:
 1) I work on some project at home under Linux. I don't have Internet
 connection there.
 2) I have Internet connection at work where i of course use Windows.
 3) The project's repository has svn:eol-style=native property set for
 text files.
 4) I checkout the project's tree at work and take it home. When i try
 to compile the tree all scripts fail because of 0x0D characters which
 are treated as usual printable characters.

> 1. Tabs should NOT be used

 Already fixed, here is the modified patch.
 Achieving this was easy (the most difficult was to understand the
internal structure and data flavour). Some functions were modified to have one
more const char *native_eol parameter. This specifier is passed down
into update editor via svn_wc_get_update_editor3() and stored in its edit_baton.
At the end of operation the editor passes it on into log runner via
svn_wc__run_log2() which stores it in struct log_runner. The log
runner uses modified function svn_wc_translated_file3() then which
takes the specifier and actually processes it then.

> 2. Changes to API function headers should be accompanied with  
> corresponding comments.

 There are following public functions added (they are in fact modified
"original" functions):

 New                         Original
 svn_client_checkout3()      svn_client_checkout2()
 svn_client_update3()        svn_client_update2()
 svn_wc_get_update_editor3() svn_wc_get_update_editor3()
 svn_wc_translated_file3()   svn_wc_translated_file2()
 svn_wc__run_log2()          svn_wc__run_log()
 svn_wc__get_eol_style2()    svn_wc__get_eol_style()

 They differ from original functions in one parameter added -
const char *native_eol. If this parameter is NULL it is ignored and
the function behaves like original. If it points to a EOL type specifier
it overrides svn:eol-style property value and linefeeds in all text files are converted to it.
 This value comes from --eol-style argument which is enabled for
checkout and update commands.
 Of course all original functions are left unchanged because i think
all of them are public.

> 3. We need a log if we get to check the patch in.

 How detailed one? Will "Added --native-eol support for checkout and
update" be enough?

 I am sorry but i don't have much time to work on this further. I do
it at work and it takes my time. I hope what i've described here is
enough.

-- 
Best regards,
 Pavel                            mailto:sonic_amiga@rambler.ru

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re[2]: --native-eol for checkout and update commands

Posted by Pavel Fedin <so...@rambler.ru>.
Hello Madan,

Monday, December 18, 2006, 4:18:34 PM, you wrote:

>     To be honest, I do not understand the need for the patch

 In fact i've described the need. Okay, may be it's unclear, so:
 1) I work on some project at home under Linux. I don't have Internet
 connection there.
 2) I have Internet connection at work where i of course use Windows.
 3) The project's repository has svn:eol-style=native property set for
 text files.
 4) I checkout the project's tree at work and take it home. When i try
 to compile the tree all scripts fail because of 0x0D characters which
 are treated as usual printable characters.

> 1. Tabs should NOT be used

 Already fixed, here is the modified patch.
 Achieving this was easy (the most difficult was to understand the
internal structure and data flavour). Some functions were modified to have one
more const char *native_eol parameter. This specifier is passed down
into update editor via svn_wc_get_update_editor3() and stored in its edit_baton.
At the end of operation the editor passes it on into log runner via
svn_wc__run_log2() which stores it in struct log_runner. The log
runner uses modified function svn_wc_translated_file3() then which
takes the specifier and actually processes it then.

> 2. Changes to API function headers should be accompanied with  
> corresponding comments.

 There are following public functions added (they are in fact modified
"original" functions):

 New                         Original
 svn_client_checkout3()      svn_client_checkout2()
 svn_client_update3()        svn_client_update2()
 svn_wc_get_update_editor3() svn_wc_get_update_editor3()
 svn_wc_translated_file3()   svn_wc_translated_file2()
 svn_wc__run_log2()          svn_wc__run_log()
 svn_wc__get_eol_style2()    svn_wc__get_eol_style()

 They differ from original functions in one parameter added -
const char *native_eol. If this parameter is NULL it is ignored and
the function behaves like original. If it points to a EOL type specifier
it overrides svn:eol-style property value and linefeeds in all text files are converted to it.
 This value comes from --eol-style argument which is enabled for
checkout and update commands.
 Of course all original functions are left unchanged because i think
all of them are public.

> 3. We need a log if we get to check the patch in.

 How detailed one? Will "Added --native-eol support for checkout and
update" be enough?

 I am sorry but i don't have much time to work on this further. I do
it at work and it takes my time. I hope what i've described here is
enough.

P.S. Ah sorry, forgot to attach the file. ;-)

-- 
Best regards,
 Pavel                            mailto:sonic_amiga@rambler.ru

Re: --native-eol for checkout and update commands

Posted by Madan U Sreenivasan <ma...@collab.net>.
On Mon, 18 Dec 2006 18:08:36 +0530, Pavel Fedin <so...@rambler.ru>  
wrote:

>  Hello!
>
>  This patch adds --native-eol argument support for checkout and update
> commands.
>  I've written it because i have to work with a reposity hosting
> cross-platform project. I work on the project at home using Linux OS
> and synchronise my tree with the repository under Windows at work (i
> don't have Internet access at home). The repository has  
> svn:eol-style=native
> for text files and it creates problems for me when i bring the code
> tree from work to home on a USB flash and try to compile it.
>  Probably this should be also added for some other commands like
> switch, i just don't use them so i've left it out for now. Anyway now
> this should be extremely easy to add.


Hi Pavel,

    Thank you for the patch.

    To be honest, I do not understand the need for the patch nor understand  
how you have acheived it. But the following things came to the top of my  
mind on the first glance... so, for your perusal until I figure out the  
rest about your patch...

1. Tabs should NOT be used
2. Changes to API function headers should be accompanied with  
corresponding comments.
3. We need a log if we get to check the patch in.

     How do you know all the gotchas in one go? Please read  
http://subversion.tigris.org/hacking.html

     Meanwhile, am on the patch.

Regards,
Madan.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org