SVN Mirror tagged branch history preservation

82 Views Asked by At

I've been tasked with mirroring only a specific branch from our SVN repo with a full history, the branch that has to be mirrored has been tagged/cut sevral times. I've been using the Subgit SVN Mirror plugin on Bitbucket to do this. However, the mirroring only shows the history from when the branch was tagged. Is there a way to mirror only a branch while maintaining full SVN history in Git? Our structure in SVN is similar to the following, where "trunk" is the origin branch, "feature1" was tagged from "trunk, "feature2" was tagged from "feature1" and "taggedTrunk" is the branch that needs to be mirrored:

/Project A
    /branches
        /taggedTrunk
        /feature1
        /feature2
    /trunk

I've tried the following mappings:

1.

trunk = Project A/branches/taggedTrunk:refs/heads/development
branches = Project A/trunk:refs/heads/originalTrunk
includePath = /src
trunk = Project A/branches/taggedTrunk/:refs/heads/development
branches = Project A/branches/*:refs/heads/*
includePath = /src

Just to clarify, we're not trying to mirror the entire repo - in our Git repo we only want 1 branch having the full history

1

There are 1 best solutions below

2
ildar.hm On

It is important where the "taggedTrunk" branch was tagged from and how exactly has it been created, by copying the source directory with 'svn copy' so that the copying information is present in the SVN history, or by copying with regular operating system "copy" and adding then so that this operation is reflected in the history as a simple adding, not copying. In the former case the history can be obtained by adding the source branch into the mapping. That is, if the "taggedTrunk" was created by copying, say, "feature1", then adding it to the mapping

trunk = Project A/branches/taggedTrunk:refs/heads/development
branches = Project A/branches/feature1:refs/heads/feature1
includePath = /src

will bring the history. In the latter case, I'm afraid, there is no way to get the history of the branch as SVN Mirror add-on won't be able to recognize and trace the history.