Skip revisions when installing SubGit repository

雨燕双飞 提交于 2020-01-04 04:49:09

问题


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.


回答1:


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.



回答2:


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).



来源:https://stackoverflow.com/questions/18918215/skip-revisions-when-installing-subgit-repository

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!