How to recover from a failed update/merge?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to recover from a failed update/merge?

Bo Berglund
I have this multi-platform app in SVN thet I started in Windows but
lately have worked on in Linux.
The correct latest version is from Linux and I wanted to verify it on
Windows.

Everything is committed from Linux and the revision there is the
current one.

Now I made a mistake in Windows and don't know how to get out of it...
I had started the IDE and when checking the code I realized it was not
current, but the fact that I checked modified local files.

Next mistake, I went to the command line and did an svn up to get the
latest versions forgetting the IDE was still running, so it now
intervened and tried to be clever about the changing files.

Meanwhile svn started to offer some merge suggestions which I had
never done before and after a while I had this mess....


So now I need to get a clean slate on the source dir in Windows, i.e I
want to get the *repository revision* of all files in the source dir
and not bother with bogus changes made in the messup.

How should I proceed to get the wc in a state like after the last
successful update so it can now be updated to the repository head
revision?


--
Bo Berglund
Developer in Sweden

Reply | Threaded
Open this post in threaded view
|

Re: How to recover from a failed update/merge?

Lorenz-2
clean, nw check out
or revert + update
--

Lorenz


Bo Berglund wrote:

>I have this multi-platform app in SVN thet I started in Windows but
>lately have worked on in Linux.
>The correct latest version is from Linux and I wanted to verify it on
>Windows.
>
>Everything is committed from Linux and the revision there is the
>current one.
>
>Now I made a mistake in Windows and don't know how to get out of it...
>I had started the IDE and when checking the code I realized it was not
>current, but the fact that I checked modified local files.
>
>Next mistake, I went to the command line and did an svn up to get the
>latest versions forgetting the IDE was still running, so it now
>intervened and tried to be clever about the changing files.
>
>Meanwhile svn started to offer some merge suggestions which I had
>never done before and after a while I had this mess....
>
>
>So now I need to get a clean slate on the source dir in Windows, i.e I
>want to get the *repository revision* of all files in the source dir
>and not bother with bogus changes made in the messup.
>
>How should I proceed to get the wc in a state like after the last
>successful update so it can now be updated to the repository head
>revision?

Reply | Threaded
Open this post in threaded view
|

Re: How to recover from a failed update/merge?

Nathan Hartman
In reply to this post by Bo Berglund
On Mon, Aug 10, 2020 at 2:30 AM Bo Berglund <[hidden email]> wrote:
I have this multi-platform app in SVN thet I started in Windows but
lately have worked on in Linux.
The correct latest version is from Linux and I wanted to verify it on
Windows.

Everything is committed from Linux and the revision there is the
current one.

Now I made a mistake in Windows and don't know how to get out of it...
I had started the IDE and when checking the code I realized it was not
current, but the fact that I checked modified local files.

Next mistake, I went to the command line and did an svn up to get the
latest versions forgetting the IDE was still running, so it now
intervened and tried to be clever about the changing files.

Meanwhile svn started to offer some merge suggestions which I had
never done before and after a while I had this mess....


So now I need to get a clean slate on the source dir in Windows, i.e I
want to get the *repository revision* of all files in the source dir
and not bother with bogus changes made in the messup.

How should I proceed to get the wc in a state like after the last
successful update so it can now be updated to the repository head
revision?

So, if I understand correctly, you want to throw away *all* modifications in your working copy. In a situation like this, I would shut down the IDE so that it won't interfere, and from the topmost directory of the working copy, do:

$ svn revert -R .

That will recursively revert *all* local changes to versioned files and directories, including any changes you might want to keep, so always think very carefully before you use it!!

After reverting all changes, "svn status" should show no versioned files modified. You might still have unversioned local files. You'll need to decide whether to keep them or not.

Now, you should be able to "svn update" to get the latest repository revision.

Again, since a revert cannot be undone, always be careful with "svn revert" especially with "-R" (recursive)!!

Nathan

Reply | Threaded
Open this post in threaded view
|

Re: How to recover from a failed update/merge?

Bo Berglund
On Mon, 10 Aug 2020 09:52:51 -0400, Nathan Hartman
<[hidden email]> wrote:

>> How should I proceed to get the wc in a state like after the last
>> successful update so it can now be updated to the repository head
>> revision?
>
>
>So, if I understand correctly, you want to throw away *all* modifications
>in your working copy. In a situation like this, I would shut down the IDE
>so that it won't interfere, and from the topmost directory of the working
>copy, do:
>
>$ svn revert -R .
>
....
>
>Now, you should be able to "svn update" to get the latest repository
>revision.
>
>Again, since a revert cannot be undone, always be careful with "svn revert"
>especially with "-R" (recursive)!!

Thanks!
I used TortoiseSVN to revert the 7 changed files and then I did an
update and got the latest revision without the conflicts popping up!

I did not need the recursion because it was only files from a single
dir that were compromised.


--
Bo Berglund
Developer in Sweden

Reply | Threaded
Open this post in threaded view
|

Re: How to recover from a failed update/merge?

Nathan Hartman
On Thu, Aug 13, 2020 at 5:47 PM Bo Berglund <[hidden email]> wrote:
On Mon, 10 Aug 2020 09:52:51 -0400, Nathan Hartman
<[hidden email]> wrote:

>Again, since a revert cannot be undone, always be careful with "svn revert"
>especially with "-R" (recursive)!!

Thanks!
I used TortoiseSVN to revert the 7 changed files and then I did an
update and got the latest revision without the conflicts popping up!

I did not need the recursion because it was only files from a single
dir that were compromised.

Glad it helped. Thanks for confirming it solved the problem.

Cheers,
Nathan