开发者

How can apparently nested Subversion working copies be coalesced? [Equivalently: How do I add the parent directory to source control?]

I have a partially checked-out tree of sources. These were i开发者_运维百科ncorrectly checked out with commands like this:

> svn co --depth=empty svn://repos/trunk .
> svn co --depth=infinity svn://repos/trunk/project project
> svn co --depth=infinity svn://repos/trunk/test test

Of course, the commands should have been something like

> svn co --depth=empty svn://repos/trunk .
> svn up --set-depth=infinity project
> svn up --set-depth=infinity test

The resulting symptoms are:

> svn st
?       project
?       test

although

> svn info
Path: .
URL: svn://repos/trunk
Repository Root: svn://repos
Repository UUID: 01234567-89ab-cdef-0123-456789abcdef
Revision: 1234
Node Kind: directory
Schedule: normal
Depth: empty

> svn info project
Path: project
URL: svn://repos/trunk/project
Repository Root: svn://repos
Repository UUID: 01234567-89ab-cdef-0123-456789abcdef
Revision: 1234
Node Kind: directory
Schedule: normal

(Curiously, the symptoms don't arise if the first command was svn co --depth=immediates svn://repos/trunk ..)

Now, the reason for the symptoms is that the file

./.svn/entries

does not contain entries for the project and test directories. (I can fix my problem by hacking directly into this file, but I'd really rather not.)

My question is:

Is there a Subversion command to 'coalesce' these working copies so that svn st is silent (or shows local modifications in project and test)?

I have tried various things, including

svn up --set-depth=immediates --depth=empty .

but that doesn't work because --depth and --set-depth "are mutually exclusive".

I have also tried

svn up --set-depth=infinity project

but that doesn't work because project is interpreted as a relative path locally rather than in the repository; that is, the URL is formed after rather than before application of the relative path to the current directory.

Worse still, I have tried

svn up --set-depth=immediates .

but that has the unfortunate (but correct) effect of merrily removing files.

This question is more widely relevant than the circumstances I describe. Another situation that might call for this kind of 'fix' is if you wish to check out the parent of the uppermost node already checked out without having to re-checkout the sources that already exist locally, and whilst retaining any local modifications.

Thanks, Rob.


No, coalescing such working copies is not possible in a supported way. I would simply make a fresh checkout to fix the situation.


You can copy incorrectly checked out sub-paths to another location, then correctly up with

svn up --set-depth=infinity project
svn up --set-depth=infinity project

then find a way to overwrite the files with saved in another location recursively, so they are now under a parent checkout

May be cat (linux) or type (Windows) will do.

Linux:

cat savedLocation/recursiveDir/file > recursiveDir/file

Windows:

type savedLocation/recursiveDir/file > recursiveDir/file

You can list the files with recursive directory with tree command on linux:

tree -if savedLocation/

Don't know how to do the same in Windows

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