tags:

views:

138

answers:

2

I want to create a branch off a revision that "doesn't exist". What I have so far:

("/branches" is shorthand for "http://mysvn/myrep/branches)

  1. /branches/1.0.x has revs 1-24900
  2. I want /branches/myBranch to be at 24900 so I copy the /1.0.x
  3. I want /branches/1.0.x to be at 24887 so I delete it in preparation for...
  4. svn cp /branches/myBranch:24887 /branches/1.0.x

Which then complains that

svn: Path 'http://mysvn/myrep/branches/myBranch:24887' does not exist in revision 24901

Is there a way I can do this on the server? I really don't like checking out my entire branch

+3  A: 

Have a look into "Peg revisions": http://svnbook.red-bean.com/en/1.5/svn.advanced.pegrevs.html

In short, try

svn cp /branches/myBranch@24887 /branches/1.0.x

i.e., replace the colon with '@'.

sunny256
...except that you need to change /branches/myBranch@24887 to /branches/1.0.x@24887 - as myBranch only existed at revision 24901 (24900 being the last commit of 1.0.x prior to starting this mess). e.g. the @rev must be used against the url that actually had that revision...
Stephen
Ah, the last revision of 1.0.x was in r100, so you'll probably use "svn cp /branches/myBranch@100 /branches/1.0.x".
sunny256
oops - I modified my original post to have more realistic version numbers (e.g. a large repository rather than a small one) - our checkouts take many minutes as opposed to many seconds. I'll update the outstanding mis-edit
Stephen
+2  A: 

You need to take advantage of peg revisions. Here's the chapter in the SVN book:
http://svnbook.red-bean.com/en/1.5/svn.advanced.pegrevs.html

William Leara