views:

206

answers:

2

I am new to tortoiseSVN - What is the best way to update the head from a revision?

+1  A: 

If you want to update your working folder with the latest (HEAD) revision from the repository then right click on the Folder and select 'SVN update'.

If you want to commit the changes you made locally to the repository, so that the HEAD revision will incorporate your changes then right click on the Folder and select 'SVN commit'.

Manu
Just on the off chance, what if the OP means 'update' in a non-SVN terminology fashion? How does he update local changes to the repository. By doing an Add (if new content) followed by a Commit. ;-)
Wim Hollebrandse
Only saying that because if OP is aware of 'SVN update', why ask the question?
Wim Hollebrandse
Manu, thats not what I mean. I had a feature that I was working on in the head of the repository. Now this feature takes longer then expected. Now I need to add another small feature to the project, which doesn't effect the "long feature". Now I created a branch for the "long feature" and updated the working directory from a revision which was before I started to work on the "long feature". Now I want this revision to be the head.
vikasde
+1  A: 

In your working copy, do a backmerge to a revision before the start of the work on the "long feature" and then commit.

Davide Gualano
Is that a simple "update to revision" in tortoise Svn? If yes, what happens to the future revisions that are there - are they being deleted from the repository?
vikasde
If I remember well, when you select Merge from Tortoise there is a checkbox called "Reverse merge" to tell that you are backmerging (see http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-merge.html#tsvn-dug-merge-range). Nothing is deleted from the repository of course, you just add a new revision which contains your codebase without the "long feature" code.
Davide Gualano
But wont that change my current revision (the one without the long feature) with the changes from future revisions?
vikasde
I just tried it and it changed my code from the "long feature" with the one from the revision. I would like to avoid that. Is there a way?
vikasde
Let's say you started the long feature in revision 100 and that you branched the long feature out in revision 110, that is now the HEAD. You checkout a working copy from the trunk (at revision 110), backmerge it with revision 99 and commit: you have now revision 111 without the long feature code. The code in the branch with the long feature is not affected.
Davide Gualano
That did it. Thanks Davide
vikasde
You are very welcome :)
Davide Gualano
You should probably mark Davide's answer as accepted. This way he'll receive the reputation and it'll be clearer what the question was.
Manu
I did. Thanks Manu.
vikasde