You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Jeff Smith <js...@robotronics.com> on 2007/03/06 21:36:57 UTC

Re: reverting to several versions ago

On Saturday 20 January 2007 10:00, Steve Bakke wrote:
> > I assume your working copy also happened to have local
> > modifications to it. Therefore, Subversion did not delete the
> > directory.
>
> No.  'subdir1' was completely up-to-date with respect to the head. 
> So why does it show up as being scheduled for deletion?  What would
> happen if I had actually done a commit?

I assume you were simply ignoring what was modified (see below)

> While that makes sense, from an intuitive sense.  The original svn
> up -r left me with a mixed working copy.  I guess that because it
> is not a branch, 'svn status' will still report status relative to
> the head.  On the other hand, it seemed to make sense that I should
> be able to "undo" what I had just done by doing an 'update' back to
> the head revision since I didn't actually have something locally
> modified.  Does that make sense?  Maybe that argument falls apart
> when the directory in question didn't exist in that revision?  I'm
> just trying to get my head around how it is intended to behave.

I decided to test this, trying to duplicate Steve's likely problem. I 
started with no uncommitted mods. And Steve, I also show how to 
restore it. Also there is nothing to lose by attempting a commit, 
which would have had nothing to do. The 'D' reported from `svn up 
-r102 subdir1` is not scheduled, but only done to the WC.

# Here is my test WC
prompt> svn st -v wireless
               54       48  ?           wireless
               54       47  ?           wireless/.cdtproject
               54       47  ?           wireless/.project
               54       47  ?           wireless/LCDControl.c
               54       47  ?           wireless/serialpkt.h
               54       47  ?           wireless/rx
               54       47  ?           wireless/rx/error.h
               54       47  ?           wireless/rx/serialpkt.c
               54       47  ?           wireless/rx/serial.c
               54       47  ?           wireless/rx/FreeRTOSConfig.h
               54       47  ?           wireless/rx/serial.h
               54       47  ?           wireless/rx/motor.h
               54       47  ?           wireless/rx/vectors.c
               54       47  ?           wireless/rx/serialpktrx.c
               54       47  ?           wireless/rx/modrx.c
               54       47  ?           wireless/rx/Makefile
               54       47  ?           wireless/rx/motm_1.c
               54       47  ?           wireless/LCDControl.h
               54       48  ?           wireless/new1
               54       48  ?           wireless/new1/txt
               54       48  ?           wireless/new2
               54       48  ?           wireless/new2/test.c
               54       48  ?           wireless/new2/hi.txt
               54       47  ?           wireless/tx
               54       47  ?           wireless/tx/serialpkt.c
               54       47  ?           wireless/tx/modtx.c
               54       47  ?           wireless/tx/Makefile
               54       48  ?           wireless/plans.txt
               54       47  ?           wireless/Makefile

# I regress one of my folders to the point before it existed
prompt> svn up -r46 wireless
D    wireless
Updated to revision 46.

# It worked as I expected, "wireless" subtree was deleted from WC
# Therefore `svn up` restored to HEAD with no trouble

# I thought of a way to add undetected modification to the WC;
# created a file which svn is configured to ignore (serialpkt.h~)
prompt> cp wireless/serialpkt.h wireless/serialpkt.h~
# `svn st` still shows no modifications, unless showing ignored 
objects
prompt> svn st --no-ignore
I      wireless/serialpkt.h~

prompt> svn up -r46 wireless
D    wireless
Updated to revision 46.

# Commandline output looked the same, but the folder is left, and
# the unrev'd file "serialpkt.h~" is left in there
# Note: at this point, `svn ci` does nothing, and "wireless" is not
# a revisioned folder (contains no ".svn")
prompt> svn st
?      wireless
prompt> ls -a wireless
.  ..  serialpkt.h~

prompt> svn up
svn: Failed to add directory 'wireless': object of the same name 
already exists

# I also tried `svn revert .` or `svn revert wireless` but the only 
way was
# to relocate/delete the unrevisioned "wireless" folder
prompt> mv wireless wireless2
prompt> svn up
A    wireless
A    wireless/.cdtproject
A    wireless/.project
[snip...]
Updated to revision 54.

# now I can restore the unrev'd files
prompt> cp -r wireless2/* wireless
prompt> rm -r wireless2

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org