SlideShare une entreprise Scribd logo
1  sur  35
Revision Control with
Mercurial
Paulo Gandra de Sousa
@pagsousa
•   The need
•   Basic concepts
•   Distributed revision control
•   Best practices
•   Tools




Agenda
• Share and synchronize among team members
• Fast and reliable undo
  • For errors
  • For previous released versions
• Track changes
  • Connect with task & bug management
• Sandboxing




The need
•   Repository
                                           •   Trunk
                                           •   Add
                                           •   Check in


• Revision
• Diff
• Head




Basic concepts
   http://betterexplained.com/articles/a-visual-guide-to-version-control/
•   Check out
•   Working copy
•   Revert
•   Check in




Basic edit flow
     http://betterexplained.com/articles/a-visual-guide-to-version-control/
• Diff
                                                          • Merge
                                                          • Resolve




Handling conflits
 http://betterexplained.com/articles/a-visual-guide-to-version-control/
•   Add
•   Delete
•   Rename
•   Forget

• Lock
    • To avoid




Handling files
• Each user
                                                                     owns a
                                                                     repository and
                                                                     serve it to
                                                                     other users

                                                                   • May use
                                                                     central (by
                                                                     convention)
                                                                     repository




Distributed version control
http://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/
Geographicaly
distributed teams
     http://www.ericsink.com/vcbe/vcbe_a4_lo.pdf
Merge        head
             changeset




                         Head;
                          tip




Revisions, heads, tips
• 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
• 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
• Joel and Rose edit
                                     and commit in their
                                     local repository




• Rose pushes to the
  central repository




                http://hginit.com/02.html
• 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
•   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 developers




Best practices
TOOLS
Mercurial, TortoiseHG, HGE, Netbeans
• 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/MercurialHosting




Mercurial
• 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
• Clone
• Init




Shell extension menu
• Commit

•   Status
•   Add
•   Revert
•   Remove

• Update
• Synchronize




Shell extension menu
Hg Workbench
• Download
  • http://javaforge.com/project/HGE




HGE (Eclipse plugin)
New project
Project context menu
File context menu
Commit
Compare
History
• Download
  • http://netbeans.org/downloads/
• Netbean’s Mercurial User Guide
  • http://netbeans.org/kb/docs/ide/mercurial.html




Netbeans
Clone repository
Context
History
Commit
Push
• 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

Contenu connexe

En vedette

Patterns of Enterprise Application Architecture (by example)
Patterns of Enterprise Application Architecture (by example)Patterns of Enterprise Application Architecture (by example)
Patterns of Enterprise Application Architecture (by example)
Paulo Gandra de Sousa
 
Week 1 Uf 5163
Week 1 Uf 5163Week 1 Uf 5163
Week 1 Uf 5163
Mohd Yusak
 

En vedette (20)

Software Product Lines
Software Product LinesSoftware Product Lines
Software Product Lines
 
Patterns for distributed systems
Patterns for distributed systemsPatterns for distributed systems
Patterns for distributed systems
 
OO design principles and patterns
OO design principles and patternsOO design principles and patterns
OO design principles and patterns
 
Benefits of Hypermedia API
Benefits of Hypermedia APIBenefits of Hypermedia API
Benefits of Hypermedia API
 
REST beyond CRUD
REST beyond CRUDREST beyond CRUD
REST beyond CRUD
 
Patterns of Enterprise Application Architecture (by example)
Patterns of Enterprise Application Architecture (by example)Patterns of Enterprise Application Architecture (by example)
Patterns of Enterprise Application Architecture (by example)
 
Documenting Software Architectures
Documenting Software ArchitecturesDocumenting Software Architectures
Documenting Software Architectures
 
Wonderful world of (distributed) SCM or VCS
Wonderful world of (distributed) SCM or VCSWonderful world of (distributed) SCM or VCS
Wonderful world of (distributed) SCM or VCS
 
Mercurial
MercurialMercurial
Mercurial
 
An Authentication and Authorization Architecture for a Microservices World
An Authentication and Authorization Architecture for a Microservices WorldAn Authentication and Authorization Architecture for a Microservices World
An Authentication and Authorization Architecture for a Microservices World
 
