Reputation: 61
I'm trying to migrate an SVN repository with over 26,000 revisions to multiple Git repositories using (Kde) SVN2GIT. One specific repository generates an error while migrating. This is why I reduced rules for migration to this specific repository.
Here are the rules for generating the repository:
create repository my_repo
end repository
#
# Declare the rules
# Note: rules must end in a slash
#
#
# my_repo
#
match /Project/trunk/dir_1/
repository my_repo
branch master
end match
match /Project/branches/([^/]+)/dir_1/
repository my_repo
branch \1
end match
match /Project/tags/([^/]+)/dir_1/
repository my_repo
branch refs/tags/tag/\1
annotated true
end match
match /
end match
SVN2Git was executed using the docker image option provided in the documentation on a Linux server. Some of the alternatives I tried included the user of the parameter "action recurse" in the rules, which is described in here. The rules would look like this:
create repository my_repo
end repository
#
# Declare the rules
# Note: rules must end in a slash
#
#
# my_repo
#
match /Project/trunk/dir_1/
repository my_repo
branch master
min revision 18800
end match
match /Project/branches/([^/]+)/dir_1/
repository my_repo
branch \1
min revision 18800
action recurse
end match
match /Project/tags/([^/]+)/dir_1/
repository my_repo
branch refs/tags/tag/\1
min revision 18800
action recurse
annotated true
end match
match /
end match
I also played a bit with the rules but none of my approaches worked.
Here is a snippet of the logs:
Exporting revision 18840 done
Exporting revision 18841 /Project/branches/branch_2/dir_1 was copied from /Project/branches/branch_1/dir_1 rev 18840
/Project/branches/branch_2/dir_2 was copied from /Project/branches/branch_1/dir_2 rev 18840
rev 18841 /Project/branches/branch_2/dir_2/ matched rule: "/tmp/conf/Project.rules:22 /Project/branches/([^/]+)/dir_2/" exporting.
.my_repo : branch branch_2 is branching from branch_1
"branch_2" in repository "my_repo" is branching from branch "branch_1" but the latter doesn't exist. Can't continue.
rev 18841 /Project/branches/branch_2/dir_2/ matched rule: "/tmp/conf/Project.rules:22 /Project/branches/([^/]+)/dir_2/"
My question is if someone had this error before and if yes, how did you deal with it?
Any help will be really appreciated. I'm have being dealing with this problem for over a week.
Thanks and hope someone can help.
Upvotes: 1
Views: 506
Reputation: 61
Hello @EncryptedWatermelon, Thank you very much for your reply, it was very helpful.
I tested your recommendations on my rules and after some tuning it worked. The following rule alone solved the error:
# Recurse into branches
match /Project/branches/([^/]+)/$
action recurse
end match
My current problem is that the tags are not being fetched. In my SVN reposotory the tags names is the same as the branches names. To solve this it was added an extra tag directory (refs/tags/tag/) and the original tag rules look like this:
match /Project/tags/([^/]+)/dir_1/
repository my_repo
branch refs/tags/tag/\1
annotated true
end match
Following your advice I includes these rules:
match /Project/tags/$
action recurse
end match
# Recurse into tags
match /Project/tags/([^/]+)/dir_1/$
action recurse
end match
But the tags are still not there.
Have you seen something like this? Could it be a problem, that the names of the tags is the same as the name of the branches?
Thanks in advance and hope you can help.
Cheers!
Upvotes: 1
Reputation: 5598
I'm going to take a stab at this here. I may see your issue. Assuming you dir1 and dir2 are on the same trunk/branch/tag and not different. Let me know otherwise.
create repository my_repo
end repository
#
# Declare the rules
# Note: rules must end in a slash
#
#
# my_repo
#
match /Project/$
action recurse
end match
match /Project/trunk/$
action recurse
end match
match /Project/branches/$
action recurse
end match
match /Project/tags/$
action recurse
end match
# Recurse into branches
match /Project/branches/([^/]+)/$
action recurse
end match
# Recurse into tags
match /Project/tags/([^/]+)/$
action recurse
end match
# Start matching
match /Project/trunk/
repository my_repo
branch master
end match
match /Project/branches/([^/]+)/
repository my_repo
branch \1
end match
match /Project/tags/([^/]+)/
repository my_repo
branch refs/tags/\1
annotated true
end match
match /
end match
Upvotes: 4