SlideShare a Scribd company logo
1 of 60
Download to read offline
Distributed Source Control
      With Mercurial
Or, How I Learned to Stop Worrying and Love the Merge




       Ted Naleid - Lead Developer at Carol.com
Overview

•   Introduction
•   SVN (centralized VCS) vs DVCS
•   Current Popular DVCS Alternatives
•   Mercurial (hg) examples
•   Hands on with hg
checkout
      add
    remove
    update    remote
      log     central
    commit     repos
     merge
       ...


                        Build Server




Centralized VCS (SVN)
Alice's
                               repos
                   push
    add             pull
  remove
  update               push               Dave's
    log    Bob's        pull              repos
  commit   repos
    diff
                   push
   merge
                    pull
     ...                        build
                               repos



                                         Build Server




Distributed VCS (Mercurial)
SVN Limitations



DVCS/Mercurial Strengths
Branching is easy, but
     merging is painful


Branching is easy, merging is
     (relatively) easy
Active net connection
   required to interact


If your computer is on, you
have access to the repository
Unable to share changes
with others without sharing
      with everyone
       (including the build server)


   Sharing changes with
  selected people is easy
       (hg serve/hg push/hg pull)
Fails to merge changes when
    something is renamed


 Aware of file history and
can merge into renamed file
.svn files are littered
throughout your source tree


Single .hg directory at root
       of source tree
Slow over-the-wire
      performance


 Fast performance; you’re
working on local filesystem
Discourages experimentation



Cheap to create/throw away
 local experimental branch
SVN Strengths



DVCS/Mercurial
  Limitations
Familiar to most developers



Most developers will need
to learn to think differently
Relatively easy to grasp


Better understanding of
version control concepts
        required
Everyone knows where the
trunk is because there’s only
          one server

Need to define and adhere
 to convention to know
    where the trunk is
Well established tool
  support and integration


Tool support and integration
   isn’t quite as far along
There is a winner among
  free, centralized VCS
    systems: Subversion

DVCS systems are still new
and a clear winner has not
     been established
Popular 2nd Gen DVCS
        Systems
     Git - Bazaar - Mercurial
Git
Created by Linus Torvalds in 2005 after the BitKeeper “debacle”
Git - Website & Hosting

•   Website: http://git.or.cz/
•   Hosting:
    •   http://github.com
    •   http://repo.or.cz
Git - Use in the Wild

•   Linux Kernel
•   One Laptop Per Child (OLPC)
•   Ruby on Rails
•   Lots of other Ruby stuff
•   Written mostly in C
Git - Common Wisdom
•   Fastest of the DVCS systems
•   Unfriendly to non-Linux/Unix systems
•   Complex, with ~150 commands added to path
•   Very popular in the Linux/Ruby communities
•   Probably the most “buzz” off all DVCS systems right
    now
Bazaar (bzr)
Created by Canonical, Ltd. (creators of Ubuntu) in 2005
Bazaar - Website & Hosting


•   Website: http://bazaar-vcs.org/
•   Hosting: https://launchpad.net/
Bazaar - Use in the Wild

•   Ubuntu
•   Drupal
•   Fairly big in Python community
    •   it’s written mostly in Python
Bazaar - Common Wisdom
•   Has gone through lots of revisions/changed formats
•   Slowest of the 3
•   Migration of an existing SVN repository is REALLY
    slow
•   Made to be friendly, similar to SVN
•   Smallest market share
Mercurial (hg)
Created by Matt Mackall in 2005 after the BitKeeper “debacle”
Mercurial - Website &
              Hosting
•   Website: http://www.selenic.com/mercurial/
•   Hosting:
    •   http://freehg.org/
    •   http://sharesource.org/
Mercurial - Use in the Wild
•   OpenJDK (Java)
•   OpenSolaris
•   Mozilla
•   NetBeans
•   Many others (largely Java/Python related)
    •   Like Bazaar, it’s mostly written in Python
Mercurial - Common Wisdom
 •   Similar syntax to SVN
 •   Slightly slower than Git, but faster than Bazaar
 •   Good cross-platform support
 •   Getting good support from large Java projects
     (OpenJDK, NetBeans, etc)
 •   Lower maintenance and easier learning curve than
     Git
