Subversion deletion annoyance
A brief detour from the Fedora/Dell posts...
Maybe there's something about me that's cursed, but it seems that the deletion functionality in Subversion is pretty broken. Pretty much every time I delete a directory, the repo gets out-of-sync, and I have to spend 10 minutes working out how to resolve something that should surely have worked properly first time.
Here's an example. I had a directory called dell in my personal notes archive, that contained a single file, that made more sense to be moved to a different directory in the repo. This was moved with no issues:
[john@sofia personal]$ svn mv dell/vodafone.txt dellmini10/
A dellmini10/vodafone.txt
D dell/vodafone.txt
[john@sofia personal]$ svn commit -m "moved some dell files around"
Deleting dell/vodafone.txt
Adding dellmini10/vodafone.txt
Transmitting file data ...
Committed revision 38.
Note that I wasn't even attempting to do anything particularly adventurous, such as deleting the directory in the same commit.
I then tried to get rid of this now-empty directory:
[john@sofia personal]$ ls dell
[john@sofia personal]$ svn rmdir dell
Unknown command: 'rmdir'
Type 'svn help' for usage.
[john@sofia personal]$ svn del dell
D dell
[john@sofia personal]$ svn commit -m "deleted empty dell directory from repo"
Deleting dell
svn: Commit failed (details follow):
svn: Directory '/dell' is out of date
WTF!?! (I hasten to add that no-one else is using this repo.)
There's then lots of random flailing around to try to coax it into working:
[john@sofia personal]$ svn up
C dell
At revision 38.
Summary of conflicts:
Tree conflicts: 1
[john@sofia personal]$ svn up dell
At revision 38.
[john@sofia personal]$ svn commit -m "deleted empty dell directory from repo"
svn: Commit failed (details follow):
svn: Aborting commit: '/data/personal/dell' remains in conflict
[john@sofia personal]$ svn stat
...
D C dell
> local delete, incoming edit upon update
...
[john@sofia personal]$ svn resolve --accept mine dell
svn: 'mine' is not a valid --accept value
[john@sofia personal]$ svn help resolve
...
[john@sofia personal]$ svn resolve --accept mine-full dell
svn: warning: Tree conflicts can only be resolved to 'working' state; 'dell' not resolved
[john@sofia personal]$ svn resolve --accept working dell
Resolved conflicted state of 'dell'
[john@sofia personal]$ svn status
...
D dell
...
[john@sofia personal]$ svn up
At revision 38.
[john@sofia personal]$ svn commit -m "deleted empty dell dir"
Deleting dell
Committed revision 39.
I guess the svn resolve --accept working {dir} did the trick, but I fail to understand why it was ever necessary. Guess I should really move to git or Mercurial...