Re: SVN - Reverting to an Earlier Version

"Eric Robertson" <[email protected]> Wed, 5 Aug 2009 18:25:07 +0100
Newsgroups gmane.comp.ide.komodo.general
Message-ID <1B5BA9A1689846839D95384B8038E864@Time>
  >-----Original Message-----
  >From: Todd Whiteman [mailto:[email protected]]
  >Sent: Wednesday, August 05, 2009 12:08 AM
  >To: Eric Robertson
  >Cc: [email protected]
  >Subject: Re: [Komodo-discuss] SVN - Reverting to an Earlier Version
  >
  >Eric Robertson wrote:
  >> I've been working on some CGI Perl files for a client in anticipation
  >of
  >> some changes that she wanted that affected one file in particular. In
  >> working on this I had noticed some things that weren't quite right with
  >some
  >> of the associated files and had changed them and committed these to my
  >SVN
  >> repository. The client has come back and asked that I make another
  >change
  >> first so I committed the changes in that file so that I'd not lose
  >them. I
  >> now want to change my working folder back to an earlier version of that
  >file
  >> without changing any of the others.
  >>
  >> I'm very new to subvention and its concepts and have studied the SVN
  >manual
  >> but didn't see any reference dealing with this sort of situation. It
  >seems
  >> that most of the commands I might have used deal with whole folders. I
  >> eventually used "svn merge -r HEAD:n .....", where n was the revision
  >number
  >> for the version of the file I wanted and restricted the merge to the
  >file I
  >> wanted to change. Was that the correct way of dealing with this
  >situation?
  >>
  >> Once I've got these changes made and tested I'll commit them. I then
  >want to
  >> introduce the changes I had made previously to that one file. Is merge
  >again
  >> the best command to use?
  >>
  >> I'm working alone on these files so don't have the complication of
  >others
  >> making changes to them.
  >
  >Yes, you have made the correct approach to reverting to a previous
  >version (using svn merge -r ...).
  >
  >Now the thing to note is that your still working at the latest svn
  >version, though you've now got local changes (a rolled-back commit). All
  >your other unmodified svn files are still at the latest version, whilst
  >the modified files should contain your latest changes minus the changes
  >made from the one (or more) commits you reversed.
  >
  >When you've changed things to how you like, you can then simply commit
  >the files (as you normally would for a change). The new committed files
  >will now be the latest version (i.e. the HEAD).
  >
  >Cheers,
  >Todd

Many thanks Todd for confirming that I followed the correct procedure for
reverting the file. I'm still a bit uncertain though about what I should do
when I've finished with the current changes and want to start on the other
ones.

Suppose that the HEAD is at r10 and I went back to r8 for this particular
file, which I did using the "svn merge -r ...". I think what you're saying
is that this file will still be at r10 in the repository, it's just the
working copy that was at r8 after the revert.

I've now altered this r8 working copy to deal with the current changes that
had to be made. If I do a straight commit of this altered r8 file will it
not just alter the copy in the repository to be exactly the same, and I will
have lost all the changes that I made to this file between r8 and r10? What
I want to do is to examine these r8 to r10 changes and retain them if
they're still compatible with my new altered r8 file. Perhaps there's no
easy way of doing this, and I just have to do a diff between r8 and r10, to
see what changes I did make, and then try and make similar ones to the
altered r8 file after I've committed it?

Regards
EricR


_______________________________________________
Komodo-discuss mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Other options: http://listserv.ActiveState.com/mailman/listinfo/Komodo-discuss