Dave Horner's Website - Yet another perspective on things...
Home Tech Talk Programming Thoughts on CVS / SVN / hg / git and other versioning systems
73 guests
Rough Hits : 2998421
moon and stars
how did u find my site?





 
this website would be better without ads?!




 
The purpose of computing is insight, not numbers.
Richard Hamming

Thoughts on CVS / SVN / hg / git and other versioning systems

Friday, 22 July 2005 08:33

SVN

TortoiseSVN - this program allows you to pull data in and out of a SVN repository from Windows Explorer. If I'm going to have to access a CVS server, I install the project TortoiseCVS which accomplishes the same thing for CVS servers.
Using TortoiseSVN you can even access Team Foundation Server (TFS)
SvnBridge - Use TortoiseSVN with Team Foundation Server - Release: SvnBridge v2

Download Subversion | Slik SVN - all the command line tools including things like svnsync.
When doing diffs on files, I really like to install the tool WinMerge. WinMerge is a visual diff. system. Very pretty, and I love the icons and hotkeys.



Ok, so CVS has some issues. It doesn't support revision history on renames and moves which is a big problem. It is also lacking some of the new features found in other enterprise SCM systems. CVS is also hard to secure, difficult to go back to a repo state without tagging often, and branching and merging isn't great. SVN (subversion) fills most of the holes found in CVS. For a little more information and another person's point of view read this.


The best place to get information on how to use SVN may be found in the SVN Book

Also here is some info on setting up SVN on windows.

If you are looking for a change log maker, checkout: svn2cl: Subversion ChangeLog generator

SVN Building notes

SVN ./configure --with-ssl --with-apxs
For bindings you'll want to install Swig
After install for SVN Python bindings do a "make swig-py" then do a "make install-swig-py", then you need to watch where it sticks the new python library and add it to your python env. Example: echo /usr/local/lib/svn-python/libsvn > /usr/lib/python2.2/site-packages/subversion.pth

Install/Admin SVN

To create a SVN repo either use your distributions packaged SVN binaries or download and install SVN packages
Once you get it installed check out this page on adding projects to an existing SVN repository in the book. [Here]

Migrating from CVS to SVN

Most people have CVS servers that need to be imported into the new SVN system. Try using CVS2SVN, read the docs here.

CVS2SVN is very easy to use. To convert an existing CVS repository to SVN.  Use the following command:
cvs2svn --dumpfile path/to/dumpfile /path/to/cvsrepo
Add the option '--trunk-only' if you don't want to save off the tags and branches.

CVS2SVN creates a dumpfile that you can import using svnadmin.
Then use the command:
svnadmin create /path/to/svnrepo svnadmin load /path/to/svnrepo < cvs2svn-dump
This will add the module projectA from your dump file into the SVN repository specified.  This will create a bunch of directories in your repository that you will want to restructure... then just use the normal 'svn move' and 'svn delete' commands.

When setting up apache remember to use a location that isn't already exported in another web accessible directory. Apache can get confused on who should handle the request (svn or straight apache) It's a real pain to figure out!
For your web viewing pleasure try using ViewCVS it works for both SVN and CVS.
A great addon to SVN (a little more complex than ViewCVS) is Trac it provides bug tracking, wiki, and web access.


Convert existing SVN repository from Berkeley DB to FSFS

Using the berkeley db can sometime lead to issues when moving from machine to machine. FSFS doesn't have these problems. Here are the steps I did to convert my existing bdb svn repos to fsfs.
Create dump files from existing svn directories.
for i in *; do svnadmin dump $i > $i.dump; done
Create tar file to transfer to new host.
tar cfvz svn.tar.gz *.dump
Transfer and extract somewhere, then we create new repos of fsfs type for each dumpfile.
for i in *.dump; do svnadmin create ${i%%.*} --fs-type fsfs ; done
Load the dump file into the newly created repo.
for i in *.dump; do cat $i | svnadmin load ${i%%.*} ; done

Email Hooks for commit changes

I've used CVSSpam for cvs commit diff logs. They are awesome, with html color'd diffs sent right to your email. Well, at this time, CVSSpam doesn't have support for SVN. Until then, there is SVN-Notify to fill the gap (Author's Page).

