nirvdrum / svn2git

Ruby tool for importing existing svn projects into git.
MIT License
2.11k stars 443 forks source link

Exclude causes error with non-standard layout #119

Open cdokolas opened 11 years ago

cdokolas commented 11 years ago

e.g. I have my trunk at "trunk/MyProjects" and branches at "branches/development" and I want to exclude a (branch copy) commit that contains a problematic path, detectable with the string "2783". Then I get the following right from the start:

C:\Users\me\s2g>svn2git http://reposvr/svnrepo -v -m --no-minimize-url --notags --branches branches/development --trunk trunk/MyProjects--authors authors.txt --notags --exclude 2783
Running command: git svn init --prefix=svn/ --no-minimize-url --trunk=trunk/MyProjects--branches=branches/development http://reposvr/svnrepo
Initialized empty Git repository in C:/Users/me/s2g/.git/
Running command: git config --local svn.authorsfile authors.txt
Running command: git svn fetch '--ignore-paths=^(?:trunk/MyProjects[/]|["branches/development"][/][^/]+[/])(?:2783)'
The system cannot find the path specified.
command failed:
2>&1 git svn fetch '--ignore-paths=^(?:trunk/MyProjects[/]|["branches/development"][/][^/]+[/])(?:2783)'

Using: Windows 8, svn2git 2.2.2 (with lbreuss change for multiple branches/tags, but it happens with the original code as well)

cdokolas commented 11 years ago

Looking at the code, I'm now under the impression that the code should read like this:

regex = '^(?:' + regex.join('|') + ')|(?:' + exclude.join('|') + ')'

(note the extra | in ')|(?:')

I'll test it ASAP!

Update: Doesn't work. Gives ' was unexpected at this time.