Stateless authentication for microservices
Stateless authentication for microservicesStateless authentication for microservices
Stateless authentication for microservices
 
Software Architecture Document Final
Software Architecture Document FinalSoftware Architecture Document Final
Software Architecture Document Final
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
 
The right to Open Access - obtaining copyright for institutional repositories...
The right to Open Access - obtaining copyright for institutional repositories...The right to Open Access - obtaining copyright for institutional repositories...
The right to Open Access - obtaining copyright for institutional repositories...
 
Pilot Thesaurus of Irish Folklore: a collaborative project by the Digital Rep...
Pilot Thesaurus of Irish Folklore: a collaborative project by the Digital Rep...Pilot Thesaurus of Irish Folklore: a collaborative project by the Digital Rep...
Pilot Thesaurus of Irish Folklore: a collaborative project by the Digital Rep...
 
Week 1 Uf 5163
Week 1 Uf 5163Week 1 Uf 5163
Week 1 Uf 5163
 
CII S'Marketing Convention 2009
CII S'Marketing Convention 2009CII S'Marketing Convention 2009
CII S'Marketing Convention 2009
 
Internet Think Differently
Internet Think DifferentlyInternet Think Differently
Internet Think Differently
 
UCD Connect & the UCD Library - partners in communication : With an overview ...
UCD Connect & the UCD Library - partners in communication : With an overview ...UCD Connect & the UCD Library - partners in communication : With an overview ...
UCD Connect & the UCD Library - partners in communication : With an overview ...
 
EU Tools for all Open Data harmonisation all over Europe
EU Tools for all Open Data harmonisation all over EuropeEU Tools for all Open Data harmonisation all over Europe
EU Tools for all Open Data harmonisation all over Europe
 

Similaire à Revision control with Mercurial

Getting From Folsom to Grizzly - A DevOps Upgrade Pattern.pptx
Getting From Folsom to Grizzly - A DevOps Upgrade Pattern.pptxGetting From Folsom to Grizzly - A DevOps Upgrade Pattern.pptx
Getting From Folsom to Grizzly - A DevOps Upgrade Pattern.pptx
OpenStack Foundation
 
Automating Web Application Deployment
Automating Web Application DeploymentAutomating Web Application Deployment
Automating Web Application Deployment
Mathew Byrne
 
Slide set 7 (Source Code Management History Overview) - Copy.pptx
Slide set 7 (Source Code Management History  Overview) - Copy.pptxSlide set 7 (Source Code Management History  Overview) - Copy.pptx
Slide set 7 (Source Code Management History Overview) - Copy.pptx
UTKARSHBHARDWAJ71
 
Understanding Distributed Source Control
Understanding Distributed Source ControlUnderstanding Distributed Source Control
Understanding Distributed Source Control
Lorna Mitchell
 
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
camp_drupal_ua
 

Similaire à Revision control with Mercurial (20)

GIT In Detail
GIT In DetailGIT In Detail
GIT In Detail
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using Git
 
Source control - what you need to know
Source control - what you need to knowSource control - what you need to know
Source control - what you need to know
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Learning Git
Learning GitLearning Git
Learning Git
 
Source version control using subversion
Source version control using subversionSource version control using subversion
Source version control using subversion
 
Git 101 for CloudStack
Git 101 for CloudStackGit 101 for CloudStack
Git 101 for CloudStack
 
Magento 2 theme structure
Magento 2 theme structureMagento 2 theme structure
Magento 2 theme structure
 
GIT INTRODUCTION
GIT INTRODUCTIONGIT INTRODUCTION
GIT INTRODUCTION
 
Random House
Random HouseRandom House
Random House
 
Getting From Folsom to Grizzly - A DevOps Upgrade Pattern.pptx
Getting From Folsom to Grizzly - A DevOps Upgrade Pattern.pptxGetting From Folsom to Grizzly - A DevOps Upgrade Pattern.pptx
Getting From Folsom to Grizzly - A DevOps Upgrade Pattern.pptx
 
Automating Web Application Deployment
Automating Web Application DeploymentAutomating Web Application Deployment
Automating Web Application Deployment
 
