开发者

Moving duplicate directory structures onto one another

I have duplicate directory structures in two locations that I need to merge together in an svn repository. By "merge" I mean I want all files and folder that are unique to structure b to be moved into structure a. When I try to do this using svn move I get the error

svn: Path 'com' already exists

The folders look like:

src
 -> com
    -> (many more files and directories)
 -> java
    -> com
       -> (some files and folders, some folders overlap but all files are unique)

src\com is a and src\java\com is 开发者_StackOverflowb.


You could svn merge the entire history of the source 'com' path in to the destination path, which will preserve the history of those files e.g.

svn merge -r 1:HEAD svn://repository-path-to/com working-copy-path-to/com

You need to make sure the revision range includes the revision that adds the first files to the source 'com' folder.


After talking to several people I have come to the conclusion that svn does not support this behavior.

It is possible to produce the same results by writing a script that reads the contents of java\com and produces a svn move command for each item. If there are overlapping files and directories on many levels then this would not work however. Directory overlaps could be handled by expanding the script to crawl the directory hierarchy, tagging the overlaps and moving their contents as above. File overlaps would have to be handled manually and no script will be able to decide which file to keep in all cases.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