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

Re: Removing tags from working copy without subversion complaining?

From: Les Mikesell <lesmikesell_at_gmail.com>
Date: 2007-12-13 15:01:48 CET

Army Research Lab wrote:

>>> Part of my habits for making sure I don't break anything on my own code is
>>> to keep lots of tags of my entire working copy around as fallback positions.

I think you've missed the whole point of versioning. You can always get
back any revision you've ever committed, with or without a tag. Tags
just give you a name for reference instead of a number.

>>> I now have several hundred, which isn't a problem as the repository makes
>>> cheap copies (yay subversion!). The only problem occurs in the case of
>>> extreme user stupidity, like what I did yesterday... when I accidentally
>>> started a checkout of the entire tags directory (which, if I hadn't killed
>>> it, would have required several terabytes of space). My problem now is that
>>> if I use svn rm to get rid of the checked out files, they will be deleted
>>> from the repository, but at the same time, if I delete them using the file
>>> system, then subversion will complain that the files are missing. How do I
>>> clean the files out without subversion complaining to me?
>> Why can't you just delete the working copy you accidentally made?
>
> I can, but then subversion will complain that the version is missing, right?

No, subversion doesn't keep track of the checked out copies. If you
don't have any changes you need to commit, you can just delete it and
check out only the part you want.

> I want to keep the tags working copy nice and clean so that if I need to
> make a checkout to fallback to, it will always be easy.

You can go back revisions instead, and use tags only for real checkpoint
verions.

> Hmmm.... I can see I'm not being clear enough. Subversion currently has a
> problem with merging a revision into a tree twice in a row (this is supposed
> to be fixed in 1.5), which means I can't just go back to an old version and
> merge it into my (currently borked) working copy. To sidestep this problem,
> any time I feel like I've reached a semi-important point, I checkpoint it by
> tagging it. If I need to fallback, then I do the following:
>
> 1) svn rm the current working copy. This fixes the merge problem by making
> the merge go away. Commit that, which effectively terminates the working
> copy.

That makes the repository follow this change - that might be the reason
you aren't seeing a continuous history in your trunk. It is still
there, though.

> 2) checkout the last fallback I have into the working copy.

Check the book examples for how to go back to earlier revisions.
Conceptually, every revision is a cheap copy just like the tag.

> When I first started working with subversion, I didn't know enough about it
> to realize I could do this, which is why my working copy has branches, tags,
> and trunk as directories in it; I thought I'd have to check things out and
> then move them.

You can do that, but there isn't much point. You are only affecting the
  'head' view of the repository. Anything that has ever been committed
can be retrieved from its original location if you specify the revision.
And you can do copies, moves and deletes directly in the repository with
URLs as the source/target, but again it only affects the head view.

> I know better now, but still haven't cleaned up my working
> copy (maybe its time that I did!). The current problem is that since I
> checked out stuff into tags, if I simply delete it, then the next time I
> play in the tags directory (if I need to again, I may never need to),
> subversion will complain that something was deleted out of the tags
> directory without being "svn rm"ed. I want to make that kind of complaint go
> away, without using svn rm.

You should only get this complaint if you keep the working copy and
subsequently try to commit from it after. If you rm the whole thing
there can be no subsequent commits or complaints.

> I know that I can do so safely; the fact that
> the files are removed doesn't actually remove the history from the
> repository, so I can get the copy from one revision back, but I would like
> to clean it up so that I don't get complaints, if I can.
>
> Failing that, I'll just go ahead and do what I should have done a long time
> ago and clean up my working copy so I'll have checked out from trunk.

Just check out what you want to a different location to prove that you
can, then delete the old working copy. You can have as many checked-out
copies of the same or different parts as you want.

-- 
   Les Mikesell
     lesmikesell@gmail.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Dec 13 15:22:58 2007

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.