Search posterous

Search all posts and users. Type a name, type a favorite song title, whatever! See what comes up.
  

More posterous blogs











More recommended blogs »

Here are posterous posts filed under svn...

mlevit says...

WARNING: The following article is written from a very high level point of view with assumptions made in areas like product knowledge and computer literacy.

After working on many coding projects I had come to realise there is one tool that is indispensable for any coder... what I'm talking about is version control. You come to realise that after making so many changes to your code you need the ability to track these changes and in case of emergencies revert to previous working versions of a particular file. I used this same concept for work and implemented my own version control.

Subversion

I installed a local copy of Subversion on my work laptop and with the help of TortoiseSVN I started my own local SVN repository. Because I'm super nice I'll even include lifehacker's instructions on how to setup your Subversion.

Setting up your Subversion server

  1. Download and install Subversion 1.3.2 (the svn-1.3.2-setup.exe download). Again, just accept all of the defaults in the setup, making sure that "Install and configure Subversion modules..." is checked.
  2. Download and install TortoiseSVN (TortoiseSVN-1.3.5.6804-svn-1.3.2.msi), an attractive Subversion client for Windows that makes dealing with Subversion repositories a breeze via right-click.
NOTE: With the above download links please be aware that Subversion is now up to version 1.60 and TortoiseSVN is up to version 1.66. Just do a little browsing to find the latest versions.

Create your first repository

The last thing we're going to do this week is create our repository. Go to your C:\ drive, right-click the svn folder and select TortoiseSVN -> Create repository here... command. If all goes well, TortoiseSVN should ask you what type of repository you'd like to create. Select Native filesystem (FSFS) and click OK. You will get a message telling you that "The Repository was successfully created." Congrats!

Finally, let's import the directory of files that you want to keep under version control into your newly-minted repository. Right-click on your to-be-controlled folder and select TortoiseSVN -> Import.... You need to give TortoiseSVN the directory of your repository, so browse for C:\svn. Click OK and all of the files under your chosen directory will be imported into your Subversion repository at C:\svn.

... you can verify that everything worked by right-clicking on a new folder and checking out your files from the repository (right-click -> SVN Checkout...). Just direct TortoiseSVN to the directory of your Subversion repository.

via lifehacker.com

So after the setup all you have to do is start using the folder you have used for checkout as your main work folder. Organise it as you wish with folders and files. Whenever you feel like "saving" your progress Right Click the main folder > SVN Commit. You will be prompted with a text area where you can write your comments on the files you are about to commit and below that a box with all the new/changed files. Committing this will transfer all the files/changes to the repository for storage and visioning.

Dropbox

Now we get to the part about Dropbox. Again instead of explaining everything about Dropbox I'll let my friends at lifehacker help out.

Windows/Mac only: Freeware application and web service Dropbox instantaneously backs up and syncs your files over the internet and to any computer. After you install the application, it will create a Dropbox folder on your hard drive. Any file you put inside that folder will automatically be synced and monitored for changes, and each time a change is saved, it backs up and syncs the file again. Even better, Dropbox does revision history, so if you accidentally saved a file and wanted to revert to an old version or deleted a file, Dropbox can recover any previous version. See the video above for a full demonstration.

Any file that's synced with Dropbox is available on any computer you sync it to or through the Dropbox web interface. During the beta, Dropbox is limited to 2GB of storage space and syncing. The software and service will remain free of charge, but if you need more than the 2GB, premium accounts will be available. 

via lifehacker.com

So now that we have Dropbox covered we can continue. What I realised not too long ago was when you add files to your Subversion repository, the files don't just get copied over and stored, they get compressed. Therefore using up much much less space than they normally would. As an example, my Subversion repository is approximately 950MB but my work folder is 7.32GB.

This brings me nicely to my next point. Instead of making Dropbox backup my work folder I let it backup my Subversion repository. It's way smaller and has every version of every file/folder I have ever put in and/or changed. It's beautiful, it works and it's the perfect way to manage/backup your work files.

NOTE: Obviously this concept has many uses and can be implemented for a range of other management/backup purposes other than work.

If you have any questions please don't hesitate to ask me. If you need help with any of the programs I mentioned in this post please let me know.

