0

I use Open Source libraries like FastMM.

I check it out from https://fastmm.svn.sourceforge.net/svnroot/fastmm

and then would like to add it to my own SVN server https://project.svn.company.com/

But since the files are already checked out from https://fastmm.svn.sourceforge.net/svnroot/fastmm there is no way to add them to my own SVN.

I would like to have both:

  1. The files which I need for my compilation in my SVN https://project.svn.company.com/

  2. Have to ability to easily Update the open source libraries from https://fastmm.svn.sourceforge.net

What is the recommended way of dealing with this?

P.S. The servers are SVN and the client is TortoiseSVN

Gad D Lord
  • 6,620
  • 12
  • 60
  • 106

2 Answers2

2

You can use external dependency that will automatically update other subversion repositories when you update yours.

A simple tutorial with tortoise (this is with the TortoiseSVN 1.7, but the process is very similar with older versions of TortoiseSVN):

In explorer, right click on your subversion working copy folder, and choose TortoiseSVN > properties

choose new > externals

Add a new external, putting in a local path you want it to be checked out to, the repository url, and revision.

Hit ok a few times/close any tortoise dialogs, then do an update on your repository. If everything is setup correctly your local repository and the other repository you linked to. You might have to commit the properties changes before doing an update.

You can modify/remove the external at any time you want to via a similar method as described above (instead of choosing new, choose edit/remove).

helloworld922
  • 10,801
  • 5
  • 48
  • 85
  • Does this method also provide support for "local" changes to other repository? I mean, changes to files from the external project are committed to the main project repository? And does it provide methods to handle merging from upstream..? I never used Tortoise, just command line or the eclipse client, but I guess there should be a way to do this via command-line too.. – redShadow Dec 31 '11 at 04:17
  • Yes, you can modify the external repo in any way you could a normal repo (so if you have permissions to commit, you can). You're just telling SVN that one repo depends on the other. Externals is not something that's unique to tortoise, it's an SVN feature. – helloworld922 Dec 31 '11 at 07:18
  • Yeah, but (if I understood correctly) the request was for "commit local changes to remote source (without write permission) into a local repository".. In git, you can do that and it have some tools to manage merging of "forks" with the upstream; in SVN I don't know any straight-forward way to do that (it's git beauty... :)) – redShadow Dec 31 '11 at 14:40
  • From his question it sounds like he wants to update from the remote repo, not commit to it. There is a merge tool provided with tortoise, it's also possible to create patches. In general no source control software I've used allows you to make changes to the repo unless you have permission (for good reasons). It is possible to branch/tag into another repo and merge back in SVN, but you do need write permissions for the external repo to merge. – helloworld922 Dec 31 '11 at 17:28
  • Yup, I don't mean "committing without permission", of course, but just "forking and then marging changes from upstream into local repository". – redShadow Dec 31 '11 at 18:10
  • Like I said, the external repo behaves like a normal repository that gets updated with your normal repository and you have access to all the normal SVN tools, including merging. – helloworld922 Jan 01 '12 at 01:59
  • Right, but what happens when you make changes to code from the external repo, but don't have write access to commit there? That's what I meant: you have to export source from remote, re-import in a local repo and then merge changes from upstream with local changes. – redShadow Jan 01 '12 at 04:36
  • The suggested Externals property (also described at http://svnbook.red-bean.com/en/1.0/ch07s03.html) did exactly what I needed to achieve. Thank you @helloworld922 – Gad D Lord Jan 04 '12 at 14:37
0

AFAIK, there is no straight-forward way to do this; the only way seems to be manually exporting files + merging new versions of the library.

To do that you have to use the export command instead of checkout, that exports file from the repository without storing any information with them; thus allowing you to treat them as normal files, copy inside another svn project, etc.

(Alternatively, just remove all the directories named .svn from the library source tree).

Then, use some tool to manually merge the checked-out library source with your local version.

redShadow
  • 6,687
  • 2
  • 31
  • 34