User Tools

Site Tools


haas:spring2011:unix:cs:cs0


Corning Community College

UNIX/Linux Fundamentals


Case Study 0x0: Subversion Repository Initialization

~~TOC~~

Objective

To initialize the student's personal Lab46 Subversion Repository and gain familiarity with the use of Version Control while performing class activities throughout the semester.

Reading

In “Version Control with Subversion”, please read:

Background

Subversion, and other version control systems, allow you to version (or snapshot) instances of files, much as one would manually file dated versions of documents, that can be referenced, retrieved, and compared with other versions. Version control is particularly important in program development as many thousands of changes take place in any code base.

It is prudent to have a capability to “step back in time” should some modifications prove unsuccessful, to avoid needless data re-entry and effectively move forward.

What we are going to do now is initialize your personal Lab46 Subversion repository- a resource that each user on Lab46 receives, and can be used for an array of purposes, far beyond the requirements of any class activities you may encounter. We will be making use of subversion this semester to afford you the experience to familiarize yourself with this important development tool, so that you can effectively use it into the future.

Step 0: Create some files for our repository

For the purposes of this class, you'll want to create a special directory in which you store your source files. We'll be calling this directory unix, and we'll want to create it underneath our ~/src/ subdirectory.

At the Lab46 prompt, do the following:

lab46:~$ mkdir -p src/unix
lab46:~$ 

Step 1: Setting up your repository for class use

To accomplish this, please do the following at the Lab46 prompt (please substitute your username in place of the literal string “username” in the example below):

lab46:~$ svn import src http://lab46.corning-cc.edu/svn/username/src -m "Initial import"
Adding      src/unix
Adding      src/submit
Adding      src/Makefile

Committed revision 1.
lab46:~$ 

To avoid some problems, we'll move our existing src directory out of the way:

lab46:~$ mv src src.bak
lab46:~$ 

Next, we'll need to check out our repository:

lab46:~$ svn co http://lab46.corning-cc.edu/svn/username/src src
A    src/unix
A    src/submit
A    src/Makefile
Checked out revision 1.
lab46:~$ 

Step 2: Contact and misc. info collection

As is the practice in many classrooms the first week of class, essential contact information is collected to ensure priority communications should such a need arise. In your svn tracked src/submit directory, make a file called contact.info (see example):

lab46:~/src$ cd submit
lab46:~/src/submit$ nano contact.info

When you hit enter, you will be taken into the nano text editor and can type content into what will become the contact.info file.

Please provide the following information in that file:

Name: Your First and Last Name
Nickname: any preferred nicknames
E-mail: a preferred non-Lab46 e-mail address at which you can be contacted and check regularly

Rationale: a forward-looking statement describing why you have earned an 'A' in this class
(write as much as you want to justify your position).

Note that if you have multiple classes with me, you only need one contact.info file, but you should break out additional Rationale sections for each class.

When done, save and exit from the editor (if you look at the bottom of the screen you'll see various commands you can enter— ^ indicating the pressing down of your keyboard's CTRL key while pressing whatever key comes after).

For example, to save and then exit from nano, do a CTRL-X (press and hold down CTRL, press 'x').

You'll be prompted (at the bottom of the screen) whether or not you want to save your modified buffer. Answer 'y'.

The prompt will then change to display the filename to save as. If you followed the directions correctly above it should say “contact.info”. If not, you can take the opportunity now to make it say such. When set, press ENTER. You should be back at the Lab46 prompt.

Step 3: Add contact.info for subversion tracking

Before we can commit, we need to let subversion know we wish for it to track this file.

To do that, do the following at the lab46 prompt:

lab46:~/src/submit$ svn add contact.info
Adding     contact.info
lab46:~/src/submit$ 

Step 4: Commit contact.info to your repository

We'll now commit this file to your repository.

To do that, do the following at the lab46 prompt:

lab46:~/src/submit$ svn commit -m "created contact.info file for class"
Sending        contact.info
Transmitting file data .
Committed revision 3.
lab46:~/src/submit$ 

Submission

This assignment has activities which require an action or response. Please organize your responses into an easily readable format and submit the final results to your instructor per the appropriate methods.

Your assignment is expected to be performed and submitted in a clear and organized fashion- messy or unorganized assignments may have points deducted. Be sure to adhere to the submission policy.

The successful results of the following actions will be considered for evaluation:

  • creation of ~/src/unix directory
  • import/checkout of lab46 subversion repository into ~/src
  • addition/commit of ~/src/unix directory into repository
  • addition/commit of ~/src/submit/contact.info file into repository

As always, the class mailing list and class IRC channel are available for assistance, but not answers.

haas/spring2011/unix/cs/cs0.txt · Last modified: 2011/01/30 17:06 by 127.0.0.1