SmartCVS Tutorial Starting the putty Client and Setting Your CVS Password 1. Open the CSstick folder. You should see an icon or a filename for putty. Depending on your computer s configuration, it might be named putty.exe or might look something like this: Double-click putty to start. 2. Enter aslan.nix.selu.edu in the Host Name (or IP address) box. Make sure that the SSH radio button is selected. Click Open to start a secure shell.
3. You should see a secure shell window appear. You may also get a dialog box at this time, similar to the one below, asking to add a new server host key to putty s cache: If you see this dialog box, click Yes to accept the host key, and continue. If you don t get this alert, don t worry, just continue at step 4. 4. You should now see an unobstructed secure shell window. At the login as prompt, type your w-number and press enter. 5. It will then ask for your password, which is initially set to your w-number as well. Note that when you type your password, you will not see anything appear. This is a security feature, and is normal. Carefully enter your w-number and press enter (we recommend that you do NOT use the keypad). 6. Since this is the first time you ve logged in, you will be required to change your password. First however, you must re-enter the existing password, which is still your w-number.
7. Next, you must enter a new password, and then re-enter it to confirm, since you will not see anything that you type. The system is picky about passwords however. If your password is too short, or too simple, it will be rejected. We recommend that you join two words together with a symbol to form your password. 8. If everything goes well, you should see a screen similar to the following, ending with a command prompt consisting of your w-number@aslan:~$: You have now set your new password. Type exit at the command prompt to log out. For most classes (including CMPS 161) you will not be able to do anything useful with this system except set your password and use the CVS server, so you may as well simply log out.
Starting the SmartCVS Client 1. Open the jgraspstick folder. You should see an icon or a filename for the smartcvs batch file. Depending on your computer s configuration, it might be named smartcvs.bat or might look something like this: DO NOT USE the smartcvs folder! Use the batch file! Double-click smartcvs to start. SmartCVS will actually open two windows, a DOS command window and the SmartCVS window itself, which will be represented on the task bar as and buttons, respectively. 2. The first time you run SmartCVS, you should get the following message window: If you have not yet changed your password as in the first task of this tutorial, do not try to continue. Press ctrl-c to exit and wait until your instructor informs you that your account has been set up, and then start over from the beginning. Otherwise, press a key and go on to the next step. 3. The message window should continue by asking for your w-number: Enter it with a lowercase w and no spaces, as shown above, but user your own w-number, of course! 4. Press enter and it should continue with the initial CVS setup. This only happens the first time you start smartcvs after installing a fresh copy of CSstick.exe, so don t expect it again. The next time CVS will just begin, as it should do now.
Using the SmartCVS Client Concurrent Versions System keeps your files in a central repository on another computer. Only you and your teacher will have access to your files. To work on your files, you must make a copy of your portion of the repository on the computer you are using, and that copy may reside on hard disk, on a network drive (like your M: drive), or on removable media such as a USB flash drive. You can then work on the local copy of your files, but remember: (1) When you create new files, they will not be managed by the CVS system until you explicitly Add them. (2) Changes to files (or new files that have been Added ) will not be saved in the central repository until you explicitly Commit them. Every time you commit a file, it creates a new version of that file, and CVS keeps up with all the versions. You should commit your work regularly (every time you make an important change is a good rule of thumb). This will allow you to go back to a previous version if you need to, and will also provide an extra backup of your work (in addition the backup you keep for yourself on digital media). 1. When SmartCVS starts, you should see a window like this: The Welcome to SmartCVS dialog box will initially appear with an option to check out a project from the repository. After you begin using SmartCVS, there may also be one or more existing projects in the selection pane which you can use. Since we don t have an existing project to use, make sure that Check out project from repository is selected, and click OK.
Checking Out a Project 1. You can begin the process of checking out a project in two ways: a. When you start SmartCVS and choose Check out project from repository in the Welcome to SmartCVS dialog box b. Using the Check Out option on the Project menu. Either way, you should get the Check Out Project dialog box, at the Repository step: There should be at least one profile in the Repository Profile box. If not, you may need to delete your CSstick folder and reinstall CSstick.exe from the beginning, and then restart smartcvs with your w-number (go back to step 1 of Starting the SmartCVS Client, above). 2. Choose your repository profile (if it is gray, as in the above example, you don t need to choose anything it is automatic). Then click Next to continue.
3. You should now see a Login dialog box: Delete the asterisks, and replace them with the password that you chose in the first task of this tutorial. If you are using CSstick on your own personal computer or from a flash drive, you may check the Store password on disk box. Otherwise, you should leave it unchecked for security (and you will have to enter your password every time you use SmartCVS. 4. You should now be at the Modules step. If your repository profile was created correctly, you should see the beginning of a folder tree showing your repository, and the student work folder within it: Click the plus sign by the student_work folder to open it, revealing the classes in the repository:
Click the plus sign by your class to open it, revealing the student repositories for that class: Use the scroll bar to find your w-number, if necessary. If your w-number is not available, you may be looking in the wrong class, or you may need to ask your instructor for technical support. Click the folder icon for your w-number to select it.: After selecting your w-number, click Next to continue. 5. You should now be at the Target Directory step. Accept the defaults and click Next to continue.
6. You should now be at the Checkout Options step. Accept the defaults and click Next to continue. 7. You should now be at the Project Settings step. Accept the defaults and click Next to continue. 8. You should now be at the Confirmation step. Accept the defaults and click Finish to continue. 9. SmartCVS should begin checking out your repository. When it completes, the SmartCVS Foundation 4.x.x window should show the current contents of your repository:
10. Your repository has now been stored under the cvsroot folder on your local computer. Find the cvsroot folder and open it. Then navigate from the cvsroot folder into the student_work folder, then from the student_work folder into your class s folder, and then from your class s folder into your w-number folder. You should see something like the following: Your view may be slightly different. Depending on your computer s settings, you may see large icons, or small icons, or filenames. Note: Leave the CVS folders alone. They are maintained automatically by SmartCVS, and should not be altered by the user. Working on a files under CVS and Committing files 1. Your w-number folder is your private folder for storing classwork. Other students do not have access to it when it is in the central repository, but remember that there is no protection for it after you have checked it out, so only check it out to a folder on your own personal computer, or on your own removable media, or on your network M: drive. 2. To see how this works let s simulate working on an assignment. Start by creating a folder for this assignment called Assign1. Click on File->New->Folder to create the new folder, and then reset the highlighted name to Assign1.
3. Open the new folder and create the Smiley.java and Smiley.class files in it. Usually we would do this by writing the java source file Smiley.java, and then compiling it to create Smiley.class. However, for this exercise, you should simply download them into the Assign1 folder from the Internet. Open a web browser and go to http://aslan.nix.selu.edu/~tkammerd/cvs_sample: Right-click on each of the files and save them into the Assign1 folder. When you finish, the folder should look like this: 4. Now, go back to the SmartCVS window. Notice that it still looks like it did before: Click the Refresh button to see the new files:
5. The new files are not yet under CVS management (their local state is Non-CVS ), and they are not in the central repository. To put them under CVS management, they must be Added. Select both files in the SmartCVS window by click-n-drag or by shift-clicks. Notice that the Add Files icon is no longer grayed out: 6. Click the Add Files icon. The Add dialog box should appear. Click OK to accept the defaults, and the two files will be added to CVS control. If successful, they should both now have a local state of Added. They are now under CVS management, but they are still not in the central repository. They exist only in the local folders on the computer you are using. 7. To put them into the central repository, they must be Committed. Select the two files, or better yet, select the entire repository, and then click the Commit button.
8. The Commit dialog box should appear. Type a short description of the new version that you are creating with this commit into the Log Message window, and click OK to do the commit. 9. If the commit completes successfully, both files should now show a local state of Unchanged, indicating that the version stored on the local computer is the same as the version stored in the central repository. 10. A file only needs to be added to CVS management once. From then on, it only needs to be committed whenever an important change is made. This creates a new version of the file in the CVS system. To see this, use notepad to make a small textual change to Smiley.java, and then refresh the SmartCVS window. It should indicated that Smiley.java has been modified:
11. Select the repository and do another commit, and you should see Smiley.java return to the Unchanged state. Notice that the revision number has also advanced from 1.1 to 1.2.