3

I'm using SubGit to clone a SVN repository. Somewhere along the revisions is a copy of "/" to a certain tag. When SubGit loads every revision, it takes a long time to get this certain tag, which happens to be a copy of "/". This prevents the copy from being made.

I have tried setting a minimalRevision, but I need revisions before and after the copy of "/". SubGit is able to get revisions before or revisions after that, but not all revisions and excluding this certain revision.

Is there a way to exclude certain SVN revisions while installing a SubGit repository ?

I have no admin access to the SVN server in order to delete this revision.

Dmitry Pavlenko
  • 8,530
  • 3
  • 30
  • 38
thebignet
  • 128
  • 5
  • A possible solution would be to clone SVN repository using svnsync and discard this revision if possible and then use SubGit on this repository, but seems like a lot to do, and I would loose sync to original SVN repo too. – thebignet Sep 20 '13 at 14:47
  • The best thing to do was to remove the faulty revision from the original SVN repository by dumping it, filtering it and recreating it from the filtered dump. – thebignet Dec 14 '13 at 12:55

2 Answers2

2

I encountered the same problem and here is how I skip some revisions. I am using SubGit 3.2.4.

  1. Run subgit import.
  2. When encounter a revision which takes a long time, press Ctrl+C to stop the import.
  3. Open the text file at <GIT_REPO>/svn/.metadata, where <GIT_REPO> is the path to the imported Git repository.
  4. Modify the settings branches-maxRev and tags-maxRev to the largest sequential revision number to want to skip. For example, if the values of branches-maxRev and tags-maxRev is 17761 and you want to skip revision 17762 and 17763, change the value to 17763.
  5. Run subgit import again to resume import.
VCD
  • 889
  • 10
  • 27
  • I have the same issue. I want to skip 22453. The process crashes with an SSL timeout because this revisions takes too long. I need to change the value 22453 to 22454 in the .metadata and restart the process? – lvthillo May 09 '17 at 14:07
  • 1
    @lorenzvth7 You should be changing the value from `22452` to `22453`. Anyway trial and error and you should be able to fine the correct value. – VCD Aug 07 '17 at 03:32
  • I have the same problem, and tried doing this, setting branches-maxRev and tags-maxRev to the revision I was getting stuck on (tag of everything that then was deleted), but I now get an error: `IMPORT FAILED error: There're new Git commits, not present in SVN repository, can't import. error: If you want continuous synchronization between SVN and Git repositories, use "subgit install" command instead.` – Svend Hansen Sep 11 '17 at 09:20
  • I decided to instead just exclude the path of the tag using `excludeBranches`. This isn't ideal as it means the "correct" tag which was created after the accidental one of "everything" was deleted, is also excluded, but since it's a tag from over a year ago (and it will still be in SVN if needed for some reason), I don't think it's a real problem. – Svend Hansen Sep 11 '17 at 10:48
0

From what I can see there is no way of excluding revisions from SubGit. However, there might be a different way of avoiding including the "copies of everything" in the import. If you know what svn path the copy was made to, e.g. tags/tag-of-root, you can exclude this by adding this to the <git-project>/subgit/config file:

excludeBranches = tags/tag-of-root

This means the tag will be excluded. The only drawback is that if a correct tag was later created with the same now, this tag will also be excluded. However, it's still the best option I've found, as the solution added by VCD doesn't work for me.

I've had to interrupt and restart (from scratch) my import four times so far, each time adding another excludeBranches config line, but the import is also getting a lot faster every time!

EDIT: I think the reason VCD's suggested workaround doesn't work for me is that the creation of the broken tag and its deletion are not in consecutive revisions, but rather with several days and many revisions between. Hence it's not possible for me to skip both the creation and deletion of the broken tag in one go, causing inconsistency where the deletion references a tag that hasn't been added (if I exclude the creation).

Svend Hansen
  • 3,277
  • 3
  • 31
  • 50