开发者

Subversion: How to maintain separate version of a project as subdirectory of another project

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 change开发者_运维知识库s 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?


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


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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