Você está na página 1de 27

TortoiseSVN Tutorial

Outline
Basic SVN Concepts
Access to SVN using TortoiseSVN
Common SVN locations at RamSoft

BASIC SVN CONCEPTS

Typical SVN Configuration


Client Interface

Repository Interface

GUI client
apps

mod_dav
Repository
access

Apache

TortoiseSVN

DAV
Internet/LAN

Client
Library
WebClient for SVN

mod_dav_svn

(Any TCP/IP Network)

SVN

Subversion
Repository

Local
Command line
client apps

Working Copy
Management
Library

Access URLs
file://
Direct repository access to local or network drive.

http://
Access via WebDAV protocol to Subversion-aware Apache server.

https://
Same as http://, but with SSL encryption.

svn://
Unauthenticated TCP/IP access via custom protocol to an svnserve server.

svn+ssh://
Authenticated, encrypted TCP/IP access via custom protocol to an svn server.

We are using HTTPS access at RamSoft

The Repository
The repository stores information in the file system tree, a
kind of file server.

When a client reads data from the repository, it normally


sees only the latest version of the files (HEAD revision)
The client also has the ability to view previous revision of
any files in the repository

Revision Number
0

Revision number is
increased for every
transaction that
changes the
repository.

The Working Copy


Checking out creates a working copy of
a specific revision of the repository on
users local storage
repository

working copy
2

.svn

.svn

SVN's config data. Do


not edit these folders!

1
0

Repository Layout

trunk/tags/branches on root;
each module will be tagged separately
checkout of all modules is possible
commits can span multiple modules

The Work Cycle (1)

client

checkout (first time)

server

send current revision ( n )


(do some work, test)
check status
update

any changes since revision n?


update your local copy with any
changes in the repo.

(resolve conflicts)
commit
(do more work, test)

save your changes and log entry

The Work Cycle (2)


Submit your changes

Create a local
copy

svn checkout
svn update

10
0

Subversi
on
Repositor
y

10

svn commit

Resolve conflicts
(Merge your changes)

Make changes

svn dif
svn resolved

svn add
svn move
svn delete

10
5

See what was changed


in the repository in the meantime
svn status -u

Update your local copy


svn update

Check out
The client machine

Repository Server

Check out a working copy

2
1
0

A check out will transfer the projects content


from the repository server to the client
machine.

Update
The client machine

Repository Server

Update a working copy

2
1
0

An Update will synchronize latest projects


content from the repository server to the
client machine.

Commit
The client machine

Repository Server

commit changes to repository

3
2
1
0

A commit transfers the projects modified


files from the client machine to the
repository server.

ACCESS TO SVN USING


TORTOISESVN

Check Out using TortoiseSVN


Using Windows Explorer, right-click in a directory.
If not sure of path to
check-out then use Repobrowser first.

In Repo-browser, rightclick on folder or file you


want to check-out.

Check-out: Advice
Don't check-out the entire repository!
Only check out the part that you need.
For DEV SVN, it is usually
Trunk: http://svn.ramsoft.biz/core/trunk
Current active branch:
http://svn.ramsoft.biz/core/branches/5.1r3

For QA SVN, it is usually


Documentation: http://
svn.ramsoft.biz/qa/Technical Documents
Automated Testing Tool: http://
svn.ramsoft.biz/qa/RATT

Check for Updates


Before "committing" your work, check for updates in
the repository.
Something might have changed while you were
working.
Subversion requires you to synchronize before commit.

Work Cycle: Update working copy


If there are any changes on the server,
then you should "update" your working
copy before "commit"-ing your changes.

Resolve Conflicts
"Conflict" means you have made changes to a file, and
the version in the repository has been changed, too.
So there is a "conflict" between your work and work
already in the repository

(6) Work Cycle: Commit


After "update" and resolving
conflicts, commit your work.

Logging a Revision
Its important to ensure the following
information is properly entered
before committing any change to
SVN
Content what has changed? SVN does
this
Date when did it change?
Author
who changed it?
enter
Reason why has it changed? you
this
Redmine issue number (#XXXXX)

SVN Log Viewer and Revision Graph

SVN Best Practices


Plan the directory structure
Decide what work products to put in
version control
Decide what to exclude
Don't check-in buggy code
Commit all files related to the same
task as one commit. This makes
comments more meaningful.

COMMON SVN LOCATIONS


AT RAMSOFT

QA SVN
Builds and Releases
http://svn.ramsoft.biz/qa/QA Artifacts

Release Notes & Service Manual


http://
svn.ramsoft.biz/qa/Technical Documents

Automated Testing Tools


http://svn.ramsoft.biz/qa/RATT

Old requirement documents (the most


recent ones are on TestLink)
http://svn.ramsoft.biz/qa/Requirements

DEV SVN
Trunk: Latest development codes
http://svn.ramsoft.biz/core/trunk

Branches: Active released code


http://svn.ramsoft.biz/core/branches

Patches: QA takes the patches for testing


purpose
http://svn.ramsoft.biz/core/patches

PatchesVerified: QA delivers the verified


patches to Support
http://svn.ramsoft.biz/core/patchesverified

Você também pode gostar