Software Version Control – Subversion- Installation and Configuration


>> There is a bug in Microsoft Internet Explorer 6.0, this article is best viewed with FireFox 2.0

Software Configuration Management (SCM) in Roger Pressman book Software Engineering: A Practitioner’s Approach, says that software configuration manage ment (SCM) is a “set of activities designed to control change by identifying the work products that are likely to change, establishing relationships among them, defining mechanisms for managing different versions of these work products, controlling the changes imposed, and auditing and reporting on the changes made.”. In other words, SCM is a methodology to control and manage a software development project.

SCM concerns itself with answering the question: somebody did something, how can one reproduce it? Often the problem involves not reproducing “it” identically, but with controlled, incremental changes. Answering the question will thus become a matter of comparing different results and of analyzing their differences. Traditional CM typically focused on controlled creation of relatively simple products. Nowadays, implementators of SCM face the challenge of dealing with relatively minor

increments under their own control, in the context of the complex system being developed.

A corner stone tool to start with is the revision control system, so in this article we will focus on it and explain its installation and configuration.

Revision control – also known as version control – is the management of multiple revisions of the same unit of information. It is used to manage ongoing development of digital documents like application source code, art resources or design and architecture do

cuments. Changes to these documents are identified by incrementing an associated number, termed the “revision number” and associated historically with the person making the change. A simple form of revision control, for example, has the initial issue of a drawing assigned the revision number “1”. When the first change is made, the revision number is incremented to “2” and so on.

Software tools for revision control are increasingly recognized as being necessary for software development projects, not to manage only source code, but also for all software artifacts.

We introduce one of the best revision control system, Subversion, and will make guidance on how to install, configure and use effectively. In general use subversion –SVN – to control any document, which is text based or even binary files, in the case of text files you will be able to use tools to show revisions differences.

Subversion Basic Features:

  • Open source. Being open source does not mean low quality; it is a commercial quality system.
  • Multiplatform, Windows, Linux, and many other.
  • Commits are truly atomic operations. Interrupted commit operations do not cause repository inconsistency or corruption.
  • Renamed/copied/moved/removed files retain full revision history.
  • Directories, renames, and file metadata are versioned. Entire directory trees can be moved around and/or copied very quickly, and retain full revision history.
  • Native support for binary files, with space-efficient binary-diff storage.
  • Apache HTTP server as network server, WebDAV/DeltaV for protocol. There is also an independent server process that uses a custom protocol over TCP/IP.
  • Branching and tagging are cheap (constant time) operations.
  • Natively client/server.
  • Client/server protocol sends diffs in both directions, so costs are proportional to change size, not data size.
  • File locking for unmergeable files (“reserved checkouts”).

We will use RapidSVN as a multiplatform Subversion client tool, see Fig 1, keep in mind that this is a personal choice, more than 20 client tool and IDE plug-in are available at http://subversion.tigris.org/links.html

Fig 1

In order to help you introduce Subversion in your work, I will show steps of installation, configuration and basic use, I will cover only Windows-based installation.

Download and Install:

  1. Download subversion client/server software from http://subversion.tigris.org/files/documents/15/32473/svn-win32-1.3.2.zip
  2. Install the downloaded file to c:subversion
  3. Add c:subversionbin to the Windows PATH variable.
  4. Download RapidSVN from http://rapidsvn.tigris.org/
  5. Install RapidSVN to any place in your hard disk, and keep its icon reachable.
  6. Run RapidSVN and explore it a little to be familiar with.

Configure and Use:

  1. We simply create a repository per project.
  2. Create a root folder for all your repositories, create c:svnrepos
  3. Create initial repository:
    Open command shell, and run
    svnadmin create c:svnreposproject1
    .
  4. Open Command prompt, run the server by running the command
    svnserve -d -r c:svnrepos
    this means you want to run the svnserve as a daemon to serve repositories under c:svnrepos.
  5. open svnserve.conf under c:svnreposproject1conf , remove the comment from the following lines:
    [general]
    auth-access = write
    password-db = passwd
  6. Open passwd under c:svnreposproject1conf, uncomment the following lines:
    [users]
    ahmed=pass1
    aly=pass2

    add users in the format that user=password, as shown above.
    There exist many options in authorization and authentication, see references section for additional documents.

