Subversion nello sviluppo web

Fabio Serra

Omniwhere s.r.l.

Argomenti

  1. Concetti base
  2. Organizzazione dei repository
  3. Copia live su web
  4. Suggerimenti vari

Che cosa è Subversion

A chi serve

Checkout

Commit

Inviare le proprie modifiche al repository

Update

Scaricare dal repository le modifiche fatte dagli altri

Merge

Il nostro file in locale è più vecchio di quello nel repository. E' richiesto un update.

  1. Nessuna sovrapposizione: merge automatico
  2. Sovrapposizione: conflitto da risolvere manualmente

Creare un repository

Repository layout

Tutto è una directory

Branches

Cosa mettere nel repository

SI

NO

Sviluppo centralizzato o distribuito?

Creare una copia live del repository

VirtualDocumentRoot

#Dynamic VHost
#examples:
#http://progetto.example.com
#http://progetto.admin.example.com
<VirtualHost *:80>
   UseCanonicalName off
   VirtualDocumentRoot /srv/www/htdocs/%-3+
   <Location />
     AuthType Basic
     AuthName "Company Dev Area"
     AuthUserFile /etc/apache2/htpasswd/users
     Require valid-user
   </Location>
</VirtualHost>
	

Usare le keywords

Keyword substitution

<!---
/*==============================================================================
Insert a file description
Filename: filename.cfm
Created: 2008-02-14
Initial Developer: Fabio Serra (faser@omniwhere.com)

$LastChangedDate: 2008-02-26 10:28:20 +0100 (mar, 26 feb 2008) $ $LastChangedRevision: 19 $ $LastChangedBy: faser $ ==============================================================================*/ --->

auto-props

auto-props

*.cfm = svn:keywords=LastChangedDate LastChangedRevision LastChangedBy
*.cfc = svn:keywords=LastChangedDate LastChangedRevision LastChangedBy
*.js = svn:keywords=LastChangedDate LastChangedRevision LastChangedBy
*.html = svn:keywords=LastChangedDate LastChangedRevision LastChangedBy
*.as = svn:keywords=LastChangedDate LastChangedRevision LastChangedBy
*.mxml = svn:keywords=LastChangedDate LastChangedRevision LastChangedBy
*.css = svn:keywords=LastChangedDate LastChangedRevision LastChangedBy
*.sql = svn:keywords=LastChangedDate LastChangedRevision LastChangedBy