Subversion Tree Conflict: local delete, incoming edit upon update

Forgotten lesson: always run a SVN status check before commits/renames/deletes, or you risk wasting time and wishing you had.

Had a stunned look on my face for a while after trying to rename a folder in a subversion repository:

$ svn mv [old_folder] [new_folder]
[output marking old_folder as deleted and new_folder as added]

$ svn ci [old_folder] [new_folder]
Deleting        [old_folder]
svn: Commit failed (details follow):
svn: Directory ' [old_folder]' is out of date
svn: Your commit message was left in a temporary file:
svn:    'svn-commit.tmp'

$ svn up [old_folder]
   C [old_folder]
At revision ###.
Summary of conflicts:
  Tree conflicts: 1

$ svn status
?       [new_folder]
!       C [old_folder]
        >   local delete, incoming edit upon update

PBKAC

My brain cramp was induced by the terse error message: “local delete, incoming edit upon update”. The problem was, of course, between the keyboard and chair. I had not committed/updated [old_folder] before trying to rename it. The moral of the story is always run a status check first, so you don’t assume readiness for commits/renames/deletes/etc:

$svn status

Googling the answer (a.k.a the internet makes us soft)

The Googling that helped me to understand “local delete, incoming edit upon update” lead to this nice summary.

Cleaning up the mess I made

$ svn revert [old_folder]
Reverted '[old_folder]'

$ svn status
?       [new_folder]

$ svn add [new_folder]
[output marking new_folder as added]

$svn ci [new_folder]
[output for successful commit]

$ svn status
[no output - this is good]

Lesson re-learned

Phew, there’s a detour I hope to never take again, turned a 10-second task into about 30-minutes of head-scratching.