|CS552 Course Wiki: Spring 2013||Main »
On this page... (hide)
For this course we use a version control system called svn. Details on svn are here. With svn you can track changes to the files as you modify them and arbitrarily revert back to older versions, without having to maintain messy manual backups. The other big advantage of an automatic version control system are that it allows you easily shared project files between project partners.
The repository is the place where the master copy of your files are maintained. To modify files you should "checkout" from the repository. When you are satisfied about a small set of changes you have made you should "commit" the changes at which point, the files will be modified in the repository.
The work directory is a checkout of the repository and contains any modifications you made
An svn repository has been created for each one of you in this location: (replace user with your cs login)
The repository has been populated with just the directory structure and you are expected to stick to this structure. This is for information only. You will NEVER need to go to that directory and do anything in that directory.
First you must go to your home directory, or to some other directory where you want your cs552 related stuff to be in. It is also useful to set the prompt to show your current directory all the time. Which is what the set prompt command does.
Now, to checkout the repository issue the following command.
This will create a directory called cs552_work in whichever directory you issue this from. You should see the following directory hierarchy, if you execute ls:
As the name suggests you will work on individual homeworks and the project in different directory. For each problem that must be electronically turned in you must create a directory of its own. For example hw2, requires problem 1 and problem 2 to be turned. You must perform the following steps:
What is specified with -m is a comment. You should put something descriptive here.
You will end up creating a few verilog files, lets say adder.v, mux.v.
At this point you may make a bunch of changes. As and when you discover a small bug and fix it, commit that change. If you did not add any new files, you can just issue commit. Which will copy over the latest files to the repository.
You should provide a descriptive piece of text following -m
To finally submit the homework, when you are all done, you create a tag. Each homework will have its own tag. To create a tag called "hw2-submit", issue the following command:
You can provide any message following the -m.
You may re-submit as many times as you please.
You should simply checkout the tag you just created in a temporary directory and see if all the files you intended to submit are there. At the unix prompt issue the following commands:
Wherever you see [user] replace with your cs login.
You should see the files listed. If any files that you intended to submit are missing, go back to your original work directory mywork, issue svn add, svn commit, and the svn delete, svn copy sequence to re-submit. The checkout in a temporary copy to see if everything has been submitted.
This will show you a log of all the changes you have made
Lets saying you have been making several modifications to a file and are at revision 45 for a file. After doing a bunch of debugging, you realized revision 41 is actually the cleanest file and you want to go back to that as the latest copy. i.e create revision 46 which is the same as revision 41.
prompt> svn cat -r41 add.v > add.v # It is important to specify the filename twice with the greater than sign in-between. What the svn cat command does is dumps the file to the screen. What we are doing with the "> add.v" construct is redirecting the output to the file add.v prompt> svn commit -m "reverting to version 41"
To remove an entire directory and all the files in it from the repository; you can do:
If you want to remove a single file:
If you want to remove multiple files:
I just removed a directory or file, and issued svn commit. I want it back!
First find what revision number you are at, lets says you are at revision 20. You can determine this by doing the following:
Look at the line "Last Changed Rev: " to get the current revision. The file you deleted is then in the previous revision, "19". Then issue the following command:
Check if the files you want have been restored; then commit this:
|Page last modified on February 18, 2009, visited 2472 times|