paired programming!

20
Please sit next to your partner. If you don’t have a partner, please find one now. Paired Programming!

Upload: dawn

Post on 24-Feb-2016

43 views

Category:

Documents


0 download

DESCRIPTION

Paired Programming!. Please sit next to your partner. If you don’t have a partner, please find one now. Lab 2: SVN Tutorial. CS 282. But first…. Questions from last time? Anything you would like to know about the assignment? Notes You should do all your drawing inside DrawGLScene - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Paired Programming!

Please sit next to your partner.

If you don’t have a partner, please find one now.

Paired Programming!

Page 2: Paired Programming!

Lab 2: SVN TutorialCS 282

Page 3: Paired Programming!

Questions from last time?

Anything you would like to know about the assignment?

Notes◦ You should do all your drawing inside DrawGLScene◦ The completed framework is online for Mac OSX,

Linux, and Windows (once OpenGL is installed in ECC).

◦ In order to compile the framework, you must download OpenGL (XCode, apt-get, website).

But first…

Page 4: Paired Programming!

SVN is a versioning control software.

What is SVN?

Page 5: Paired Programming!

A repository of files with monitored access to keep track of who and what changes were made to files◦ Version tracking◦ Collaboration and sharing files◦ Historical information◦ Retrieve past versions◦ Manage branches

Why use SVN?

Page 6: Paired Programming!

Exercise: Your First Repository!

Page 7: Paired Programming!

Let’s create a repository now. First, have two terminal sessions up.

◦ The first terminal will be used to access your ECC account (i.e. what you used to log onto the lab computer). Everything accessed here is considered to be on your “local”

machine This is where your “local copy” is

◦ The second terminal will be used to access your CSE account (i.e. a DIFFERENT account completely separate from your ECC account). Everything accessed here is considered as being “remotely”

accessed on a completely different computer than the ECC computer)

This is where your “repository” is

Your First Repository (intro)

Page 8: Paired Programming!

CSE 1) Log into the CSE server in terminal◦ ssh [email protected]

CSE 2) Create a repository directory in CSE◦ ~/repositories/

CSE 3) Type in “svnadmin create tutorial” in the repositories directory◦ This will create a folder in repositories called

“tutorial”

Your First Repository (intro)

Page 9: Paired Programming!

ECC 1) Create a directory you would like to add repository files to.◦ Let’s name it “myproject”

ECC 2) Add the following folders in myproject◦ trunk◦ branches◦ tags

ECC 3) Now type in the following from one directory up from myproject ◦ svn import myproject

svn+ssh://[email protected]/cs/username/repositories/tutorial NOTE: this is all one command, and should all be typed onto a single line

of the terminal before hitting enter Replace “username” with your CSE username

Your First Repository (cont’d)

Page 10: Paired Programming!

Those directories you just created are now in your repository◦ Use the import command on your first revision.

ECC 4) Now delete the local directory (myproject) on the ECC side.◦ rm –fr myproject

ECC 5) Now let’s get the revision stored in the repository.◦ svn checkout

svn+ssh://[email protected]/cs/username/repositories/tutorial NOTE: this is all one command, and should all be typed onto a single line

of the terminal before hitting enter Replace “username” with your CSE username

Congratulations! You have just successfully created and downloaded your first svn repository!

Your First Repository (end)

Page 11: Paired Programming!

Exercise: SVN Commands

Page 12: Paired Programming!

First, switch drivers! ECC 6) Go into tutorial/trunk/ and create a file in it

◦ For example, main.cpp ECC 7) Commit this to your repository

◦ svn commit –m “[insert meaningful message here]” ECC 8) Now, use and test the following commands…

◦ Use these commands by typing: svn CommandNameHere add

◦ Use this when you want to add a file to your repository.◦ Create a main.h and add it to the repository (don’t commit

it yet).

SVN Commands (intro)

Page 13: Paired Programming!

delete◦ Use this when you want to remove a file from the

repository◦ Remove main.cpp (don’t commit yet).

status◦ Use this to check what you’ve changed so far.◦ “?” – You haven’t added this file yet

NOTE: This is fine. You don’t ALWAYS have to add files that are denoted with a “?”. NEVER ADD YOUR BINARIES (EXECUTABLES).

◦ “A” – You’ve added this file.◦ “M” – You’ve made changes to this file.

SVN Commands (cont’d)

Page 14: Paired Programming!

diff◦ Check out the exact lines of code you’ve added or

removed.◦ “+” means you’ve added this line,◦ “-” means you’ve removed this line.

update◦ Allows you to update to the newest revision.◦ Have your partner svn checkout (co) the repository

on their computer.◦ Commit the changes you’ve been making.◦ Have your partner svn update.◦ Call me when you have completed this step.

SVN Commands (end)

Page 15: Paired Programming!

add◦ add files to your local repository

status◦ check which files you’ve changed, which files haven’t

been added yet diff

◦ see what’s different between the revision you’re running and the changes you’ve made

delete◦ remove files from your local repository

commit◦ commit your changes to the online repository

update◦ update your local repository with the latest version

Commands to Know and Love

Page 16: Paired Programming!

Conflicts

Page 17: Paired Programming!

Partner A and Partner B both work on the same file, test1.cpp.

Partner A commits his changes to the repository. Partner B finishes a little later, and tries to

commit. Uh oh! Partner B has encountered a conflict.

◦ SVN will then prompt you with a variety of options to handle this conflict

Conflicts

Page 18: Paired Programming!

In order to resolve conflicts, there are a few things you can do…◦ Tell SVN to ignore your changes◦ Tell SVN to ignore your partner’s changes◦ Manually remove whatever is conflicting, and

recommit. The best way, of course, is to not have a

conflict in the first place.◦ Be sure to google SVN, and take a look at the

documentary if you’re having trouble resolving conflicts.

Resolving Conflicts

Page 19: Paired Programming!

Questions?

Page 20: Paired Programming!

TortoiseSVN (For Windows): http://tortoisesvn.tigris.org/

RabbitVCS (For Linux):http://www.rabbitvcs.org/

Useful Links