views:

40

answers:

2

I want to copy a subversion project (/signature_paper) into a subdirectory of another subversion project (/thesis). I will make changes in /thesis/signature_paper that will not go back into the original signature paper. At the same time, I will want /thesis/signature_paper to pick up most or all all of the changes made in /signature_paper.

Ideally I would like this to check out as a single subversion project, i.e., svn co http://blah/thesis thesis gives me the whole thing, including /thesis/signature_paper.

I'm not sure if branching and periodically merging from /signature_paper can quite do this for me or not, nor how to do that if so. I've used branches in Clearcase years ago, but never set up my own. I set up our svn repository without using a /trunk design originally. I usually use the command-line client but can use Tortoise if it helps.

Is there any easy way to accomplish this? I periodically manually remade an analogous project last time I had this need (extracting an evolving paper into a larger document), and it was a real pain.

Edit: Hmm, so does it work to just do something like the following?
% cd thesis
% svn co blah/signature_paper
% find . -name .svn -exec rm -rf {} \;
% svn add signature_paper

Then later use svn merge from /signature_paper to /thesis/signature_paper?

+2  A: 

Make sure to have 'single' commits for changes that shall be merged. How to merge only specific revisions explains how to 'synchronize' your documents. Splitting your text into several subdocuments might help to. Subversion forces no directory layout, you're free to create a directory layout that suits you best.

The easiest approach is to isolate common text sections into separate files, put in the common folder. These paragraphs are included with \input{name} to your thesis or paper.

In cases where you can't or don't want to maintain a common file, thesis and paper need to be merged in order to exchange content. I have two huge documents in mind. As you might not synchronize all content, changes to be merged shall go into a 'revision'. In other words your working copy is up to date. You apply your changes and make a commit. Next you merge this exact revision with the other document.

-trunk
--thesis
--paper1
--paper2
--common

zellus
So how does subversion know where to merge it into the other document? I just tell it manually each time?
Paul
Subversion in contrast to mercurial, which is change sets oriented, tracks revisions. Make sure to make a commit before you start working on changes that shall be merged to the other document. Then edit your document (thesis) and commit the changes to be merged. Now merge that created revision to your 'paper'.
zellus
+2  A: 

You could just set it with svn:externals, which (if you don't pin revision numbers) will update with the rest of the checkout. Just be sure not to commit from your external directory (contrary to update's, commit's don't commit svn:externals I believe, but you might want to test that

An example, for more information see the documentation on svn:externals:

$ svn co http://blah/thesis
$ cd thesis
$ svn ps svn:externals 'signatur_paper http://blah/signature_paper' .
$ svn up
Fetching external item into 'signature_paper'
A    signature_paper/
....
Updated external to revision N.

Updated to revision N.
$ svn info .
....
URL: http://blah/thesis
.... 
$ svn info signature_paper
....
URL: http://blah/signature_paper
.... 

Updating fetches externals too:

$ svn up
Fetching external item into 'signature_paper'
External at revision N.

At revision N.

Committing does not commit from externals, unless you explicitly do so in the directory:

$ touch signature_paper/test
$ svn add signature_paper/test
A         signature_paper/test
$ svn ci -m'test'
//nothing happens.......
$ svn ci -m'test' signature_paper/
Adding         test
Transmitting file data .
Committed revision N.
Wrikken
I think you're thinking an entire level beyond me. I have no idea what you're proposing, nor do I even know for sure how to set up and merge the structure I'm proposing. Could you look at the revised question where I say what I've done so far and give me some feedback?
Paul
Added an example how one would do it with `externals`.
Wrikken