我正在尝试使用(Kde) SVN2GIT将具有26,000多个修订版的SVN存储库迁移到多个Git存储库。一个特定的存储库在迁移时会产生错误。这就是为什么我减少了迁移到该特定存储库的规则。
以下是生成资源库的规则:
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是使用Linux服务器上documentation中提供的docker image选项执行的。我尝试过的一些替代方法在规则中包括参数“操作递归”的用户,这在here中进行了描述。规则如下所示:
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
我也玩了一些规则,但是我的方法都不起作用。
这里是日志的片段:
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/"
我的问题是,如果有人之前曾有此错误,如果是,您如何处理?
任何帮助将不胜感激。我已经解决这个问题了一个多星期。
谢谢,希望有人能提供帮助。
我要在这里刺死。我可能会看到您的问题。假设dir1和dir2在相同的主干/分支/标签上,并且没有不同。否则让我知道。
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
你好@EncryptedWatermelon,非常感谢您的答复,它非常有帮助。
我根据规则测试了您的建议,并进行了一些调整。仅以下规则解决了该错误:
# Recurse into branches
match /Project/branches/([^/]+)/$
action recurse
end match
我当前的问题是未获取标签。在我的SVN仓库中,标签名称与分支名称相同。为了解决这个问题,它添加了一个额外的标记目录(refs / tags / tag /),原始标记规则如下所示:
match /Project/tags/([^/]+)/dir_1/
repository my_repo
branch refs/tags/tag/\1
annotated true
end match
根据您的建议,我包括以下规则:
match /Project/tags/$
action recurse
end match
# Recurse into tags
match /Project/tags/([^/]+)/dir_1/$
action recurse
end match
但是标签仍然不存在。
您看过类似的东西吗?标签的名称与分支的名称相同可能是一个问题吗?
先谢谢您,希望能对您有所帮助。
干杯!