After installing SVN-Notify, you must create a post-commit script that actually uses the new script.
Scripts are easy to install, just go to your SVN directory and you'll find a hooks directory. Add an executable file named "post-commit".
Note you'll want to make sure you install HTML::Entities if you want the HTML formatted color diffs in your emails.
#!/bin/sh
# POST-COMMIT HOOK
# The post-commit hook is invoked after a commit.
#   [1] REPOS-PATH   (the path to this repository)
#   [2] REV          (the number of the revision just committed)
/usr/bin/svnnotify --repos-path "$1" --revision "$2" --to "
  This e-mail address is being protected from spambots. You need JavaScript enabled to view it
 " --from "
  This e-mail address is being protected from spambots. You need JavaScript enabled to view it
 " --reply-to "
  This e-mail address is being protected from spambots. You need JavaScript enabled to view it
 " --subject-prefix "[SVN PREFIX]" --subject-cx --svnlook 
/usr/local/bin/svnlook --sendmail /usr/sbin/sendmail --viewcvs-url 'https://yourpathtoviewcv/viewvc.cgi?root=ossim&rev=%s&view=rev' 
--handler Alternative --alternative HTML::ColorDiff --with-diff

SVN User tasks

Use TortoiseSVN to access SVN repos from your windows explorer.

Keyword substitution
Does Subversion have a keyword which behaves like $Log$ in CVS?

I also found this:
From: Mark Phippard from the subclipse user group.
Date: 2005-02-27 18:20:11 CET
Read this:
http://svnbook.red-bean.com/en/1.1/ch07s02.html#svn-ch-7-sect-2.3.4
The gist of it is that you have to specifically tell Subversion what
keywords you want to use by specifying those keywords in the svn:keywords
property on the file. Subclipse has a Team -> Set Keyword action that
makes it easy to set these properties on the files. You will need to
commit the prop changes before you see anything in the file.
If you read further down in that same section of the document, it will
describe auto-properties. This is a way to have the svn:keywords property
set when files are initially added/imported.
Subversion does not support $Log$ and probably never will as the core
developers seem opposed to it. I am sure they might consider a
well-implemented patch. You can read the mailing list archives for past
discussions on this.
http://www.google.com/search?as_q=%24Log%24&as_sitesearch=svn.haxx.se
Mark

Ok, well it looks like autoprops isn't the right solution either.  Autoprops works by configuring the SVN client on each machine.  This is no good because it means that each developer has to configure their client properly to ensure the properties are set correctly.

The way I guess I'll handle it now, is by running the propset commend on all the files I want keyword subs on.  Below is a sample of what I run on a working directory.  Note, you must do a svn commit before such properties are in the repo.
find . -name "*.cpp" -exec svn propset svn:keywords "Date Author Revision HeadURL Id" {} \;
find . -name "*.h" -exec svn propset svn:keywords "Date Author Revision HeadURL Id" {} \;
find . -name "*.c" -exec svn propset svn:keywords "Date Author Revision HeadURL Id" {} \;

Artistic Style
indent

Setting up and using TRAC

Trac is a project that provides wiki,timeline,roadmap,bug tracking, and other features for SVN.

Synchronizing SVN

Synchronizing a SVN is useful for keeping a local copy of all the changes that took place in the repo.
svnsync is a tool for creating and maintaining read-only mirrors of
subversion repositories. It works by replaying commits that occurred
in one repository and committing it into another.

using svnsync

One of the great reasons for using SVN is that SVN allows for greater knowledge about the current state of the code to all developers in the project. Using tools like SVN-Notify and CIA you can really keep a developer community aware of what is happening.

Developing with SVN

I'm very interested in using SVN within my code.
SvnCpp C++ API
Mac OS X Packages - Subversion - fink's svn client doesn't include ssl support. These packages work for me. You will also need to make sure /usr/local/bin is in your path after install.


perl-SVK - A Distributed Version Control System
Painless Merging with SVK: An Interview with Chia-liang Kao
Version Control with SVK
Merging is the key to software developer collaboration


git

