[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: a svn revert question

From: Thorsten Schöning <tschoening_at_am-soft.de>
Date: Fri, 8 Mar 2013 17:05:11 +0100

Guten Tag frame,
am Freitag, 8. März 2013 um 16:06 schrieben Sie:

> Let's say my project head is r130. We found a bug, started in r111.
> I want to do this: I want to fix r111, check in as r131. I also want
> to fix r130, checking as r132, the new head. How to do that?

The easiest way would not to do what you describe, but create a new
branch or tag by copying r111 to a different directory than your trunk
and fix your bug there and use that tag or branch for whatever reason
you have to fix the bug in your old revision.

Everything else is a bit more complicated as you can't commit on top
on an old revision. What you can to is revert your current work on a
file to an old revision, commit this as your new head and afterwards
fix the bug in the new head with the old source. Afterwards you need
to revert everything back to your initial head before you reverted to
the source of r111, commit and fix the bug again. You don't
necessarily need the commit between reverting the source and fixing
the bug, but with it it would be more clear what was needed to fix the
bug and is not part of the revert to fix the bug.

What you can't do is checking out r111 and commit directly on top of
this revision as you can only commit on top of head and in your case
r111 and r130 would surely differ in the same file you want to change.

This may help to understand the differences:

http://stackoverflow.com/questions/1214939/update-item-to-revision-vs-revert-to-revision

> Please don't criticize me on why not just fix r130 to become r131,
> the new head. Please just help on how to achieve what I want.

Nevertheless it would be good to know why you need to fix your old
revision, as one could recommend best practices, like using tags and
branches for those kinds of things.

> I think revert is somehow related, so I put it on the subject,
> since I don't know how to summarize my question.

revert is the wrong command, what you have to look at is update and
merge, but as I mostly use TortoiseSVN, I can't give you an example.

http://stackoverflow.com/questions/345997/better-way-to-revert-to-a-previous-svn-revision-of-a-file

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail:Thorsten.Schoening_at_AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/
Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04
AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow
Received on 2013-03-08 17:05:43 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.