I have been reading up on Vendor Branches with subversion. I'm not very comfortable with the subversion command line and I have been using TortoiseSVN and Subclipse as SVN clients on my Windows 7 box.
In the Vendor Branches documentation for subversion, they discuss doing a "foreign repository copy", but I have not been able to find how to do this with TortoiseSVN. When I have searched the internet for how to do this with TortoiseSVN, I found articles suggesting using svn:externals
instead. The documentation for Vendor Branches does not say to use svn:externals
and instead says to use a foreign repository copy.
Does anyone know how I can do such a copy with TortoiseSVN? If it is not possible, would svn:externals
give me the same result?
EDIT:
Here is my workflow:
- I created a new root-level folder in my repository called
vendor
. This is a sibling oftrunk
. - I checked out
myrepo/vendor
to a new working copy. - I attempted to merge
two different trees
using TortoiseSVN frommyvendorrepo/trunk
tomyrepo/vendor
. This returned an error telling me thatmyvendorrepo/trunk
must be in the same repository asmyrepo/vendor
.
The Vendor Branch documentation specifically talks about a foreign repository copy
, but it does not seem to be possible with TortoiseSVN.
svn help merge
) - this type of merge not used in Vendor Branching, used by different way and for different goals:svn merge URL1 URL2
will merge into WC of URL3 independent parallel changes from URL1+URL2"Foreign Copy" and Externals Vendor Branching in Sample
Let's imagine:
VENDOR/PATH/TO/LIBRARY
MY/VENDORS/VENDOR/LIBRARY
(additional intermediate /VENDORS node is workpiece for the future, when more than 1 vendor may appear)MY/trunk
"Foreign Copy"-style
VENDOR
repository withsvnadmin dump
and transmit dump to you, after it filter only/PATH/TO/LIBRARY
node withsvndumpfilter
svnrdump URL
, which have some benefits: you can dump any remote repository, for which you have read-access, you can dump only part of repository (and eliminate svndumpfilter headache) -svnrdump dump VENDOR/PATH/TO/LIBRARY > dumpfile
MY
repository:svnadmin load /PATH/TO/MY < dumpfile
with some additions:--ignore-uuid
option (in case of not-emptyMY
) not needed, but may be used for safety/PATH/TO/LIBRARY
to/VENDORS/VENDOR/LIBRARY
additional option--parent-dir /VENDORS/VENDOR/
is a must (TBT!!! I write parent spec from memory)After these operations you'll have node in your local repository, which is exact copy of remote node, but not related toremote by any way: you have to monitor remote changes and sync with your copy by hand (
svn up VENDOR/PATH/TO/LIBRARY
in separate WC, copy changes to your WC, commit changes)Externals-style
/VENDORS/VENDOR/
inMY
repository (svn mkdir --parents /VENDORS/VENDOR
)For both styles integration of upstream to your code will be just periodical merge /VENDORS/VENDOR/LIBRARY to trunk
PS: for externals-syle first creating initial snapshot in trunk (in case of empty trunk) and first merge to trunk may be troublesome and not obvious. AFAICR, you will not be able to merge /VENDORS/VENDOR/LIBRARY to empty trunk (and
svn copy
also ): you'll get (can't recall text) error and no merge|copy at all. Can't reference to The Right Way, but I just copy filesin Working Copy from vendor branch to trunk and commit trunk in order to have BASE and in this case in first merge (and only first) of LIBRARY to trunk in order to merge unrelated (for Subversion) nodes add--ignore-ancestry
option: later trunk and LIBRARY are already related