Thanks

Edit (10:23am 19/11/2009): Changed the work folder size from "over 5GB" to exactly 7.32GB after checking its actual size.

Filed under: svn

fotis says...

Subversion server (svnserve) on Mac OS X

Monday, 4th August 2008 - 3:14am (AEST)
Permalink#Comments(13) • Categories: Apple computing, Programming/development

There's an absence of information on how to get a Subversion server running on Mac OS X, and what information there is on the web gives the impression that it's difficult. It's not.

I used to run an application called Mac SVN Server - MAS, a standalone app with Apache and a Subversion server all built in, by Uli Kusterer. You just run it and you have an instant web based svn server. But it's all packaged up, meaning it's not that easy to upgrade to new versions of svn, and is pretty heavy weight considering it's an entire Apache 2 web server.

Instead, contrary to what most web sites seem to say, you can just run svnserve, the Subversion custom server component with Mac OS X. Here's how I did it:

  1. Download the Subversion package from Martin Ott's .mac page and install it on the Mac running 10.5 (Leopard) or later, that you're going to use as your Subversion server. This includes the svn client and the server. It's a standard Mac package installer, so just run it and you're done. All the binaries will end up in /usr/local/bin.
  2. Create a directory for your repository. Use mkdir /Users/defaultuser/svn, or if you need to, use sudo mkdir /Users/defaultuser/svn, where defaultuser is the user which the OS X boots into by default.
  3. Create your repository. Use sudo svnadmin create /Users/defaultuser/svn. Check the directory to make sure it has correct ownership for defaultuser, and if not do a sudo chown -R /Users/defaultuser/svn to set it correctly.
  4. If you have a repository from another Subversion server then you can simply copy it over the top of the new directory, and it will work fine, so long as the repository version is supported. For Subversion 1.5, it will also support a 1.4 repository. I copied my old 1.4 repository from MAS, and it's worked perfectly. You may need to do another chown to make sure the ownership is correct.

The server is now installed. To run it, simply log in as the default user and run the server with svnserve -d -r /Users/deafultuser/svn. You can now access it from any client (1.4 is built into Mac OS X 10.5 so no need to install the client anywhere) by doing a standard svn check out: svn co svn://ipaddress-of-svnmac/repositorypath

But instead of running it manually, we can run it automatically when the server Mac starts up by using launchd. You can read up on Getting Started with launchd, but basically it's the new startup process in Mac OS X 10.4 (Tiger). So, to start svnserve automatically, create the file /Library/LaunchDaemons/org.tigris.subversion.svnserve.plist, and put the following in it:

    
        Disabled
        
        Label
        org.tigris.subversion.svnserve
        UserName
        defaultuser
        ProgramArguments
        
            /usr/local/bin/svnserve
            --inetd
            --root=/Users/defaultuser/svn
        
        ServiceDescription
        Subversion Standalone Server
        Sockets
        
            Listeners
            
                
                    SockFamily
                    IPv4
                    SockServiceName
                    svn
                    SockType
                    stream
                
                
                    SockFamily
                    IPv6
                    SockServiceName
                    svn
                    SockType
                    stream
                
            
        
        inetdCompatibility
        
            Wait
            
        
    

This automatically starts the server when it boots. It also switches it from a standalone daemon to running under inetd, but it makes no real difference. There are a lot of different versions of this plist out there, but this is the only one I got to work. Unfortunately I can't remember the site I borrowed it from. Email me if it's you.

You're done.

Note that the UserName property defines the user to runs svnserve as, but launchd only allows this property when it is running as root. There are two launchds on the system, one running as root (process 1), and one running as each user. The one running as root loads its plists from /Library/LaunchDaemons.

If you found this blog post useful, then please consider sending me a couple of bucks PayPal donation to help cover my hosting expenses.

Filed under: SVN

bibale says...

Bibale was started roughly a year ago.

Today I though it would be interesting to share some of the stats
generated by StatSVN on the Subversion repository that hosts Bibale's
source code.

These statistics do not include code generated by thrift.

         
Click here to download:
Bibale_Code_Statistics_tags_sv.zip (92 KB)

Filed under: svn

Quân says...