Why did I choose
Mercurial over Git/Bazaar?
Similar commands to SVN
•   hg add
•   hg remove
•   hg update
•   hg log
•   hg status
•   It’s like SVN but with the ability to “push” and “pull”
Better cross platform support
and growing tool integration
No “packing” of the
repository is necessary
Local revision numbers are
        “friendly”
It’s used by a number of big
         Java projects
It’s the first one I tried :)
All 3 of these tools look
        fantastic.
Mercurial Usage Examples
        How do I do X?
portal/**                  portal/.hg

                hg init
  local                        local
   file       hg addremove
                              repos
 system       hg commit




Create a new repository
portal/**                      portal/.hg                       http://hg01/repos/portal


   local     creates tip files      local                                   remote
    file                                              hg clone
              on filesystem        repos                                     repos
  system
                                             hg clone http://hg01/repos/portal




“Checkout” an Existing Repository
portal/**                     portal/.hg             http://hg01/repos/portal

 local                                        hg pull
                                 local                       remote
  file
            hg update           repos                         repos
system

              quot;hg pull -uquot; will do this in one command




   Pull down the latest changes
                (no conflicts with local changes)
local file changes
                                     portal/.hg                         http://hg01/repos/portal
                hg commit
                   conflict!                                   hg pull
  local       files unchanged!    hg update
                                                   local                        remote
   file                  hg merge                  repos                          repos
 system
                       hg commit
                                quot;hg fetchquot; will pull->update->merge->commit in one command




       Pull down the latest changes
                      (conflicts detected with local changes)
local file changes
                                      portal/.hg           http://hg01/repos/portal
                       hg add
     local            hg remove
                    hg addremove         local                     remote
      file                                                           repos
                     hg commit          repos
    system
                                                    hg push




Push changes to another repository
         (by default, push will refuse to run if it would require a merge)
http://hg01/repos/portal
portal/.hg

             hg incoming           remote
  local
                                    repos
 repos       hg outgoing




Do a push/pull dry run
portal/.hg


                                           local
        Branching is done by              repos
     simply cloning a repository                            hg clone
                                                     hg clone portal portal-clone
portal-clone/**                      portal-clone/.hg

    local         creates tip files         local
     file           on filesystem           repos
   system




   Create a new “branch”
             (experimenting is cheap and easy)
local file changes
                                     portal/.hg

     local               hg diff
      file              hg status        local
    system             hg identify     repos




Compare file system with repository
portal/.hg
     hg log
  hg annotate
     hg cat         local
    hg grep        repos
   hg serve




Query repository for info
Hands on with Hg
Creating new repository
Cloning repository/
    branching
Pushing changes to another
        repository
Merging conflicting changes
Creating a tag
Searching through history
Viewing repository through
     a web browser
A quick way to stick your toes in
       and try Mercurial out:
use it as a “Super Client” for SVN
Web Resources
•   Choosing a distributed version control system
          http://www.dribin.org/dave/blog/archives/2007/12/28/dvcs/

•   Understanding Mercurial
         http://www.selenic.com/mercurial/wiki/index.cgi/UnderstandingMercurial

•   Version Control and the “80%” (DVCS counterpoint)
         http://blog.red-bean.com/sussman/?p=79

•   Mercurial Book
         http://hgbook.red-bean.com/hgbook.html

•   Video of Bryan O’Sullivan (creator of the Mercurial Book)
         http://video.google.com/videoplay?docid=-7724296011317502612
Questions?

More Related Content

What's hot

Using Docker in the Real World
Using Docker in the Real WorldUsing Docker in the Real World
Using Docker in the Real WorldTim Haak
 
Docker Tips And Tricks at the Docker Beijing Meetup
Docker Tips And Tricks at the Docker Beijing MeetupDocker Tips And Tricks at the Docker Beijing Meetup
Docker Tips And Tricks at the Docker Beijing MeetupJérôme Petazzoni
 
Solving Real World Production Problems with Docker
Solving Real World Production Problems with DockerSolving Real World Production Problems with Docker
Solving Real World Production Problems with DockerMarc Campbell
 
Microservices. Microservices everywhere! (At OSCON 2015)
Microservices. Microservices everywhere! (At OSCON 2015)Microservices. Microservices everywhere! (At OSCON 2015)
Microservices. Microservices everywhere! (At OSCON 2015)Jérôme Petazzoni
 
Puppet and Vagrant in development
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in developmentAdam Culp
 
What's New in Docker 1.12 by Nishant Totla for Docker SF Meetup 08.03.16
What's New in Docker 1.12 by Nishant Totla for Docker SF Meetup 08.03.16 What's New in Docker 1.12 by Nishant Totla for Docker SF Meetup 08.03.16
What's New in Docker 1.12 by Nishant Totla for Docker SF Meetup 08.03.16 Docker, Inc.
 
7 Ways to Optimize Hudson in Production
7 Ways to Optimize Hudson in Production7 Ways to Optimize Hudson in Production
7 Ways to Optimize Hudson in ProductionCloudBees
 
Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015Jérôme Petazzoni
 
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...Lucas Jellema
 
Containerization is more than the new Virtualization: enabling separation of ...
Containerization is more than the new Virtualization: enabling separation of ...Containerization is more than the new Virtualization: enabling separation of ...
Containerization is more than the new Virtualization: enabling separation of ...Jérôme Petazzoni
 
Docker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken CochraneDocker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken CochranedotCloud
 
Docker - From Walking To Running
Docker - From Walking To RunningDocker - From Walking To Running
Docker - From Walking To RunningGiacomo Vacca
 
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, OrchestrationThe Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, OrchestrationErica Windisch
 
Version Control & Git
Version Control & GitVersion Control & Git
Version Control & GitCraig Smith
 
Learn docker in 90 minutes
Learn docker in 90 minutesLearn docker in 90 minutes
Learn docker in 90 minutesLarry Cai
 
Shifter: Containers in HPC Environments
Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments
Shifter: Containers in HPC Environmentsinside-BigData.com
 

What's hot (18)

Introduce to SVN
Introduce to SVNIntroduce to SVN
Introduce to SVN
 
Using Docker in the Real World
Using Docker in the Real WorldUsing Docker in the Real World
Using Docker in the Real World
 
Docker Tips And Tricks at the Docker Beijing Meetup
Docker Tips And Tricks at the Docker Beijing MeetupDocker Tips And Tricks at the Docker Beijing Meetup
Docker Tips And Tricks at the Docker Beijing Meetup
 
Solving Real World Production Problems with Docker
Solving Real World Production Problems with DockerSolving Real World Production Problems with Docker
Solving Real World Production Problems with Docker
 
Microservices. Microservices everywhere! (At OSCON 2015)
Microservices. Microservices everywhere! (At OSCON 2015)Microservices. Microservices everywhere! (At OSCON 2015)
Microservices. Microservices everywhere! (At OSCON 2015)
 
Docker by Example - Quiz
Docker by Example - QuizDocker by Example - Quiz
Docker by Example - Quiz
 
Puppet and Vagrant in development
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in development
 
What's New in Docker 1.12 by Nishant Totla for Docker SF Meetup 08.03.16
What's New in Docker 1.12 by Nishant Totla for Docker SF Meetup 08.03.16 What's New in Docker 1.12 by Nishant Totla for Docker SF Meetup 08.03.16
What's New in Docker 1.12 by Nishant Totla for Docker SF Meetup 08.03.16
 
7 Ways to Optimize Hudson in Production
7 Ways to Optimize Hudson in Production7 Ways to Optimize Hudson in Production
7 Ways to Optimize Hudson in Production
 
Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015
 
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
 
Containerization is more than the new Virtualization: enabling separation of ...
Containerization is more than the new Virtualization: enabling separation of ...Containerization is more than the new Virtualization: enabling separation of ...
Containerization is more than the new Virtualization: enabling separation of ...
 
Docker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken CochraneDocker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken Cochrane
 
Docker - From Walking To Running
Docker - From Walking To RunningDocker - From Walking To Running
Docker - From Walking To Running
 
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, OrchestrationThe Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
 
Version Control & Git
Version Control & GitVersion Control & Git
Version Control & Git
 
Learn docker in 90 minutes
Learn docker in 90 minutesLearn docker in 90 minutes
Learn docker in 90 minutes
 
Shifter: Containers in HPC Environments
Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments
Shifter: Containers in HPC Environments
 

Similar to Dvcs With Mercurial (No Notes)

The Source Control Landscape
The Source Control LandscapeThe Source Control Landscape
The Source Control LandscapeLorna Mitchell
 
Introduction of Google Code and Mercurial
Introduction of Google Code and MercurialIntroduction of Google Code and Mercurial
Introduction of Google Code and MercurialFred Lin
 
Git - Intro to the Basics of DVCS
Git - Intro to the Basics of DVCSGit - Intro to the Basics of DVCS
Git - Intro to the Basics of DVCSMatthew McCullough
 
Git - Intro to the Basics of DVCS
Git - Intro to the Basics of DVCSGit - Intro to the Basics of DVCS
Git - Intro to the Basics of DVCSMatthew McCullough
 
AtlasCamp 2010: What is DVCS and why it will change the way we work - Jens Sc...
AtlasCamp 2010: What is DVCS and why it will change the way we work - Jens Sc...AtlasCamp 2010: What is DVCS and why it will change the way we work - Jens Sc...
AtlasCamp 2010: What is DVCS and why it will change the way we work - Jens Sc...Atlassian
 
Version Control with SVN
Version Control with SVNVersion Control with SVN
Version Control with SVNPHPBelgium
 
Source version control using subversion
Source version control using subversionSource version control using subversion
Source version control using subversionMangesh Bhujbal
 
Deployment With Subversion - Lorna Mitchell
Deployment With Subversion - Lorna MitchellDeployment With Subversion - Lorna Mitchell
Deployment With Subversion - Lorna Mitchelldpc
 
PHP Deployment With SVN
PHP Deployment With SVNPHP Deployment With SVN
PHP Deployment With SVNLorna Mitchell
 
Shipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with DockerShipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with DockerJérôme Petazzoni
 
WordPress Development Environments
WordPress Development Environments WordPress Development Environments
WordPress Development Environments Ohad Raz
 
DockerCon SF 2015: Docker in the New York Times Newsroom
DockerCon SF 2015: Docker in the New York Times NewsroomDockerCon SF 2015: Docker in the New York Times Newsroom
DockerCon SF 2015: Docker in the New York Times NewsroomDocker, Inc.
 
Version Control Systems -- Git -- Part I
Version Control Systems -- Git -- Part IVersion Control Systems -- Git -- Part I
Version Control Systems -- Git -- Part ISergey Aganezov
 
Stress Free Deployment - Confoo 2011
Stress Free Deployment  - Confoo 2011Stress Free Deployment  - Confoo 2011
Stress Free Deployment - Confoo 2011Bachkoutou Toutou
 
Version Control With Subversion
Version Control With SubversionVersion Control With Subversion
Version Control With SubversionSamnang Chhun
 

Similar to Dvcs With Mercurial (No Notes) (20)

The Source Control Landscape
The Source Control LandscapeThe Source Control Landscape
The Source Control Landscape
 
Introduction of Google Code and Mercurial
Introduction of Google Code and MercurialIntroduction of Google Code and Mercurial
Introduction of Google Code and Mercurial
 
Git 101 for CloudStack
Git 101 for CloudStackGit 101 for CloudStack
Git 101 for CloudStack
 
Git - Intro to the Basics of DVCS
Git - Intro to the Basics of DVCSGit - Intro to the Basics of DVCS
Git - Intro to the Basics of DVCS
 
Git - Intro to the Basics of DVCS
Git - Intro to the Basics of DVCSGit - Intro to the Basics of DVCS
Git - Intro to the Basics of DVCS
 
AtlasCamp 2010: What is DVCS and why it will change the way we work - Jens Sc...
AtlasCamp 2010: What is DVCS and why it will change the way we work - Jens Sc...AtlasCamp 2010: What is DVCS and why it will change the way we work - Jens Sc...
AtlasCamp 2010: What is DVCS and why it will change the way we work - Jens Sc...
 
Version Control with SVN
Version Control with SVNVersion Control with SVN
Version Control with SVN
 
Source version control using subversion
Source version control using subversionSource version control using subversion
Source version control using subversion
 
Deployment With Subversion - Lorna Mitchell
Deployment With Subversion - Lorna MitchellDeployment With Subversion - Lorna Mitchell
Deployment With Subversion - Lorna Mitchell
 
PHP Deployment With SVN
PHP Deployment With SVNPHP Deployment With SVN
PHP Deployment With SVN
 
Shipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with DockerShipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with Docker
 
Git presentation
Git presentationGit presentation
Git presentation
 
빈스톡 첫인상 with Git
빈스톡 첫인상 with Git빈스톡 첫인상 with Git
빈스톡 첫인상 with Git
 
WordPress Development Environments
WordPress Development Environments WordPress Development Environments
WordPress Development Environments
 
DockerCon SF 2015: Docker in the New York Times Newsroom
DockerCon SF 2015: Docker in the New York Times NewsroomDockerCon SF 2015: Docker in the New York Times Newsroom
DockerCon SF 2015: Docker in the New York Times Newsroom
 
Version Control Systems -- Git -- Part I
Version Control Systems -- Git -- Part IVersion Control Systems -- Git -- Part I
Version Control Systems -- Git -- Part I
 
Git
GitGit
Git
 
Stress Free Deployment - Confoo 2011
Stress Free Deployment  - Confoo 2011Stress Free Deployment  - Confoo 2011
Stress Free Deployment - Confoo 2011
 
Version Control With Subversion
Version Control With SubversionVersion Control With Subversion
Version Control With Subversion
 
Git 101
Git 101Git 101
Git 101
 

Recently uploaded

JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuidePixlogix Infotech
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxFIDO Alliance
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseWSO2
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMKumar Satyam
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityVictorSzoltysek
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformWSO2
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfdanishmna97
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...caitlingebhard1
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch TuesdayIvanti
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Paige Cruz
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data SciencePaolo Missier
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightSafe Software
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxFIDO Alliance
 

Recently uploaded (20)

JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptx
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern Enterprise
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cf
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 

Dvcs With Mercurial (No Notes)

  • 1. Distributed Source Control With Mercurial Or, How I Learned to Stop Worrying and Love the Merge Ted Naleid - Lead Developer at Carol.com
  • 2. Overview • Introduction • SVN (centralized VCS) vs DVCS • Current Popular DVCS Alternatives • Mercurial (hg) examples • Hands on with hg
  • 3. checkout add remove update remote log central commit repos merge ... Build Server Centralized VCS (SVN)
  • 4. Alice's repos push add pull remove update push Dave's log Bob's pull repos commit repos diff push merge pull ... build repos Build Server Distributed VCS (Mercurial)
  • 6. Branching is easy, but merging is painful Branching is easy, merging is (relatively) easy
  • 7. Active net connection required to interact If your computer is on, you have access to the repository
  • 8. Unable to share changes with others without sharing with everyone (including the build server) Sharing changes with selected people is easy (hg serve/hg push/hg pull)
  • 9. Fails to merge changes when something is renamed Aware of file history and can merge into renamed file
  • 10. .svn files are littered throughout your source tree Single .hg directory at root of source tree
  • 11. Slow over-the-wire performance Fast performance; you’re working on local filesystem
  • 12. Discourages experimentation Cheap to create/throw away local experimental branch
  • 14. Familiar to most developers Most developers will need to learn to think differently
  • 15. Relatively easy to grasp Better understanding of version control concepts required
  • 16. Everyone knows where the trunk is because there’s only one server Need to define and adhere to convention to know where the trunk is
  • 17. Well established tool support and integration Tool support and integration isn’t quite as far along
  • 18. There is a winner among free, centralized VCS systems: Subversion DVCS systems are still new and a clear winner has not been established
  • 19. Popular 2nd Gen DVCS Systems Git - Bazaar - Mercurial
  • 20. Git Created by Linus Torvalds in 2005 after the BitKeeper “debacle”
  • 21. Git - Website & Hosting • Website: http://git.or.cz/ • Hosting: • http://github.com • http://repo.or.cz
  • 22. Git - Use in the Wild • Linux Kernel • One Laptop Per Child (OLPC) • Ruby on Rails • Lots of other Ruby stuff • Written mostly in C
  • 23. Git - Common Wisdom • Fastest of the DVCS systems • Unfriendly to non-Linux/Unix systems • Complex, with ~150 commands added to path • Very popular in the Linux/Ruby communities • Probably the most “buzz” off all DVCS systems right now
  • 24. Bazaar (bzr) Created by Canonical, Ltd. (creators of Ubuntu) in 2005
  • 25. Bazaar - Website & Hosting • Website: http://bazaar-vcs.org/ • Hosting: https://launchpad.net/
  • 26. Bazaar - Use in the Wild • Ubuntu • Drupal • Fairly big in Python community • it’s written mostly in Python
  • 27. Bazaar - Common Wisdom • Has gone through lots of revisions/changed formats • Slowest of the 3 • Migration of an existing SVN repository is REALLY slow • Made to be friendly, similar to SVN • Smallest market share
  • 28. Mercurial (hg) Created by Matt Mackall in 2005 after the BitKeeper “debacle”
  • 29. Mercurial - Website & Hosting • Website: http://www.selenic.com/mercurial/ • Hosting: • http://freehg.org/ • http://sharesource.org/
  • 30. Mercurial - Use in the Wild • OpenJDK (Java) • OpenSolaris • Mozilla • NetBeans • Many others (largely Java/Python related) • Like Bazaar, it’s mostly written in Python
  • 31. Mercurial - Common Wisdom • Similar syntax to SVN • Slightly slower than Git, but faster than Bazaar • Good cross-platform support • Getting good support from large Java projects (OpenJDK, NetBeans, etc) • Lower maintenance and easier learning curve than Git
  • 32. Why did I choose Mercurial over Git/Bazaar?
  • 33. Similar commands to SVN • hg add • hg remove • hg update • hg log • hg status • It’s like SVN but with the ability to “push” and “pull”
  • 34. Better cross platform support and growing tool integration
  • 35. No “packing” of the repository is necessary
  • 36. Local revision numbers are “friendly”
  • 37. It’s used by a number of big Java projects
  • 38. It’s the first one I tried :)
  • 39. All 3 of these tools look fantastic.
  • 40. Mercurial Usage Examples How do I do X?
  • 41. portal/** portal/.hg hg init local local file hg addremove repos system hg commit Create a new repository
  • 42. portal/** portal/.hg http://hg01/repos/portal local creates tip files local remote file hg clone on filesystem repos repos system hg clone http://hg01/repos/portal “Checkout” an Existing Repository
  • 43. portal/** portal/.hg http://hg01/repos/portal local hg pull local remote file hg update repos repos system quot;hg pull -uquot; will do this in one command Pull down the latest changes (no conflicts with local changes)
  • 44. local file changes portal/.hg http://hg01/repos/portal hg commit conflict! hg pull local files unchanged! hg update local remote file hg merge repos repos system hg commit quot;hg fetchquot; will pull->update->merge->commit in one command Pull down the latest changes (conflicts detected with local changes)
  • 45. local file changes portal/.hg http://hg01/repos/portal hg add local hg remove hg addremove local remote file repos hg commit repos system hg push Push changes to another repository (by default, push will refuse to run if it would require a merge)
  • 46. http://hg01/repos/portal portal/.hg hg incoming remote local repos repos hg outgoing Do a push/pull dry run
  • 47. portal/.hg local Branching is done by repos simply cloning a repository hg clone hg clone portal portal-clone portal-clone/** portal-clone/.hg local creates tip files local file on filesystem repos system Create a new “branch” (experimenting is cheap and easy)
  • 48. local file changes portal/.hg local hg diff file hg status local system hg identify repos Compare file system with repository
  • 49. portal/.hg hg log hg annotate hg cat local hg grep repos hg serve Query repository for info
  • 53. Pushing changes to another repository
  • 58. A quick way to stick your toes in and try Mercurial out: use it as a “Super Client” for SVN
  • 59. Web Resources • Choosing a distributed version control system http://www.dribin.org/dave/blog/archives/2007/12/28/dvcs/ • Understanding Mercurial http://www.selenic.com/mercurial/wiki/index.cgi/UnderstandingMercurial • Version Control and the “80%” (DVCS counterpoint) http://blog.red-bean.com/sussman/?p=79 • Mercurial Book http://hgbook.red-bean.com/hgbook.html • Video of Bryan O’Sullivan (creator of the Mercurial Book) http://video.google.com/videoplay?docid=-7724296011317502612