Git Going w/ Git
Git Going w/ GitGit Going w/ Git
Git Going w/ Git
 
Introduction in Apache Maven2
Introduction in Apache Maven2Introduction in Apache Maven2
Introduction in Apache Maven2
 
CSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITCSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GIT
 
SVN
SVNSVN
SVN
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Slide set 7 (Source Code Management History Overview) - Copy.pptx
Slide set 7 (Source Code Management History  Overview) - Copy.pptxSlide set 7 (Source Code Management History  Overview) - Copy.pptx
Slide set 7 (Source Code Management History Overview) - Copy.pptx
 
Understanding Distributed Source Control
Understanding Distributed Source ControlUnderstanding Distributed Source Control
Understanding Distributed Source Control
 
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
 

Plus de Paulo Gandra de Sousa (9)

Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Minds-on DDD
Minds-on DDDMinds-on DDD
Minds-on DDD
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
 
Principles of Service Orientation
Principles of Service OrientationPrinciples of Service Orientation
Principles of Service Orientation
 
Rest web services
Rest web servicesRest web services
Rest web services
 
Lição prova professor coordenador
Lição prova professor coordenadorLição prova professor coordenador
Lição prova professor coordenador
 
Communication
CommunicationCommunication
Communication
 
models of distributed computing
models of distributed computingmodels of distributed computing
models of distributed computing
 
Distributed Systems
Distributed SystemsDistributed Systems
Distributed Systems
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

Revision control with Mercurial

  • 1. Revision Control with Mercurial Paulo Gandra de Sousa @pagsousa
  • 2. The need • Basic concepts • Distributed revision control • Best practices • Tools Agenda
  • 3. • Share and synchronize among team members • Fast and reliable undo • For errors • For previous released versions • Track changes • Connect with task & bug management • Sandboxing The need
  • 4. Repository • Trunk • Add • Check in • Revision • Diff • Head Basic concepts http://betterexplained.com/articles/a-visual-guide-to-version-control/
  • 5. Check out • Working copy • Revert • Check in Basic edit flow http://betterexplained.com/articles/a-visual-guide-to-version-control/
  • 6. • Diff • Merge • Resolve Handling conflits http://betterexplained.com/articles/a-visual-guide-to-version-control/
  • 7. Add • Delete • Rename • Forget • Lock • To avoid Handling files
  • 8. • Each user owns a repository and serve it to other users • May use central (by convention) repository Distributed version control http://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/
  • 9. Geographicaly distributed teams http://www.ericsink.com/vcbe/vcbe_a4_lo.pdf
  • 10. Merge head changeset Head; tip Revisions, heads, tips
  • 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. • 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. • Joel and Rose edit and commit in their local repository • Rose pushes to the central repository http://hginit.com/02.html
  • 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. 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 developers Best practices
  • 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/MercurialHosting Mercurial
  • 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. • Clone • Init Shell extension menu
  • 20. • Commit • Status • Add • Revert • Remove • Update • Synchronize Shell extension menu
  • 22. • Download • http://javaforge.com/project/HGE HGE (Eclipse plugin)
  • 29. • Download • http://netbeans.org/downloads/ • Netbean’s Mercurial User Guide • http://netbeans.org/kb/docs/ide/mercurial.html Netbeans
  • 34. Push
  • 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