Create a Repository
svnadmin create /path/to/repository

Create the Basic Directory Structure
svn mkdir -m "created default directory structure" repository/trunk repository/tags repository/branches

Import Project
svn import project_dir repository_dir -m "First Import"

Checking Out a Project
svn co repository_dir project_dir

Adding New Files and Directories
svn add file_or_dir_name

Deleting Files and Directories
svn delete file_or_dir_name

Committing Changes
svn ci -m "Saving recent changes" project_dir

Updating Your Local Files
svn up

Tagging Projects
svn copy -r 11 repos/trunk repos/tags/0.1.0 -m "Tagging the 0.1.0 release of the project"

Ignore
svn propedit svn:ignore cache

Filed under: svn

Paul says...

To my grave annoyance Subversion's svn:ignore property is not recursive.
This means that I either have to remember to repeat svn propset
ignore
for every directory every time I create one, or I have to
run:

svn propset -R svn:ignore . -F svn-ignores 

Which recursively sets the ignore property but makes for a change that 
has to be committed on every single directory. This gets very confusing
when working with the same project on more than one machine: if I set
the ignore property on a directory, try to check in, realize I have to
update, update, and check in again, the ignore property changes back
without my realizing it. Obnoxious is the word, rather than confusing.
I try to maintain an svn-ignores file in the base directory &
only set ignore properties by reading it  in, which mostly 
prevents these kinds of mistakes, but there has to be a better way.

Filed under: svn

Pykler says...

Doesn't it bug you when you see commit messages that say 'Updated my code to have this cool new feature', I am going to confess I do that too. However, it makes no sense. Ofcourse the code was updated, if it wasn't then you wouldn't have anything to checkin.  Similarly, 'Added a new feature to do X Y Z' is anoying. You can probably come up with millions of annoying commit messages. A better alternative would simply say 'X Y Z', if your in the habbit of formatting your commit messages (which you should), then maybe it would say.

X Y Z

Details:

    - X is explained as ... depends on ...
    - Y is a silly feature
    - Z is an ugly hack causes X and Y to be tightly coupled
    TODO: factor Z out

Since we are on the subject of commit messages, these should be coherent blocks. i.e. do not commit all your code under one commit with a messages 'Completed Development of the Application', one aspect of version control is to be able to go back in history and learn/remember what you have done. A second feature of version control, is to save your work, if you are waiting for your full application to be coded before you hit save, you have issues. So small edible byte sized commits are awesome, huge unmeaningful (sometimes hillarious, see http://github.com/jseutter/getoffmylawn for many examples of bad messages) are not.

Finally, since this is my first post about VCS, I should clarify my current situation. I am a mercurialist with hint of git. I am loving hg-git, and is hoping git-hub soon wakes up out of its coma. Bitbucket is shaping up though, and its currently looking awesome. Maybe its time for someone to write a git-hg plugin for git and return the favour. Oh and I think SVN is retarted (and you should use CVS if you want to decouple version from the control).

Filed under: svn

google: "config svn diff colorize"

in ~/.subversion/config set:
diff-cmd = colordiff

Install colordiff, unless already installed. In my case it was:
sudo aptitude install colordiff

Result is below:

Filed under: svn

jwwest says...

So you deleted a bunch of files, or moved things around and checked in a bad revision. You need to do a "reverse merge".

1) Revert to the last known good revision.
2) Do a svn merge -r HEAD:revision#
3) Commit.

In my case, I had deleted my local copy of trunk thinking I could get a copy of the last known good revision and commit that. Won't work. I had to update, reverse merge, then commit.

The beauty of source control is that as long as you have what you need checked in, you can always find a way to fix your boo boos.

Filed under: svn

The following dialog shows a list of options with a visual explanation of what's going on, including pre-requisites. That's how it should be!

Filed under: svn

月日长弓 says...

svn: Can't convert string from 'UTF-8' to native encoding

svn: Can't convert string from 'UTF-8' to native encoding
系统AS4中文版,执行 post-commit check out版本出现上述错误,解决的办法是在root权限下在任何目录下执行LANG="zh_CN.UTF-8"
这真是一个不是问题的问题,可能是为了方便将语言格式改成E文造成的

Filed under: svn