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

Re: [PATCH] cvs2svn on windows (updated resend)

From: Russell Yanofsky <rey4_at_columbia.edu>
Date: 2003-07-27 01:48:53 CEST

Russell Yanofsky wrote:
> cmpilato@collab.net wrote:
>> "Russell Yanofsky" <rey4@columbia.edu> writes:
>>> (pass3): Changed to sort the file listing in memory instead of
>>> with the "sort" command on Windows. Original behavior is
>>> preserved on other platforms.
>>
>> I'm confused. Windows has a 'sort' program that supports path input
>> and redirected I/O. Why not use it? Does it behave differently than
>> it should?
>
> The windows sort program does seem to work some times, but it fails
> at other times.
> ...
> I don't remember what causes this, but I'll look into it.

Turns out the problem running the sort command was not in cvs2svn.py, but in
run-tests.py.

When you ran cvs2svn.py directly from the command line it would work, but if it
were run under run-tests.py, it wouldn't work. I experimented with the code in
run-tests.py that starts up cvs2svn, and found that changing the comand line
from

  cvs2svn.py [args]

to

  python cvs2svn.py [args]

made everything work. A new patch is attached that has this change and the
original sorting code.

<aside>
I couldn't figure out what the difference between the two invocations is, but I
did write a little script to reproduce the problem:

  import os, sys

  cmdline = "python %s arg" % sys.argv[0] # working command line
  #cmdline = "%s arg" % sys.argv[0] # broken command line

  if len(sys.argv) == 1:
    infile, outfile, errfile = os.popen3(cmdline, 't')
    print "".join(outfile.readlines())
  else:
    if os.system("echo WORKS"):
      print "BROKEN"
</aside>

Log Message:

Changes to cvs2svn.py and its regression testing script so they will
work on Windows.

* tools/cvs2svn/cvs2svn.py (relative_name): Changed this function to
  expect os.sep in the file path passed to it instead of forward
  slashes. Also added an assertion to detect incorrect usage.

  (escape_shell_arg): new function to escape shell arguments, works
  differently on unix and windows

  (Dumper.add_or_change_path): changed to check out files in binary
  mode, and to use the escape_shell_arg function

* tools/cvs2svn/run-tests.py (repos_to_url): Added missing slash
  detection. Needed because absolute paths on windows begin with
  a drive letter instead of a slash.

  (svn_strptime): new function to take the place of time.strptime,
  which doesn't exist on windows

  (Log.__init__): replaced time.strptime() call with svn_strptime()
  call.

  (run_cvs2svn): changed command line used to start cvs2svn on windows

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

Received on Sun Jul 27 01:47:27 2003

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.