Notes de l'éditeur

  1. http://betterexplained.com/articles/a-visual-guide-to-version-control/Large, fast-changing projects with many authors need a Version Control System (geekspeak for “file database”) to track changes and avoid general chaos. A good VCSdoes the following:Backup and Restore. Files are saved as they are edited, and you can jump to any moment in time. Need that file as it was on Feb 23, 2007? No problem.Synchronization. Lets people share files and stay up-to-date with the latest version.Short-term undo. Monkeying with a file and messed it up? (That’s just like you, isn’t it?). Throw away your changes and go back to the “last known good” version in the database.Long-term undo. Sometimes we mess up bad. Suppose you made a change a year ago, and it had a bug. Jump back to the old version, and see what change was made that day.Track Changes. As files are updated, you can leave messages explaining why the change happened (stored in the VCS, not the file). This makes it easy to see how a file is evolving over time, and why.Track Ownership. A VCS tags every change with the name of the person who made it. Helpful for blamestorming giving credit.Sandboxing, or insurance against yourself. Making a big change? You can make temporary changes in an isolated area, test and work out the kinks before “checking in” your changes.Branching and merging. A larger sandbox. You can branch a copy of your code into a separate area and modify it in isolation (tracking changes separately). Later, you can merge your work back into the common area.
  2. http://betterexplained.com/articles/a-visual-guide-to-version-control/Repository (repo): The database storing the files.Trunk/Main: The primary location for code in the repo. Think of code as a family tree — the trunk is the main line.Add: Put a file into the repo for the first time, i.e. begin tracking it with Version Control.Check in: Upload a file to the repository (if it has changed). The file gets a new revision number, and people can “check out” the latest one.Revision: What version a file is on (v1, v2, v3, etc.).Diff/Change/Delta: Finding the differences between two files. Useful for seeing what changed between revisions.Head: The latest revision in the repo.
  3. http://betterexplained.com/articles/a-visual-guide-to-version-control/Check out: Download a file from the repo.Working Set/Working Copy: Your local directory of files, where you make changes.Revert: Throw away your local changes and reload the latest version from the repository.
  4. http://betterexplained.com/articles/a-visual-guide-to-version-control/Merge (or patch): Apply the changes from one file to another, to bring it up-to-date. For example, you can merge features from one branch into another. Conflict: When pending changes to a file contradict each other (both changes cannot be applied).Resolve: Fixing the changes that contradict each other and checking in the correct version.
  5. Use thetooloptions for adding a file to revisioncontrolDon’tdelet files thruthefilesystem -> use thetool to remove the file fromrevisioncontrolSame thing for renamesYou can alsoinstructthe SCMtool to forgetbout some files, i.e., do notincludethem in revisioncontrolanddon’taskagain to includeornotTrynot to use Lockatall!
  6. Distributedrepositories – eachuserowns a “local” copyoftherepositoryUsers can pull/pushchangesfrom/to anyrepository“central” repositorybyconventiononlyHg serve - Mercurial has a built-in light-weight web server which can be used for browsing a repository with a web browser or for allowing remote machines to pull from you.
  7. Easilyhandlegeographicaldistributionof teamsConsider a development team that is split up in two cities. Half the team is in a satellite office in CrabappleCove, Maine, and the other half is at the company’s headquarters in Ottumwa, Iowa. With a CVCS, theyhave to pick one city to hold the central server and everybody in the other city has to access it over an Internetlink. With a DVCS (as shown in Figure 5.1), they can set up a central server in each city and use push andpull to synchronize them whenever as they want.
  8. http://mercurial.selenic.com/wiki/UnderstandingMercurialMercurial groups related changes to multiple files into single atomic changesets, which are revisions of the whole project. These each get a sequential revision number. Because Mercurial allows distributed parallel development, these revision numbers may disagree between users. So Mercurial also assigns each revision a global changeset ID. Changeset IDs are 40-digit hexadecimal numbers, but they can be abbreviated to any unambiguous prefix, like "e38487".Branches and merges in the revision history can occur at any point. Each unmerged branch creates a new head of the revision history. Here, revisions 5 and 6 are heads. Mercurial considers revision 6 to be the tip of the repository, the head with the highest revision number. Revision 4 is a merge changeset, as it has two parent changesets (revisions 2 and 3).
  9. Clone – create a new local repositorybasedon a copyofanotherexsitingrepositoryInit – create a new local repositorywithemptycontentsAdd – add files to versioncontrol (pendingchanges)Status – show pendingchangesCommit – commitpendingchanges. Creates a newchange set in thehistoryoftherepository
  10. Push – sendchange set Pull
  11. AllwaysworkwiththelatestcodeversionShort andfrequentcommitsHandlejustoneissue per commitMakesurethecode compiles and runs (and passes testsifyouhavethen) beforecommitingAfterdoing a mergemakesureyoureviewitandrunalltestsagainbeforecommitingCheckwhatothershavecommited to keepupwiththeprojectcode base
  12. Createprojectfromexistingsourcesiftherepo does notcontain a NB project
  13. “Team” menu onmain menu bar