Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent myself from updating my svn working copy

Tags:

svn

Assume I have a working copy of a project versioned with svn. For a particular reason I want to keep a particular revision x of that project as my working copy. But sometimes I'm clumsy and I accidentally do an svn update to the latest revision y>x. Is there an easy way, to prevent svn updates on a working copy, like disabling the update command or something? Thanks.

like image 592
Christian Avatar asked Nov 10 '10 12:11

Christian


People also ask

What is svn working copy?

A Subversion working copy is your own private working area, which looks like any other ordinary directory on your system. It contains a COPY of those files which you will have been editing on the website.

How does svn update work?

svn update brings changes from the repository into your working copy. If no revision is given, it brings your working copy up-to-date with the HEAD revision. Otherwise, it synchronizes the working copy to the revision given by the --revision option.

How do I find my svn working copy?

Use the command line svn client or your favorite SVN client (TortoiseSVN, for example). Your local copy of the project is called a working copy in Subversion and you get it by issuing the command svn checkout <URL> where <URL> is a repository URL.

Does svn update overwrite local changes?

Subversion is pretty smart about updating and never just overwrites files that have local changes with copies from the repository. The most important thing to take away from this section is: If you collaborate with others on one repository, remember to update your working copy regularly.


2 Answers

If you checkout with 'svn export' rather than 'svn checkout' you'll get a copy without all the .svn info. That will stop you doing svn update since it's not a working copy at all.

It will also stop you doing "svn anything" on that tree (at least not without some gymnastics to make it a valid svn checkout)

Is that any good?

like image 182
Spacedman Avatar answered Sep 26 '22 23:09

Spacedman


You could make a branch. More info on branching and merging can be find here.

With a branch you can work all you want and doing svn-up will do anything since no one should be commiting to yout branch. Then, after all the work is done you just merge your work with the trunk

This should be best over exporting all the code from version control, since well, you just lose version control..

like image 21
mcabral Avatar answered Sep 24 '22 23:09

mcabral