Gilmor
Gilmor

Reputation: 449

KDE SVN2GIT "WARN: Branch ... in repository ... doesn't exist at revision ... -- did you resume from the wrong revision?" Can't continue

I'm trying to migrate an 11GB SVN repo with over than 24k revisions inside to a single GIT repository.

I did a single file dump of the SVN using svnrdump command and load it into my local SVN server, placed on my MacBook machine.

I downloaded the svn2git from the https://github.com/svn-all-fast-export/svn2git repository.

Due to differences in the way how SVN and GIT handle tags, I used a merged-branches-tags.rules from the svn2git sample directory, which look like this (I've removed comments): create repository myproject end repository

match /trunk/
  repository myproject
  branch master
end match

match /(branches|tags)/([^/]+)/
  repository myproject
  branch \2
end match

Then I used a docker image solution as described in the documentation (in my console it was a single line. I've did split it to clarify what I was doing):

docker run --rm -it \
    -v /Users/me/work/SVN/dest:/workdir \
    -v /Users/me/work/svnServer/repositories/my_svn_repo:/tmp/svn \
    -v /Users/me/work/SVN/svn2git/samples:/tmp/conf \
    svn2git /usr/local/svn2git/svn-all-fast-export \
    --rules /tmp/conf/merged-branches-tags.rules \
    --add-metadata --svn-branches --debug-rules --svn-ignore --empty-dirs \
    /tmp/svn/

During the first try I got an error between revisions 12600 and 126001:

Exporting revision 12601     /tags/7.0M0p0000 was copied from /tags rev 12600
rev 12601 /tags/7.0M0p0000/ matched rule: "/tmp/conf/merged-branches-tags.rules:28 /(branches|tags)/([^/]+++++
)/"    exporting.
.WARN: SVN reports a "copy from" @ 12601 from /tags @ 12600 but no matching rules found! Ignoring copy, treating as a modification
WARN: Transaction: "7.0M0p0000" is not a known branch in repository "myproject"
Going to create it automatically
add/change dir ( /tags/7.0M0p0000 -> "7.0M0p0000" "" )
+++++
WARN: Branch "7.0M0p0000" in repository "myproject" doesn't exist at revision 12601 -- did you resume from the wrong revision?
Failed to write to process: Process crashed for repository myproject
 6223345 modifications from SVN /tags/7.0M0p0000/ to myproject/7.0M0p0000%

I've check it and in the rev 12601 there there is a new tag named as "7.0M0p0000", which I'm going to import as a branch and which wasn't in the repo in rev 12600.

Do you have any ideas what can I do to fix that and continue my migration? Any help will be really appreciated.

Upvotes: 0

Views: 664

Answers (1)

Gilmor
Gilmor

Reputation: 449

After a further investigation, it turns out that the mentioned "7.0M0p0000" tag was created in the rev 12601 as a copy of all the tags from rev 12600.

I've found it in the dump file, created using this command:

svnrdump dump -r 12600:12601  --incremental http://xxx.xxx.xxx.xxx/svn/my_repo > my_repo.dump

There was an entry:

Revision-number: 12601
...
Node-path: tags/7.0M0p0000
Node-kind: dir
Node-action: add
Node-copyfrom-rev: 12600
Node-copyfrom-path: tags

It seems that KDE's svn2git is unable to deal with such cases (which was probably done by mistake).

The only solution I found was completely skip this tag by adding a match to my merged-branches-tags.rules file (order of match expressions is important):

match /tags/7.0M0p0000/
  min revision 12600
  max revision 12606
end match
...
match /(branches|tags)/([^/]+)/
  repository myproject
  branch \2
end match

Upvotes: 0

Related Questions