Git - Fast Version Control System
msysgit - Google Code project which officially supports git distributions using MinGW/MSys for win32!
A tutorial introduction to git (for version 1.5.1 or newer)
Git - SVN Crash Course
An introduction to git-svn for Subversion/SVK users and deserters
Linus Torvalds on GIT and SCM
The official site: Git - Fast Version Control System
Git Guide
Using Git for Samba Development
git for WindowsInstall wiki page
SourceForge.net: Git Extensions - shell extension will integrate in Windows Explorer and presents a nice context menu on files.
Secure source code hosting and collaborative development - GitHub scie.nti.st » Hosting Git repositories, The Easy (and Secure) Way
Dulwich is a pure-Python implementation of the Git file formats and protocols. Dulwich Tutorial
A successful Git branching model » nvie.com which is related to nvie's gitflow at 0.2 - GitHub.
Git Workflows Book – Yan Pritzker
Gazler/githug - Git Your Game On
icefox/git-achievements - Aquire achievements while using git.
rsms/gitblog - Git-based blog/cms for PHP, meant as a replacement for Wordpress
GITLAB: Self Hosted Git Management Application
Prose · A Content Editor for GitHub
Learn Git Branching - designed to help beginners grasp the powerful concepts behind branching when working with git.
Tailor Code Editor - Tailor is a testing and demonstration platform for a pure javascript Git workflow implemented using the open source (MIT License) ryanackley/git-html5.js Tailor Chrome app
Conversational Git – Conversational Git
git ready » learn git one commit at a time
Git is a framework for creating a Version Control System - Girders
nvie/gitflow - collection of Git extensions to provide high-level repository operations for Vincent Driessen's branching modelA successful Git branching model » nvie.com
Why aren't you using git-flow? – Jeff Kreeftmeijer


Git Submodules: Adding, Using, Removing, Updating :: Chris Jean

undo git add

use "git rm --cached ..." to unstage.
version control - Undo 'git add' before commit - Stack Overflow


Ignore chmod changes in GIT

git config core.filemode false

File system versioning

I love the idea of having file systems with version control automagically!
FSVS - think of it as some kind of tar or rsync with versioned storage.


Distributed revision control

Distributed revision control
Mirroring Subversion with Darcs and Tailor

Mercurial (hg)

Mercurial Wiki
A Guided Tour of Mercurial
Converting single/multiple SVN repos to Hg repos
zzsergant / HgSccPackage / wiki / Home — bitbucket.org - HgSccPackage is a source control package for MS Visual Studio 2008/2010 for Mercurial version control system. (Sergant's Home Page)

To install mercurial and hgsvn on Mac using fink, do the following:
fink install mercurial-py25
fink install setuptools-py25
# wget http://peak.telecommunity.com/dist/ez_setup.py
# python ez_setup.py install
# easy_install hgsvn
sudo easy_install-2.5 hgsvn
This installs python 2.5 and an X11 system as deps.

Here are the steps I take when converting to hg from svn
hgimportsvn http://svnserver/path
cd path
hgpullsvn
Refactor the Life » Blog Archive » HOWTO setup the Mercurial with Nginx in CentOS 4

Doing quick visual diffs are a must. hg diff just doesn't cut it. Here are the steps needed to setup WinMerge for visual diffs with hg.
1. Install WinMerge.
2. Add the following to your .hg/hgrc.
[extensions]
extdiff=
 
[extdiff]
cmd.winmerge = c:\program files\winmerge\winmerge.exe
opts.winmerge = /r /e /x /ub
3. Run hg winmerge [path optional]


Here is a quick script to run when updating remote SVN code to hg.
hgpullsvn
Mercurial hosting — bitbucket.org
Kiln - Version Control and Code Review Software


Here are some merging tools
Tailor - DarcsWiki
Tailor â?? Trac
SourceGear : DiffMerge


Directories

This doesn't directly relate to version control but working with directories is something you have to do many times when developing applications.

Linux.com :: Disk usage analysis and cleanup tools
KDirStat / WinDirStat - is a graphical disk usage utility, very much like the Unix "du" command. In addition to that, it comes with some cleanup facilities to reclaim disk space and nice graphical views.



7 Open Source Version Control Systems Reviewed | Developer's Toolbox | Smashing Magazine


Bazaar

Welcome - Bazaar Version Control
Launchpad - Bazaar code hosting.


Perforce || p4

Is noclobber by default, and won't/Can't clobber writable files, even when force sync'ing. P4 will silently not return files, if those files are checked out from another host on the same clientspec, even when force sync'ing. Clientspecs are supposed to be workstation/host specific, but people want to abuse them (removing the host field), and using them across many hosts by many users. I think sync'ing by force should mean something;clobber writable, and give me contents of all files regardless of checkout state of the current clientspec...


< Prev  Next >
Last Updated on Thursday, 05 June 2014 15:17