[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Accidental rename leads to harry mess...

From: Scott Palmer <scott.palmer_at_2connected.org>
Date: 2005-02-15 15:05:36 CET

Let me start by saying, I know that my own mistake caused this, um,
adventure. I was working with TortoiseSVN and the command line and
towards the end messing with files directly with windows explorer, I
may have missed something in the transcript that follows.

Subversion svnserve at v1.1.3 is running on the server side.
TortoiseSVN and command line svn were used on the client side (v1.1.2
TortoiseSVN, v1.1.3 command line I believe)

I was starting a new project and had added several files and subfolders
to my WC. I was coding away and decided I needed to move/rename a
file. My primary mistake, was in not using subversions move command
and only renaming the file within the local filesystem.

Then before committing I noticed the error after doing svn status:

C:\Dev\Carbon>svn st
...
A CarbonUI\src\ca\digitalrapids\carbon\laf\textfieldborder.png
! + CarbonUI\src\ca\digitalrapids\carbon\PlayPanel.java
A CarbonUI\src\ca\digitalrapids\carbon\clips
...

The "PlayPanel.java" file was copied from another branch in the
repository using TortoiseSVN with a WC->WC copy. Then I decided that
it needed to be renamed and moved to another subfolder and this
happened within my IDE without going through subversion. (I hadn't yet
hooked up the project in Eclipse to the subclipse plugin)

Stupidly, I thought to just commit what I had and look to any error
messages for hints, after all the commits are atomic, I can't screw
anything up, the entire transaction will simply fail. Then I can try
to work out the issues with the problem file later:

C:\Dev\Carbon>svn ci -m "initial UI work for Carbon"
Sending .
Adding CarbonUI
Adding CarbonUI\src
Adding CarbonUI\src\ca
Adding CarbonUI\src\ca\digitalrapids
Adding CarbonUI\src\ca\digitalrapids\carbon
Adding CarbonUI\src\ca\digitalrapids\carbon\PlayPanel.java
Adding CarbonUI\src\ca\digitalrapids\carbon\clips
...
Transmitting file data ............svn: Commit succeeded, but other
errors follow:
svn: Error bumping revisions post-commit (details follow):
svn: In directory 'C:/Dev/Carbon/CarbonUI/src/ca/digitalrapids/carbon'
svn: Error processing command 'committed' in
'C:/Dev/Carbon/CarbonUI/src/ca/digitalrapids/carbon'
svn: Error replacing text-base of 'PlayPanel.java'
svn: Can't open file
'C:/Dev/Carbon/CarbonUI/src/ca/digitalrapids/carbon/PlayPanel.java':
The system cannot find the file specified.

Whoa! I'm not sure how it even got past this:
  "Adding CarbonUI\src\ca\digitalrapids\carbon\PlayPanel.java"
How could it have *successfully* committed that file if now it can't
even find it!!!
Seeing this, I attempted to recover, by undoing my move/rename in the
filesystem to put the file back where subversion seemed to think it
should be.

Then I checked the status to be sure:

C:\Dev\Carbon>svn st
...
? CarbonUI\src\ca\digitalrapids\carbon\capture
? CarbonUI\src\ca\digitalrapids\carbon\ui
A CarbonUI\src\ca\digitalrapids\carbon\playlist
A CarbonUI\src\ca\digitalrapids\carbon\playlist\MediaPlaylist.java
...
A CarbonUI\src\ca\digitalrapids\carbon\laf\textfieldborder.png
A + CarbonUI\src\ca\digitalrapids\carbon\PlayPanel.java
A CarbonUI\src\ca\digitalrapids\carbon\clips
...

Looks good. Now this time I will tell subversion about the rename:
Looking back, I see now that I am already doomed.. I missed the fact
that the above commit was "successful" when I was actually doing this
the first time -- I mean how could it have been successful when an
entire file that was supposed to be part of the commit was missing?

C:\Dev\Carbon>svn move
CarbonUI\src\ca\digitalrapids\carbon\PlayPanel.java
CarbonUI\src\ca\digitalrapids\carbon\ui\TransportAndTrimPanel.java
svn: 'CarbonUI\src\ca\digitalrapids\carbon\ui' is not a working copy

Ah yes, stupid me, I can see that from the status output above. I will
just add that folder:

C:\Dev\Carbon>svn add CarbonUI\src\ca\digitalrapids\carbon\ui
svn: Working copy 'CarbonUI\src\ca\digitalrapids\carbon' locked
svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for
details)

Doh, oh well, I can follow instructions, cleanup it is:

C:\Dev\Carbon>svn cleanup

Hmmm.. no output... Must have worked :), I'll add that 'ui' folder
now:

C:\Dev\Carbon>svn add CarbonUI\src\ca\digitalrapids\carbon\ui
A CarbonUI\src\ca\digitalrapids\carbon\ui
A CarbonUI\src\ca\digitalrapids\carbon\ui\GuiImages.java
A CarbonUI\src\ca\digitalrapids\carbon\ui\GuiText.java

Perfect, everything seems to be back to normal....
Now I can move that PlayPanel.java file:

C:\Dev\Carbon>svn move
CarbonUI\src\ca\digitalrapids\carbon\PlayPanel.java
CarbonUI\src\ca\digitalrapids\carbon\ui\TransportAndTrimPanel.java
svn: Use --force to override this restriction
svn: Move will not be attempted unless forced
svn: 'CarbonUI/src/ca/digitalrapids/carbon/PlayPanel.java' has local
modifications