Check out a version from the repository:

1. Run RapidSVN.

2. Press Ctrl->O write svn://192.168.0.79/project1 in URL field, (I assume the server machine IP is 192.168.0.79), write Destination Directory, I assume c:projectsproject1, then press OK.

Add Files:

1. Create new file, name it file.txt, write the statement This is version 1, save the file, copy it under c:projectsproject1 . Open RapdSVN, open the bookmark added previously, you will see the file status unversioned, right click the file and select Add command. Now the file status is added, but the Rep. Rev. is -1. This means that you still have to commit the file in order to add it to the repository, right click the file and select Commit…, now the file status is empty. And Rep. Rev. is 1.

2. Open the file1.txt in any text editor, add second line as following This is text line number 2. Save the file. In ReapidSVN the Status is modified. To commit the file to the repository, right click and select Commit…, you will be authenticated, write matching user name and password that match one that is created in passwd file, after OK, the Rep. Rev. is now 2.

Text Viewing, Differences and Merges:

  1. For text files viewing, you can use Notepad++ from http://notepad-plus.sourceforge.net/uk/site.htm, you can also use Porgrammers Notepad at http://www.pnotepad.org/. Both are open source and good quality.
  2. For text files differences and merge tool, WinMerge is an excellent tool, download from http://winmerge.sourceforge.net/
  3. In RapidSVN, select View > Preferences and select Programs tab, adjust the path of Standard Editor and Diff Tool as shown in Fig 2.


Fig 2

The following guidelines are our practical experience that helped us to use subversion properly in a way that helps us make our source code versions manageable.

  1. Update frequently as much as you can, commit on average daily. In case of any conflict consult software team leader and other team members, in 95% of cases you can resolve the conflict safely without any guidance.
  2. Commit each logical unit of change separately, as example if you are going to fix three bugs, commit each bug separately, this will ease changes tracking.
  3. On every commit, write detailed notes.
  4. Don’t ever commit code that breaks the build.
  5. Don’t change any code that you don’t own without consultation to the code owner.
  6. Before committing run self-test-procedure for your changes.
  7. Use WinMerge always to review changes carefully before each commit.
  8. Don’t put generated files into version control, put only source files whatever it is textual or binary files like images or word document.

References:

  1. http://subversion.tigris.org
  2. http://rapidsvn.tigris.org
  3. http://notepad-plus.sourceforge.net/
  4. http://www.pnotepad.org
  5. http://winmerge.sourceforge.net

From ahm507.blogspot.com

0 responses to “Software Version Control – Subversion- Installation and Configuration”

  1. Many thanks for your valuable information about subversion.
    My question:
    To make the repository available to others over a network,we write this command "svnserve -d -r c:svnrepos" in the command prompt
    it means i can't close the command prompt i.e. if i close the command prompt i can't access the repository.
    How Can i make the repository available over the network and can close the command prompt?

  2. I used Visualsvn ver. "TortoiseSVN-1.4.0.7501-win32-svn-1.4.0.msi" but when make checkout ,this message is dispalyed "Can't connect to host 'RD-hossam' No connection clould be made because the target machine activley refused it"

  3. I have a problem when make chekcout ,this message is appeared "Decompression of svn diff data failed"
    I used CollabNetSubversion-server-1.6.2-1.win32 for server and TortoiseSVN-1.5.6.14908-win32-svn-1.5.5.msi for client.

  4. Can anyone recommend the top Endpoint Security system for a small IT service company like mine? Does anyone use Kaseya.com or GFI.com? How do they compare to these guys I found recently: [url=http://www.n-able.com] N-able N-central remote pc control
    [/url] ? What is your best take in cost vs performance among those three? I need a good advice please… Thanks in advance!

Leave a Reply

Your email address will not be published. Required fields are marked *