Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't open file 'format': no such file or directory #133

Open
AnLupoTamTamy opened this issue Jul 20, 2021 · 6 comments
Open

Can't open file 'format': no such file or directory #133

AnLupoTamTamy opened this issue Jul 20, 2021 · 6 comments

Comments

@AnLupoTamTamy
Copy link

I have locally an svn repository with the following structure:
wiki

  • branches
    • feature
    • test
    • test-easy
  • trunk

In the folder svn2gitUtility I have the configuration files and the executable of svn-all-fast-export.

This is the command that I'm running:

./svn2gitUtility/svn2git/svn-all-fast-export --identity-map=./svn2gitUtility/conf/wiki.authors --rules=./svn2gitUtility/conf/wiki.rules --stats --add-metadata wiki

Sample of wiki.authors:
m.white = Mr White <mr.white@test.com>

Content of wiki.rules:

create repository gitWiki
end repository

match /trunk/
    repository gitWiki
    branch master
end match

match /branches/([^/]+)/
  repository gitWiki
  branch \1
end match

Output

When I run the previous command, I get the following error:

Invoked as:' ./svn2gitUtility/svn2git/svn-all-fast-export --identity-map=./svn2gitUtility/conf/wiki.authors --rules=./svn2gitUtility/conf/wiki.rules wiki'
Loading rules from: "./svn2gitUtility/conf/wiki.rules"
Loading rules from "./svn2gitUtility/conf/wiki.rules"
svn: E000002: Can't open file 'wiki/format': No such file or directory
Failed to open repository

I tried also to change permissions to the svn folder like stated in this StackOverflow question, but it didn't work.

Is there a problem in the configuration?

@slaci
Copy link

slaci commented Jul 29, 2021

This utility can create a git repo from a SVN repository, not a working copy. You need the repository which was created by svnadmin create once (on a server).

I got this error too when I tried to use a working copy (checked out by svn checkout). Working copies have a format file in their .svn folder and it contains 12 for me which this utility doesn't like either (eg if you try wiki/.svn then that will emit a different error).
However, repositores have the format file in their root and that is what this tool expects.

@AnLupoTamTamy
Copy link
Author

Thank you for your answer. This mean that I need to connect to remote SVN server where I have the repository and on that server start the tool?
Is there a way to run the process on a server which is not the server on which SVN server is installed? If I understand correctly your answer, this utility can't run on my local pc.

@tnyblom
Copy link
Contributor

tnyblom commented Jul 29, 2021

For KDE what we did was,
1: Set the SVN repository in read only mode.
2: rsync the remote SVN repository to the local PC
3: Run the conversion (on the local PC)
3.x: Verify/rerun until ok
4: Upload the resulting git repo(s)

@slaci
Copy link

slaci commented Jul 29, 2021

Check if you can run svnadmin on your local computer. I think the subversion package installs it too.

Someone must dump the repository for you on the server with svnadmin dump repo_directory > repo.dump. On newer versions it may be svnadmin dump --file=repo.dump repo_directory (check svnadmin dump --help)

Then you can load that dump on your computer and use this tool:

svnadmin create mylocalrepo
svnadmin load mylocalrepo < repo.dump
# on newer versions it may be
# svnadmin load --file=repo.dump mylocalrepo
# check svnadmin load --help

# now pass the mylocalrepo directory to the tool

Or it is possible to just download the repository directory (like mentioned above by rsync) and use that, but not sure if that works always if versions differ too much. Dump and load should work all the times I think.

@AnLupoTamTamy
Copy link
Author

Thank you for your suggestions! I tried to to run svnadmin and is available locally. I'll try as soon as possible (i.e. when I'll receive the dump from system administrators) and I'll be back with result I'll achieve.
When I run this migration is also possible to retrieve new updates from svn or, once the migration is completed, it won't be possible to get new commits from svn and migrate them to git? Just to know if the migration suppose that the svn repository won't be used anymore by committers and only the new git repository has to be used.

@slaci
Copy link

slaci commented Jul 29, 2021

I don't know that. There are some open issues about incremental update. The tool can record some metadata into the commit messages, but I don't know if it can use it to continue a migration like git svn. Sadly no idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants