timdisney
timdisney

Reputation: 5337

Single file merge in Subversion

I'm using Subversion 1.5 and have a single file in a branch that I want to merge into another branch. When I do a svn merge http://path/to/file I get an error,

Cannot replace a directory from with .

Does this just mean that Subversion can't do this?

Upvotes: 46

Views: 52883

Answers (4)

user2509663
user2509663

Reputation: 179

Im am using subversion 1.8.8 and

svn merge ^/trunk/path_to_file ./branch/path_to_local_file

works fine for me.

Upvotes: 4

ownking
ownking

Reputation: 2006

The merge, as Andrew recommended it, worked for me, but not for every file. I had three files, but for the third I got the error "...path not found". Adding the argument " --ignore-ancestry" solved that problem.

But after merging I had strange modified/merged file status and a lot of svn:mergeinfo added to my working copy.

So I decided to just do a simple copy&paste for single files to avoid such confusing stuff until we switch to Git where these tasks are really no problem at all ;)

Upvotes: 1

Andrew Edgecombe
Andrew Edgecombe

Reputation: 40362

Try specifying the path to the local file as well.

For example,

svn merge -r1234:1235 svn://your_svn_url/to/file ./local_file

Upvotes: 75

Sander Rijken
Sander Rijken

Reputation: 21615

I think you need to do a

svn merge http://server/repos/path/to -r <REV>

where <REV> is the revision where the file was added. That way merge information is recorded (in case of a Subversion 1.5 or higher repository).

Upvotes: 0

Related Questions