views:

188

answers:

3

How do you get svndumpfilter2 or svndumpfilter3 working in Windows?

type dump_file | svndumpfilter2 exclude xyz > filtered_dump_file

has no idea what svndumpfilter2 is regardless of where I put the script file.

Note: Python is installed and I did add .py extension to the file => svndumpfilter2.py

A: 

Do you have Python installed? If so, you should be able to get it to work by renaming the script to svndumpfilter2.py (or svndumpfilter3.py). Windows doesn't understand the shabang line at the top of the script

#!/usr/bin/env python
def foo(): 
SamB
Python is installed and I have added .py to files.
dr
A: 

Python on windows doesn't support pipes when called automatically. You have to run python.exe on the .py file explicitly. e.g.:

type input.dump | C:\Python26\python.exe C:\Path\to\svndumpfilter3.py exclude xyz > output.dump
Chris Simon
A: 

I wrote a command like this:

C:\dump>type svn.dump | c:\python27\python.exe svndumpfilter4.py include repo/project1 > svn_test.dump

and it gave me an error:

Traceback (most recent call last): File "svndumpfilter4.py", line 406, in lump = read_lump(fr) File "svndumpfilter4.py", line 239, in read_lump lump = read_rfc822_headers(f) File "svndumpfilter4.py", line 231, in read_rfc822_headers assert colon > 0 AssertionError

What did I do wrong?

Marek