Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Related Books

Free with a 30 day trial from Scribd

See all

Subversion @ JUG Milano 11 dic 2009

  1. 1. Subversion
  2. 2. <ul><li>Why I need a version control system? </li></ul>
  3. 3. <ul><li>How many VCS? </li></ul>
  4. 4. <ul><li>How many VCS? </li></ul>CVS Subversion Mercurial Git Bazar Perforce Visual Source Safe ...
  5. 5. <ul><li>How to choose VCS? </li></ul>
  6. 6. My project <ul><li>Project SISMA </li></ul><ul><li>Peoples: </li></ul><ul><ul><li>Software Engineers </li></ul></ul><ul><ul><li>Geophysics researchers and PhD </li></ul></ul><ul><li>Artifact: </li></ul><ul><ul><li>Word Documents </li></ul></ul><ul><ul><li>reStructuredText documents </li></ul></ul><ul><ul><li>Computational softwares (Bash, C, C++, Fortran) </li></ul></ul><ul><ul><li>Other project (Java) </li></ul></ul><ul><li>Security concerns: </li></ul><ul><ul><li>Authorizations and Authentication needed </li></ul></ul><ul><li>Other constraints: </li></ul><ul><ul><li>Big repo, need of sparse checkout </li></ul></ul><ul><ul><li>Binary data </li></ul></ul><ul><ul><li>Clients needed for Windows, Mac and Linux </li></ul></ul>
  7. 7. My Choice <ul><li>Subversion </li></ul><ul><li>Reasons: </li></ul><ul><ul><li>Central repository model </li></ul></ul><ul><ul><li>Path Based authorization </li></ul></ul><ul><ul><li>Selective checkout </li></ul></ul><ul><ul><li>Fewer concepts </li></ul></ul><ul><ul><li>HTTP Friendly (subset of WebDAV) </li></ul></ul><ul><ul><li>Works on Linux, Mac and Windows </li></ul></ul><ul><ul><li>Word comparison (through TortoiseSVN) </li></ul></ul>
  8. 8. Central Repository Architecture Central Repository working copy svn client working copy svn client working copy svn client web browser r/w r/w r/w ro  simpler to explain  No local copy of all repo  only online operations Fewer concepts
  9. 9. Fewer concepts Commit Update Push Pull Staging Index Porcelain Plumber Commit Update Push Pull Commit Update GIT HG Subverion
  10. 10. Clients <ul><li>Linux and Mac: svn client </li></ul><ul><li>Windows: TortoiseSVN </li></ul>$ svn help usage: svn <subcommand> [options] [args] Subversion command-line client, version 1.6.3. Type 'svn help <subcommand>' for help on a specific subcommand. Type 'svn --version' to see the program version and RA modules or 'svn --version --quiet' to see just the version number.
  11. 11. Choosing Server Apache HTTP svnserve svnserve over SSH fastest! faster! Logging! no log no log easy set up SSH accounts file permissions Apache Auth SSL firewall friendly browser friendly e.g.LDAP SLOWEST
  12. 12. (Web) Browser Friendliness revision number access from web browsers <ul><li>Use case?  Deliver a document </li></ul>
  13. 13. (Web) Browser Friendliness <ul><li>Pick a specific revision (after svn 1.6) </li></ul>
  14. 14. Authentication and Authorization (corporate secrets) <ul><li>Why bother about? </li></ul><ul><ul><li>Because is a requirement: </li></ul></ul><ul><ul><ul><li>Copyright on some artifacts </li></ul></ul></ul><ul><ul><ul><li>Artifacts from different partners </li></ul></ul></ul><ul><ul><ul><li>Non disclosures agreements </li></ul></ul></ul><ul><ul><ul><li>Secrets! </li></ul></ul></ul><ul><li>How? </li></ul><ul><ul><li>Path Based Authentication </li></ul></ul><ul><ul><ul><li>( ) </li></ul></ul></ul><ul><ul><ul><li>Coarse Grained  </li></ul></ul></ul><ul><ul><ul><li>Difficult to maintain  </li></ul></ul></ul><ul><ul><ul><li>Doesn’t know anything about history  </li></ul></ul></ul><ul><ul><ul><li>The only choice  </li></ul></ul></ul>
  15. 15. Path Based Authorization (1) /etc/httpd-public/conf.d/subversion.conf <Location /svn/> DAV svn SVNParentPath /var/svn/ AuthType Basic AuthBasicProvider ldap AuthName &quot;Subversion repository“ AuthLDAPURL ldap://,*) Require valid-user AuthzSVNAccessFile /var/svn/svn-access-file.conf Options Indexes SVNListParentPath on </Location>
  16. 16. Path Based Authorization (2) <ul><li>/var/svn/svn-access-file.conf </li></ul><ul><li>[groups] </li></ul><ul><li>mycompany = bob, alice </li></ul><ul><li>partner1 = charlie, bravo </li></ul><ul><li>[project1:/] </li></ul><ul><li>@mycompany=rw </li></ul><ul><li>@partner1=r </li></ul><ul><li>[project1:/secrets] </li></ul><ul><li>@mycompany=rw </li></ul><ul><li>@partner1= </li></ul><ul><li>[project1:/partner-contribution] </li></ul><ul><li>@mycompany=rw </li></ul><ul><li>@partner1=rw </li></ul> The real file is much bigger! 434 lines  You can split it!  If not well formatted…  Difficult to test write without actually write in the repository!
  17. 17. Sparse Checkout (>1.5) (big company, big data) working copy 4.1 Gb!! Central Repository 4.1 GB!!!
  18. 18. Tortoise SVN <ul><li>Windows Client </li></ul><ul><li>Integrates with Windows Explorer </li></ul><ul><li>Supports basic operations </li></ul><ul><ul><li>Check Out </li></ul></ul><ul><ul><li>Update </li></ul></ul><ul><ul><li>Commit </li></ul></ul><ul><ul><li>Show Log </li></ul></ul><ul><li>Other operations </li></ul><ul><ul><li>Repository Browser </li></ul></ul><ul><ul><li>Visual Comparison of Word Files </li></ul></ul><ul><ul><li>Revision Graph </li></ul></ul>
  19. 19. Lab <ul><li>Creating a local repo </li></ul><ul><li>Creating a repo on </li></ul><ul><li>Making the first Checkout </li></ul><ul><li>Visual comparing Word documents </li></ul><ul><li>Visual comparing Images </li></ul><ul><li>Visualizing the history of a document </li></ul><ul><li>Using revision graph (with comparing) </li></ul><ul><li>Repo Browser con trash-cli (in locale) </li></ul><ul><li>Esempio di sparse checkout </li></ul><ul><li>Repair move </li></ul>
  20. 20. Non solo Subversion <ul><li>Subversion server, local mercurial: </li></ul><ul><ul><li>hgsubversion </li></ul></ul><ul><li>Using some TortoiseSVN comparison facilities in TortoiseHG: </li></ul><ul><ul><li> </li></ul></ul>
  21. 21. Links <ul><li>Per imparare ad usare Subversion: </li></ul><ul><ul><li> / </li></ul></ul><ul><li>Per la scelta: </li></ul><ul><ul><li>http :// </li></ul></ul><ul><li>Hosting privato (ad esempio): </li></ul><ul><ul><li> </li></ul></ul><ul><li>Hostint opensource (ad esempio): </li></ul><ul><ul><li>http:// </li></ul></ul><ul><li> </li></ul><ul><ul><li> </li></ul></ul><ul><ul><li> </li></ul></ul><ul><ul><li> </li></ul></ul>
  22. 22. Visual comparison <ul><li>Create a repo. </li></ul><ul><li>Check out the repo in a wc. </li></ul><ul><li>Create a Word Document and write something in it. </li></ul><ul><li>Commit adding the file. </li></ul><ul><li>Modify the document and commit again. </li></ul><ul><li>Show differences. </li></ul>
  23. 23. Compare with … (1/2) … with any other revision … with the previous revision
  24. 24. Compare with … (2/2) … with any different branch of the document
  25. 25. Revision Graph