-1

I am trying to make a branch with Subversion. The method the book describes is not working. I found this link in this post, but it merely mirrors the book. And this technique fails. Perhaps I did something wrong?

I used the svn copy command from my working directory to create a branch:

svn copy https://server.com/svn/iRP85_V2/trunk https://server.com/svn/iERP85_V2/branches/backlog -m "comment"

This seemed to work. Then following the instructions, I used the checkout command to change the code in my working copy:

svn checkout https://server.com/svn/iERP85_V2/branches/backlog

It looks like it copies everything over, but I am not sure what it is really doing. I make a change then do another checkout:

svn checkout https://server.com/svn/iERP85_V2/trunk

But I don't get the original without the change. I get the same code. If I checkout again from the branch I get the same code again.

Issuing the svn info command I see that I am always in trunk no matter what I pass to checkout. This command obviously does not do what the book implies. It does not change the source for working directories. It does not even replace modules in the working directory from the target specified in the parameter. What does it do?

Then I looked further and saw the switch command so I tried this:

svn switch https://server.com/svn/iERP85_V2/branches/backlog

And I get an error:

svn: E155025: 'https://server.com/svn/iERP85_v2/trunk' is not the same repository as 'https://server.com/svn/iERP85_V2'

If I issue a couple of info commands the repository id is the same.

G:\Code\Intuitive Projects\Projects>svn info

Path: .
Working Copy Root Path: G:\Code\Intuitive Projects\Projects
URL: https://server.com/svn/iERP85_v2/trunk
Repository Root: https://server.com/svn/iERP85_v2
Repository UUID: b4595441-a089-b54f-bc08-6f65ce278a35
Revision: 48
Node Kind: directory
Schedule: normal
Last Changed Author: JohnM
Last Changed Rev: 48
Last Changed Date: 2013-05-16 13:35:06 -0400 (Thu, 16 May 2013)

G:\Code\Intuitive Projects\Projects>svn info https://server.com/svn/iERP85_V2/branches/backlog

Path: backlog
URL: https://server.com/svn/iERP85_V2/branches/backlog
Repository Root: https://server.com/svn/iERP85_V2
Repository UUID: b4595441-a089-b54f-bc08-6f65ce278a35
Revision: 57
Node Kind: directory
Last Changed Author: JohnM
Last Changed Rev: 57
Last Changed Date: 2013-05-20 13:00:38 -0400 (Mon, 20 May 2013)

I even deleted the branch and recreated it in case I did something, but I get the same result.

I've been developing on the trunk and would like to use the branching feature. Especially when bugs are found, and I have to either tell people they must wait or selectively choosing what modules to put into production.

Community
  • 1
  • 1
