3

I have a SVN project and I want to clone to either Git or Mercurial. The cloning to both VCS' works fine, except for one major problem - I always get only the last revision, no any other history whatsoever.

I can clearly see that the root of the problem is that the SVN project was recently renamed (renaming is the last revision, the only one I manage to get). Using SVN I can see all the history behind the project without any issues.

The weirdest thing is, when I use git-svn clone, I can see it going through numerous revisions, supposedly importing them, but I still get only one revision in the end. Mercurial, which works backwards, unlike Git, just takes the last revision and is done with the cloning.

Also, it is important to note, that this last SVN project renaming/moving is not the only one. There were at least two other renames prior to that, and I do need the complete project history, just like I see it using SVN.

NeverwinterMoon
  • 2,363
  • 21
  • 24
  • What is "project renaming"? I don't know how to translate it into SVN-terms. Root-folder renamed? You can clone only small subset of revisions and pull others later, and, for changed path, use --filemap for mapping old and new location into one permanent – Lazy Badger Nov 30 '12 at 10:30
  • Yes, that's what I meant - the root folder of the project was renamed. Isn't --filemap used by Mercurial Convert extension only? Convert is not ideal for me, it's not as flexible as hgsubversion. I need to continue working with SVN, not just convert SVN repo to Mercurial. Also, that's exactly what the problem is - I can't clone any revisions other than the last one. Even if I specify some other revision. – NeverwinterMoon Nov 30 '12 at 10:50
  • 1. filemap and other *maps can be used in `hg clone`, when clone used for "foreign" repo 2. You can try touse PEG-revision in URL with old path for clone – Lazy Badger Nov 30 '12 at 11:18
  • Yeah, I tried pointing to old path and specifying revision using @REV_NO, for some reason hg says it can't find anything at the location. Although I can browse that same location using SVN. – NeverwinterMoon Nov 30 '12 at 11:55

2 Answers2

0

For mercurial, I'm seeing this guide which may prove helpful. There are enough other question on the right related to git-svn to solve your problem.

I'm assuming you saw this, a tutorial on git-svn done by the Parrot project. It further appears that you need to do a git rebase after git log to determine the revision hash code you'd like to use. As before, if you need further information, leave a comment.

Community
  • 1
  • 1
hd1
  • 33,938
  • 5
  • 80
  • 91
  • The Mercurial guide you linked is the first thing I ever looked at when trying out anything with hgsubversion. It describes a basic process of a Hg-SVN bridge. As I said, I can create that bridge. It's just I can't manage to get all the SVN history and there's a specific reason behind it. The guide doesn't have any mention of that. As for git-svn, I managed to find only one question related to that exact situation I'm in and it didn't prove to be that much of use to me. – NeverwinterMoon Nov 30 '12 at 08:58
  • Hm, yeah, the only way I see of doing it would be to clone the ranges of revisions before each rename and then just merge them. I've tried cloning old repo from the older revision, like this git svn clone -r 1:2 /path/to/svn@2 but it didn't work... – NeverwinterMoon Nov 30 '12 at 10:00
0

Ideas

  • Since it is impossible clone non-existent svn-URL with PEG-revision

    hg clone http://mayorat.ursinecorner.ru:8088/svn/Hello/branches/Greetings@16

    abort: HTTP Error 404: Not Found

even if

svn ls http://mayorat.ursinecorner.ru:8088/svn/Hello/branches/Greetings@16
Hello.txt

you can try to clone repo, using parent od renamed directory as root. You'll get a lot of irrelevant changeset s for sibling paths, but (if rename was fair svn move) I hope, all chagesets for path-in-question will be in repo: you have only clean-up history

  • Split and merge

Dump SVN-repo, split it with svndumpfilter into separate dumps (dump per changed directory name), load dumps into separate svn-repos, clone every svn-repo into own Mercurial repo (repo can't have more than one subversion origin), pull repos into common, fix history

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
  • Yep, a simple but good idea on cloning the parent folder. I've just tried it now. Sadly, hg dies on one of the revisions all the time with "could not read chuck size" error. Git, on the other hand, does the same thing well (although, as usual, in a very slow fashion). Thanks for sticking around. If you have any other ideas, feel free to add :) – NeverwinterMoon Nov 30 '12 at 12:47