How to resolve "local edit, incoming delete upon update" message

Svn

Svn Problem Overview


When I do a svn status ., I get this:

!     C auto-complete-config.elc
      >   local edit, incoming delete upon update
!  +  C auto-complete.elc
      >   local edit, incoming delete upon update
!  +  C popup.elc
      >   local edit, incoming delete upon update
!  +  C fuzzy.elc
      >   local edit, incoming delete upon update

basically, these files shouldn't be in the repository. A developer has removed them. Then, I think I did a svn rm ... after the fact by mistake (should've done svn update . instead).

So now, when I do svn status ., I get these tree conflict messages.

I found the doc here but not sure how to “merge” it according to the doc.

How to get rid of them?

I think my working copy is in sync with the repository. Don't know why these messages shows. These files should be removed and are removed as far as I know everywhere. I tried svn update . and svn revert . but I still get this message when I do svn status ..

Svn Solutions


Solution 1 - Svn

Short version:

$ svn st
!  +  C foo
      >   local edit, incoming delete upon update
!  +  C bar
      >   local edit, incoming delete upon update
$ touch foo bar
$ svn revert foo bar
$ rm foo bar

If the conflict is about directories instead of files then replace touch with mkdir and rm with rm -r.


Note: the same procedure also work for the following situation:

$ svn st
!     C foo
      >   local delete, incoming delete upon update
!     C bar
      >   local delete, incoming delete upon update

Long version:

This happens when you edit a file while someone else deleted the file and commited first. As a good svn citizen you do an update before a commit. Now you have a conflict. Realising that deleting the file is the right thing to do you delete the file from your working copy. Instead of being content svn now complains that the local files are missing and that there is a conflicting update which ultimately wants to see the files deleted. Good job svn.

Should svn resolve not work, for whatever reason, you can do the following:

Initial situation: Local files are missing, update is conflicting.

$ svn st
!  +  C foo
      >   local edit, incoming delete upon update
!  +  C bar
      >   local edit, incoming delete upon update

Recreate the conflicting files:

$ touch foo bar

If the conflict is about directories then replace touch with mkdir.

New situation: Local files to be added to the repository (yeah right, svn, whatever you say), update still conflicting.

$ svn st
A  +  C foo
      >   local edit, incoming delete upon update
A  +  C bar
      >   local edit, incoming delete upon update

Revert the files to the state svn likes them (that means deleted):

$ svn revert foo bar

New situation: Local files not known to svn, update no longer conflicting.

$ svn st
?       foo
?       bar

Now we can delete the files:

$ rm foo bar

If the conflict is about directories then replace rm with rm -r.

svn no longer complains:

$ svn st

Done.

Solution 2 - Svn

Try to resolve the conflict using

svn resolve --accept=working PATH

Solution 3 - Svn

I just got this same issue and I found that

$ svn revert foo bar

solved the problem.

svn resolve did not work for me:

$ svn st
!  +  C foo
      >   local edit, incoming delete upon update
!  +  C bar
      >   local edit, incoming delete upon update

$ svn resolve --accept working
svn: Try 'svn help' for more info
svn: Not enough arguments provided

$ svn resolve --accept working .

$ svn st
!  +  C foo
      >   local edit, incoming delete upon update
!  +  C bar
      >   local edit, incoming delete upon update

$ svn resolve --accept working foo
Resolved conflicted state of 'foo'

$ svn st
!  +    foo
!  +  C bar
      >   local edit, incoming delete upon update

Solution 4 - Svn

If you haven't made any changes inside the conflicted directory, you can also rm -rf conflicts_in_here/ and then svn up. This worked for me at least.

Solution 5 - Svn

You can force to revert your local directory to svn.

 svn revert -R your_local_path

Solution 6 - Svn

So you can just revert the file that you deleted but remember, If you are working on any type of project with a set project file (like iOS), reverting the file will add it to your system folder structure but not your project file structure. additional steps may be required if you are in this case

Solution 7 - Svn

This issue often happens when we try to merge another branch changes from a wrong directory.

Ex:

Branch2\Branch1_SubDir$ svn merge -rStart:End Branch1
         ^^^^^^^^^^^^
   Merging at wrong location

A conflict that gets thrown on its execution is :

Tree conflict on 'Branch1_SubDir'
   > local missing or deleted or moved away, incoming dir edit upon merge

And when you select q to quit resolution, you get status as:

 M      .
!     C Branch1_SubDir
      >   local missing or deleted or moved away, incoming dir edit upon merge
!     C Branch1_AnotherSubDir
      >   local missing or deleted or moved away, incoming dir edit upon merge

which clearly means that the merge contains changes related to Branch1_SubDir and Branch1_AnotherSubDir, and these folders couldn't be found inside Branch1_SubDir(obviously a directory can't be inside itself).

How to avoid this issue at first place:

Branch2$ svn merge -rStart:End Branch1
 ^^^^
Merging at root location

The simplest fix for this issue that worked for me :

svn revert -R .

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionXah LeeView Question on Stackoverflow
Solution 1 - SvnLesmanaView Answer on Stackoverflow
Solution 2 - SvnzellusView Answer on Stackoverflow
Solution 3 - SvnsligockiView Answer on Stackoverflow
Solution 4 - SvnUdoView Answer on Stackoverflow
Solution 5 - SvnGordon MaView Answer on Stackoverflow
Solution 6 - SvnCWinelandView Answer on Stackoverflow
Solution 7 - SvnSaurav SahuView Answer on Stackoverflow