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.

Revision control with Mercurial

1,840 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Revision control with Mercurial

  1. 1. Revision Control withMercurialPaulo Gandra de Sousa@pagsousa
  2. 2. • The need• Basic concepts• Distributed revision control• Best practices• ToolsAgenda
  3. 3. • Share and synchronize among team members• Fast and reliable undo • For errors • For previous released versions• Track changes • Connect with task & bug management• SandboxingThe need
  4. 4. • Repository • Trunk • Add • Check in• Revision• Diff• HeadBasic concepts http://betterexplained.com/articles/a-visual-guide-to-version-control/
  5. 5. • Check out• Working copy• Revert• Check inBasic edit flow http://betterexplained.com/articles/a-visual-guide-to-version-control/
  6. 6. • Diff • Merge • ResolveHandling conflits http://betterexplained.com/articles/a-visual-guide-to-version-control/
  7. 7. • Add• Delete• Rename• Forget• Lock • To avoidHandling files
  8. 8. • Each user owns a repository and serve it to other users • May use central (by convention) repositoryDistributed version controlhttp://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/
  9. 9. Geographicalydistributed teams http://www.ericsink.com/vcbe/vcbe_a4_lo.pdf
  10. 10. Merge head changeset Head; tipRevisions, heads, tips
  11. 11. • Each user clones a “central” repository or inits a local repository• Joel edits and/or adds files, check status, and commits in his local repository http://hginit.com/02.html
  12. 12. • Joel pushes his push change set to another (e.g., the “central”) repository• Rose pulls from the central repository pull http://hginit.com/02.html
  13. 13. • Joel and Rose edit and commit in their local repository• Rose pushes to the central repository http://hginit.com/02.html
  14. 14. • Joel trys to push but pull gets an error • Joel pulls the changes• Joel merges the two heads and resolves any conflict• Joel commits and pushes to the central repository http://hginit.com/02.html
  15. 15. • Pull changes/Update before editing• Commit often• One commit – one issue• Write meaningful commit messages• Don’t commit broken code• Review the merge before commit• Setup change notifications• Read Diffs from other developersBest practices
  16. 16. TOOLSMercurial, TortoiseHG, HGE, Netbeans
  17. 17. • Download • http://mercurial.selenic.com/wiki/Download• Tutorial • http://mercurial.selenic.com/wiki/Tutorial• Hg definitive guide • http://hgbook.red-bean.com/• Hosting (free and comercial) • http://mercurial.selenic.com/wiki/MercurialHostingMercurial
  18. 18. • Download • http://tortoisehg.bitbucket.org/download/• Quick tutorial • http://tortoisehg.bitbucket.org/manual/1.1/quick.html• TortoiseHg Manual • http://tortoisehg.bitbucket.org/manual/2.3/TortoiseHg
  19. 19. • Clone• InitShell extension menu
  20. 20. • Commit• Status• Add• Revert• Remove• Update• SynchronizeShell extension menu
  21. 21. Hg Workbench
  22. 22. • Download • http://javaforge.com/project/HGEHGE (Eclipse plugin)
  23. 23. New project
  24. 24. Project context menu
  25. 25. File context menu
  26. 26. Commit
  27. 27. Compare
  28. 28. History
  29. 29. • Download • http://netbeans.org/downloads/• Netbean’s Mercurial User Guide • http://netbeans.org/kb/docs/ide/mercurial.htmlNetbeans
  30. 30. Clone repository
  31. 31. Context
  32. 32. History
  33. 33. Commit
  34. 34. Push
  35. 35. • A visual guide to version control, http://betterexplained.com/articles/a-visual-guide-to-version-control/• Joel Spolsky, Hg Init, http://hginit.com/• Distributed version control illustrated, http://betterexplained.com/articles/intro-to-distributed-version- control-illustrated/• Eric Sink, Version Control by example. http://www.ericsink.com/vcbe/vcbe_a4_lo.pdf• Tutorial, http://mercurial.selenic.com/wiki/Tutorial• Understanding Mercurial, http://mercurial.selenic.com/wiki/UnderstandingMercurial• Version control 10 best practices, http://blog.manishchhabra.com/2011/04/10-version-control-best- practices/Bibliography

×