John Maher
  • 111
  • 2
  • 12
  • 1
    Don't use `checkout` to switch from trunk to your branch -- use `svn switch`. And use `svn info` to make sure that your working tree is _really_ on the branch before you check in your change. Until we have `svn info` output from before you make the change, we don't know if you really changed branches successfully. – Charles Duffy May 20 '13 at 17:28
  • As for the system claiming it can't switch due to repository IDs not matching -- use relative URLs during the switch to moot any potential for this: `svn switch '^iERP85_V2/branches/backlog'` rather than the full URL. – Charles Duffy May 20 '13 at 17:31
  • The way you describe your problem, it seems like you are not fully undetstanding how SVN branches work. (Particularly, changes in a branch have to be merged to `trunk` to appear there). I'd recommend reading some more. – madth3 May 20 '13 at 18:25
  • @Charles - Thanks for your replies. I can't even get my working directory to point to the branch. I tried the following three statements: G:\Code\Intuitive Projects\Projects>svn switch ^iERP85_V2/branches/backlog svn: E125002: 'iERP85_V2/branches/backlog' does not appear to be a URL G:\Code\Intuitive Projects\Projects>svn switch "^iERP85_V2/branches/backlog" svn: E125002: '^iERP85_V2/branches/backlog' does not appear to be a URL G:\Code\Intuitive Projects\Projects>svn switch '^iERP85_V2/branches/backlog' svn: E125002: 'iERP85_V2/branches/backlog' does not appear to be a URL – John Maher May 20 '13 at 19:04
  • @mad - I am not trying to get any changes in branch to trunk. I am trying to edit a branch. That's all. The steps you describe all come AFTER the step I can not get past. And you are right, I do not understand how this is supposed to work. I've read the section on branching and merging twice. Reading it again will not help. I followed the directions and it still fails. I tried this last year and had to give up because it just didn't work. – John Maher May 20 '13 at 19:11
  • @JohnMaher Which version of Subversion are you using? The `^/foo` syntax was added in 1.6 (which is almost at end-of-life itself; anything older than 1.6 shouldn't ever be used anywhere). – Charles Duffy May 20 '13 at 22:43
  • Ahh -- it's `^/foo`, not `^foo`. – Charles Duffy May 20 '13 at 22:46
  • @Charles I am using version 1.7.6 – John Maher May 21 '13 at 17:35
  • Then it was just the `/` missing in my earlier instruction that threw you off; sorry 'bout that! – Charles Duffy May 21 '13 at 18:33

2 Answers2

0

The principle of how you are trying to do this looks correct. It appears you are just getting tripped up by some detail. Without having access to your repository and your hard drive, or a more detailed blow-by-blow of the commands typed, it's hard to say just what you did wrong.

First thought: After you create the new branch, are you trying to check out to the same directory where you had your old checkout? That doesn't work. You have to either check out to a different place, or use "svn switch" to change the current working copy to look at the new branch.

The problem you had with the switch would indicate that you're not pointing to the repositories that you think you are. Is vm006.corp.rotair.com another repository, or is that your local machine, or what?

Jay
  • 26,876
  • 10
  • 61
  • 112
  • I removed the server name in most of the statements because I didn't think it was wise to post a server name on a public forum. The one you point out is one that I missed. I am explicitly naming the server in every statement and they do not live on my local machine. Something else is wrong here. I may not be pointing to the repository I think I am so how do I get it there if explicitly naming it does not work? – John Maher May 20 '13 at 19:15
  • Ah, a red herring. Side note: It might help if you install Tortoise or SVN Commander or some other SVN client that gives you a GUI. It's easy to get tripped up on parameters on a command-line interface. That said, I think the first thing to do is to check out from your old branch to one directory and from your new branch to a different directory. Then try making changes in one, commit, and update the other, and things should be clean. I suspect your problem might be that you did a checkout on top of an existing checkout, which just doesn't work. – Jay May 21 '13 at 15:42
  • I did do a checkout on top of another checkout on top of many other checkouts. I do have tortise installed, but i need to know how to use this tool and the gui provides little documentation. So I am reading the book (again) and trying to use this thing. This is a rather large project and has other dependancies which would making using another directory unfeasable. The problem may come from using a gui and command the line. It seems the switch command wants a lower case v (iERP85_v2) while svn server reports iERP85_V2 and the svn copy command works either way. – John Maher May 21 '13 at 17:46
  • Number one: don't do checkouts on top of checkouts. This just doesn't work. If you already have a checkout, you can do an update to get new stuff, or you can check out to another directory, or you can delete the workspace and start over with a new checkout. – Jay Jul 24 '13 at 16:51
  • With my comment about checking out to two directories, I didn't mean that as a regular way of working. I meant that as a way to make sure you're doing it right and understand how it all works. – Jay Jul 24 '13 at 16:51
0

First off I would like to say thanks for everyone for their help. The problem seemed to be the 'v'. Using iERP85_V2 worked for the copy. Visual SVN also reports iERP85_V2. However the switch command only works with iERP85_v2. There aren't two repositories, only one. The svn server displays it as V2 and svn info displays it as v2. This is a very user unfriendly tool :).

Thanks again

John Maher
  • 111
  • 2
  • 12