pictures

Undelete Something With SVN

hr
hr Heading 2 Icon Undelete Something With SVN

Ever delete something with svn (svn del) and then realize you needed it again? You can get it back by using: svn copy -r HEAD filenameyoudeleted.extension filenameyoudeleted.extension

svn copy is the command to get a working copy back
-r is short for revision. I used HEAD which will give you the latest in repository. You can specify a revision number, revision right before you committed, etc (check out svn help copy)
filename is what you deleted, then where it goes. I usually do something like this within the folder the file was located so you do not see any paths, but if your file was in /www/files/ you would need to specify the file path to /www/files/filnameyoudeleted.extension /www/files/filnameyoudeleted.extension

Working with SVN is a lifesaver - and this tip is gold.

HOWTO Change the SVN Editor

hr
hr Heading 2 Icon HOWTO Change the SVN Editor

Because I always forget…to change the text editor that svn uses with the commit messages, just type in this command (if you use bash):
export SVN_EDITOR=vi

*Substitute vi for your editor of choice.
**Personally, I once was a pico/nano fan, then I moved to emacs, and now I am a vi person.

Subversion File Status Reference

hr
hr Heading 2 Icon Subversion File Status Reference

Something that confuses a lot of people when they start using subversion is the file status. (svn st) Here is a quick list of the file status codes and what they mean:

A File was added
C Conflicting changes
D File was deleted
G File was merged
R File was replaced
U File was updated
? File is not under version control (you will need to add it)
! File is missing (probably was deleted using the OS or some other application and not subversion)

Switch Repositories (SVN)

hr
hr Heading 2 Icon Switch Repositories (SVN)

In order to take a look at WordPress 2.5 before it was released, I used subversion to check out the latest code available using the instructions given on the WordPress site. Once WordPress 2.5 was released, I wanted to keep my sites using 2.5 and not the bleeding edge releases (2.6) so I needed to easily switch repositories from http://svn.automattic.com/wordpress/trunk/ to http://svn.automattic.com/wordpress/branches/2.5/.
I had never had to switch repositories, so it took some reading to figure it out. For future reference, the following command works when used in the directory you have the checked out files in: “svn switch http://newrepos.com .” For my example, I ran the command: “svn switch http://svn.automattic.com/wordpress/branches/2.5/ .”

remove all .svn directories in a directory.

hr
hr Heading 2 Icon remove all .svn directories in a directory.

Anyone who uses subversion will need this sooner or later. Change directories to the root directory and run:
find . -name .svn -print0 | xargs -0 rm -rf. Bingo...all .svn directories are gone and you can start fresh!
[tags]subversion, svn[/tags]

svn revert.

hr
hr Heading 2 Icon svn revert.

There are some things I am very thankful for when I am working in PhotoShop...being able to navigate the history, the background eraser, the rounded corners tool, but there are sometimes when I fingers end up moving faster than my brain and save and close PSD files before I had the chance to undo a "merge down". Until a few months ago, I would end up swearing at this point and have to redo parts if not all of a graphic. Now, since my development files are in subversion, I can simply open the command line and revert the file to the previous state: svn revert /folder/filename.ext and all is ok. No swearing. Thanks subversion!
PS. I ordered DirectTV today. Bye bye Comcast!
[tags]subversion, svn revert[/tags]

apache 2.20, php 5, and mysql 5 on mac os x.

hr
hr Heading 2 Icon apache 2.20, php 5, and mysql 5 on mac os x.

After finally getting some to to set up my development environment, I began thinking...why am I not using Apache 2.2 and PHP 5.1.2? What made me think about this? "Legacy Release" The phrase "legacy release" is what httpd.apache.org described Apache 1.3.x as in their news section. I have been using Apache 1.x for several years now, only ever really thinking about migrating to 2.0 because of the need to run a subversion server. I have a solid web server solution in place that has made me very happy for the last few years using Apache 1.3.x, but it is finally time to check out something in the 2.x family, and I am going to make that 2.2. I am going to spend some time tomorrow reading about any known issues (especially with PHP, as I remember that being a show stopper for my interest in 2.0 before) and then install/configure it. Stay tuned for some tutorials on what I did to get everything up and running!
[tags]apache, php, mysql, subversion[/tags]


search

subscription information

Blog RSS

Comments RSS



Powered by FeedBlitz

blog categories

blog tags

most popular posts


blog archive

standards

Get Firefox!
XHTML
CSS