[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r20191 - trunk/subversion/tests/cmdline

From: Blair Zajac <blair_at_orcaware.com>
Date: 2006-06-21 18:33:31 CEST

Kamesh Jayachandran wrote:
> lgo@tigris.org wrote:
>> Author: lgo
>> Date: Tue Jun 20 11:06:49 2006
>> New Revision: 20191
>>
>> Modified:
>> trunk/subversion/tests/cmdline/import_tests.py
>>
>> Log:
>> * Followup to r17321 : Add a new test to validate the import handles
>> the eol style correctly, reported as issue 2433.
>> Followup to r20179: make sure the import test also works on
>> non-Windows platforms.
>>
>> * subversion/tests/cmdline/import_tests.py
>> (import_eol_style): add definition of CRLF for all platforms and
>> use it to validate the diff output.
>>
>> Modified: trunk/subversion/tests/cmdline/import_tests.py
>> URL:
>> http://svn.collab.net/viewvc/svn/trunk/subversion/tests/cmdline/import_tests.py?pathrev=20191&r1=20190&r2=20191
>>
>> ==============================================================================
>>
>> --- trunk/subversion/tests/cmdline/import_tests.py (original)
>> +++ trunk/subversion/tests/cmdline/import_tests.py Tue Jun 20
>> 11:06:49 2006
>> @@ -337,14 +337,21 @@
>> # -This is file test.dsp.
>> # +This is file test.dsp.
>> # +Extra line
>> + + # eol styl of test.dsp is CRLF, so diff will use that too. Make
>> sure we + # define CRLF in a platform independent way.
>> + if os.name == 'nt':
>> + crlf = '\n'
>> + else:
>> + crlf = '\r\n'
>>
> Should it not be(Or my eyes are wrong!!), windows line endings are
> '\r\n' and unix(posix) ones are '\n' .
>
> + if os.name == 'nt':
> + crlf = '\r\n'
> + else:
> + crlf = '\n'
>
> In anycase why not use os.linesep?

Another question is why os.name instead of sys.platform?

It appears that we use both throughout the code

svn-trunk$ find -name .svn -prune -o -type f | xargs grep 'os\.name' | wc
      24 126 2201
svn-trunk$ find -name .svn -prune -o -type f | xargs grep 'sys\.platform' | wc
      15 81 1200

Not being an expert, is there any preference to os.name or sys.platform.

With cygwin's Python, what are the two values? I don't have a Windows box to
test here.

Regards,
Blair

-- 
Blair Zajac, Ph.D.
<blair@orcaware.com>
Subversion training, consulting and support
http://www.orcaware.com/svn/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Jun 21 18:34:20 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.