Well, yes it DOES have modifications, being a java source file I had to
change the package declaration to move it to the new folder properly.

At this point I give up on doing the rename before I commit. It looks
like subversion is having trouble tracking the changes without an
intermediate commit, ok...

C:\Dev\Carbon>svn ci -m "initial UI work for Carbon"
Sending CarbonUI\src\ca\digitalrapids\carbon\PlayPanel.java
Adding CarbonUI\src\ca\digitalrapids\carbon\clips
Adding CarbonUI\src\ca\digitalrapids\carbon\clips\AudioClip.java
Adding CarbonUI\src\ca\digitalrapids\carbon\clips\Clip.java
Adding CarbonUI\src\ca\digitalrapids\carbon\clips\GfxClip.java
Adding CarbonUI\src\ca\digitalrapids\carbon\clips\MediaClip.java
Adding CarbonUI\src\ca\digitalrapids\carbon\clips\VideoClip.java
Adding CarbonUI\src\ca\digitalrapids\carbon\laf
Adding
CarbonUI\src\ca\digitalrapids\carbon\laf\GradientPainter.java
Adding CarbonUI\src\ca\digitalrapids\carbon\laf\SynthTest.java
Adding CarbonUI\src\ca\digitalrapids\carbon\laf\carbonlaf.xml
Adding (bin)
CarbonUI\src\ca\digitalrapids\carbon\laf\textfieldborder.png
Adding CarbonUI\src\ca\digitalrapids\carbon\playlist
Adding
CarbonUI\src\ca\digitalrapids\carbon\playlist\GfxPlaylist.java
Adding
CarbonUI\src\ca\digitalrapids\carbon\playlist\MediaPlaylist.java
Adding
CarbonUI\src\ca\digitalrapids\carbon\playlist\PlayListTableModel.
java
Adding CarbonUI\src\ca\digitalrapids\carbon\ui
Adding CarbonUI\src\ca\digitalrapids\carbon\ui\GuiImages.java
Adding CarbonUI\src\ca\digitalrapids\carbon\ui\GuiText.java
Transmitting file data .....svn: Commit failed (details follow):
svn: File already exists: filesystem
'E:/Data/R&D/Subversion/repository/db', transaction '501-1', path
'/Carbon/trunk/CarbonUI/src/ca/digitalrapids/carbon/clips'

Huh??? How on earth did this happen? The 'clips' folder was never
directly involved in anything "dumb" that I did.
Ah yes - that "successful" commit from a few steps back. Unfortunately
when updating the WC subversion lost track of the bits that truly were
successfully committed. Perhaps Subversion shouldn't have stopped when
it encountered the error with the PlayPanel.java file, it never clued
in to the state of the other files and folders.

At this point my WC was totally hosed. It seemed to know that
"/Carbon/trunk/CarbonUI/src/ca/digitalrapids/carbon/clips" was
committed to the repository at r501. But if I deleted that folder from
my WC and did an update that folder would not get re-created.

C:\Dev\Carbon>svn up

Fetching external item into 'Helpers'
External at revision 501.

Fetching external item into 'Libs'
External at revision 501.

At revision 501.

C:\Dev\Carbon>svn move
CarbonUI\src\ca\digitalrapids\carbon\PlayPanel.java
CarbonUI\src\ca\digitalrapids\carbon\ui\TransportAndTrimPanel.java
A
CarbonUI\src\ca\digitalrapids\carbon\ui\TransportAndTrimPanel.java
D CarbonUI\src\ca\digitalrapids\carbon\PlayPanel.java

C:\Dev\Carbon>svn up

Fetching external item into 'Helpers'
External at revision 502.

Fetching external item into 'Libs'
External at revision 502.

At revision 502.

The revision bump you see there was a result of a commit done through
TortoiseSVN while I was frantically trying to get the WC back to a save
state.

Other folders were in a similar state as the 'clips' folder. I
eventually recovered by essentially creating a new WC.. but there was a
bit of fiddling that didn't go well involving renaming folders in the
WC, deleting .svn folders, etc. anything to try to get the existing WC
to update properly or get into a sane state somehow. I was frustrated
at this point so I lost track of exactly what I did.

So without ever mucking about in the .svn folders or any nasty stuff
like that, it is fairly easy to totally hose things so subversion
starts acting screwy. I'm hoping that Subversion can be made to handle
this a bit better. Realizing that I made some mistakes, I think
Subversion should have been more resilient to them and produced better
error messages.

Subversion should know when the structure of the WC doesn't match the
data in the .svn folders and 1) be much more clear with the error
message, 2) not let me get things so twisted such that the repository
has SOME of the folders from the WC, that won't get copied to the WC on
an update, 3) don't bail out so early after the "successful commit"
when updating the .svn folders... everything that can be updated
successfully in the .svn folders should be updated. Only the bits that
HAVE to fail should fail, e.g. my 'clips' folder shouldn't have been
hosed in the WC - just the one PlayPanel.java file.

This is the second time I've managed to do something like this.
Basically all starting from a move operation that I forgot to do
through subversion.

Scott

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Feb 15 15:07:48 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.