Kevin Borders
Kevin Borders

Reputation: 2992

svn: File not found when merging deleted branch

When I try to use a deleted branch as a merge source, I get an error that the branch does not exist in the current version:

svn merge -r100:105 svn://repository/project/branches/deletedbranch .

The output is:

svn: File not found: revision 110, path '/branches/deletedbranch'

But the branch was deleted between its last edit and the current revision. How do I bypass this error?

Upvotes: 0

Views: 806

Answers (1)

Kevin Borders
Kevin Borders

Reputation: 2992

You can append @rev to the end of the source URL using a revision when the branch did exist:

svn merge -r100:105 svn://repository/project/branches/deletedbranch@100 .

This is called a "peg revision" and tells SVN to use the path as it existed in revision 100. This can also be used to point to a version of a directory or file which has since been replaced with a different directory or file of the same name.

Upvotes: 1

Related Questions