SlideShare uma empresa Scribd logo
1 de 84
Baixar para ler offline
distributed version
               control with mercurial
                   or: how I learned to stop worrying and love the merge




                                    Presented by Ted Naleid

Wednesday, November 4, 2009
overview
                              robust and mature
                              “centralized” and “distributed”
                              advantages over subversion
                              why svn merging is broken
                              subversion’s advantages
                              comparison to git
                              concepts
                              basic usage
                              how to get started



Wednesday, November 4, 2009
mercurial is robust
                          and mature


Wednesday, November 4, 2009
large projects
                                    Python
                                    Mozilla
                                  NetBeans
                                 OpenOffice
                                 OpenSolaris
                                  OpenJDK
                                 Symbian OS
                                Xen Hypervisor




Wednesday, November 4, 2009
cross platform support
                               great command line on win/mac/linux




                                 standalone GUIs
                                      windows - TortiseHG
                                          mac - murky
                                           linux - hgk



Wednesday, November 4, 2009
IDE support
                                   IntelliJ
                                   Eclipse
                                 NetBeans
                                Visual Studio
                                 TextMate
                                   BBEdit
                                   emacs
                                      vi




Wednesday, November 4, 2009
continuous integration and
                          bug tracking
                                      Hudson
                                   Cruise Control
                                      BuildBot
                                      Bamboo
                                     TeamCity
                                        JIRA
                                        Trac
                                    FogBugz/Kiln

                              + support in maven and ant


Wednesday, November 4, 2009
internet hosting
                                    bitbucket
                                  Google Code
                                  SourceForge
                                   kenai (Sun)




Wednesday, November 4, 2009
Build Server




                                commit
                                         Remote
                                update    Repo




                              centralized version
                                control systems
Wednesday, November 4, 2009
Build Server

                                                           Build
                                                           Repo




                                                 sh
                                                 pu
                                                      ll
                                                  pu
                              commit
                                       Alice's                         Carl's
                              update   Repo                            Repo




                                                           Bob's
                                                           Repo




                              distributed version
                                control system
Wednesday, November 4, 2009
Build Server

                                                           Build
                                                           Repo




                                                  sh
                                                 pu
                                                      ll
                                                  pu
                              commit                       push
                                       Alice's                         Carl's
                              update   Repo                pull        Repo




                                                  pu
                                                      sh
                                                 pu
                                                 ll
                                                           Bob's
                                                           Repo




                              distributed version
                                control system
Wednesday, November 4, 2009
subversion limitations



                      mercurial strengths
Wednesday, November 4, 2009
shared
                              remote repository



                                   owned
                               local repository

Wednesday, November 4, 2009
requires active net
                                 connection




                               always available

Wednesday, November 4, 2009
slow over-the-wire
                                    access




                              speedy local access

Wednesday, November 4, 2009
single point of failure




                      multiple redundant copies

Wednesday, November 4, 2009
working with branches
                               is slow and painful



                                simple, in-place
                                branch switching
                                    hg update branch_name




Wednesday, November 4, 2009
expensive public
                              branches discourage
                                experimentation


                                  cheap, easy
                              branches encourage
                                experimentation
Wednesday, November 4, 2009
saving state is
                      intertwined with releasing



                         save whenever, push out
                             when it’s ready

Wednesday, November 4, 2009
would you use a word
                    processor that only let you
                       save at the end of a
                          paragraph?


Wednesday, November 4, 2009
litters workspace
                              with .svn directories



                              single .hg directory
                                 at project root

Wednesday, November 4, 2009
time to set up new
                              repository limits use



                                 instant setup
                               enables new uses
                                            hg init
                                             hg add
                                  hg commit -m “first commit”



Wednesday, November 4, 2009
merging is messy,
                              dangerous and often
                                   avoided



                         merging is the core
                      operation so it’s done well

Wednesday, November 4, 2009
why is subversion
                       merging so broken
                          and scary?

Wednesday, November 4, 2009
#1
                    when there are conflicts,
                  you’re forced to merge into
                   an unsaved working copy


Wednesday, November 4, 2009
#2
                 when there are no conflicts,
                 you aren’t forced to merge
                              this is a bug, not a feature




Wednesday, November 4, 2009
in mercurial, you commit
                        before pulling new code
                     only fully formed changes
                           get pushed out
                   history is always preserved

Wednesday, November 4, 2009
merging is a common, trivial
                        operation
                    a merge occurs every time
                     you pull down new code


Wednesday, November 4, 2009
subversion strengths


                               mercurial
                              limitations
Wednesday, November 4, 2009
familiar




                              new ideas require
                               understanding

Wednesday, November 4, 2009
very strong
                               tool support




                              tool support not
                                 as mature

Wednesday, November 4, 2009
better choice for lots of
                                 huge binary files




                                  not optimal for
                                 huge binary files

Wednesday, November 4, 2009
everyone knows where
                      the canonical repository is



                              convention defines
                              where to push/pull
                                    from
Wednesday, November 4, 2009
checking out part of a
                                repository is easy



                               no easy way to get
                                 only part of a
                                   repository
Wednesday, November 4, 2009
allows empty directories




                              tracks files, so empty
                                directories aren’t
                                      saved
Wednesday, November 4, 2009
subversion is the clear
                            leader in free
                      centralized version control



                              annoying holy war
                                 raging over
                                  hg vs. git
Wednesday, November 4, 2009
mercurial          git


Wednesday, November 4, 2009
easy local              md5 is easy,
  revision numbers              right?



Wednesday, November 4, 2009
plugin design with            kitchen sink
   basic default
   functionality                 design



Wednesday, November 4, 2009
better        slower http
performance over performance, no
http, built-in quick easy built-in
       server           serverhg serve




Wednesday, November 4, 2009
works well on windows support
      windows, mac,  is lacking and
         and linux     low priority



Wednesday, November 4, 2009
history is                      rewriting history
                     sacred                          is a badge of
   (though you can commit sacrilege with plugins)        honor



Wednesday, November 4, 2009
mercurial concepts


Wednesday, November 4, 2009
change sets are stored as
                          nodes in a DAG
                              (directed acyclic graph)

                                                   tip

                                newest   r3
                                                         file system version

                                              r2
                                time




                                              r1



                                oldest        r0




Wednesday, November 4, 2009
a change set with no
                              children is a “head”

                                      r3



                                           r2



                                           r1



                                           r0




Wednesday, November 4, 2009
change sets have zero, one
                       or two parents



Wednesday, November 4, 2009
the root has zero parents
                                       r4



                                  r3



                                       r2



                                       r1



                                       r0




Wednesday, November 4, 2009
normal commits have
                                  one parent
                                           r4



                                      r3



                                           r2



                                           r1



                                           r0




Wednesday, November 4, 2009
merges have two parents
                                     r4



                                r3



                                     r2



                                     r1



                                     r0




Wednesday, November 4, 2009
branch name is determined
                      by the first parent
                                   r4   branch: default         r4        branch: release_1.x


                              r3        branch: release_1.x     r3        branch: release_1.x


                                   r2   branch: default              r2   branch: default


                                   r1                                r1


                                   r0                                r0


                       first parent is r2                      first parent is r3


Wednesday, November 4, 2009
history is immutable




Wednesday, November 4, 2009
merging only happens in
                         your local repository



Wednesday, November 4, 2009
that’s it!




Wednesday, November 4, 2009
mercurial usage


Wednesday, November 4, 2009
hg   status    <->   svn   status
                              hg   log       <->   svn   log
                              hg   diff      <->   svn   diff
                              hg   cat       <->   svn   cat

          familiar basic      hg

                              hg
                                   blame

                                   add
                                             <->

                                             <->
                                                   svn

                                                   svn
                                                         blame

                                                         add
           commands           hg
                              hg
                              hg
                                   remove
                                   rename
                                   update
                                             <->
                                             <->
                                             <->
                                                   svn
                                                   svn
                                                   svn
                                                         remove
                                                         rename
                                                         update
                              hg   resolve   <->   svn   resolve
                              hg   commit    <->   svn   commit
                              hg   merge     <->   svn   merge




Wednesday, November 4, 2009
hg init
                              hg add
                              hg commit -m “project start”




          create a new                r0   “project start”

            repository



Wednesday, November 4, 2009
<changes ...>
                              hg commit -m “created domain”




   commit changes
       to your                     r1   “created domain”



   local repository                r0   “project start”




Wednesday, November 4, 2009
<more changes...>
                              hg commit -m “updated user”




   commit changes
       to your                     r2   “updated user”



   local repository                r1   “created domain”



                                   r0   “project start”




Wednesday, November 4, 2009
hg update -r 1




    switch your file
      system to a             r2   “updated user”



   different revision         r1   “created domain”



                              r0   “project start”




Wednesday, November 4, 2009
hg branch release_1.0.x
                                   <changes...>
                                   hg commit -m “fix role”



                                          “fix role”
                              r3
                                          branch: release_1.x



    create a branch                  r2
                                          “updated user”
                                          branch: default


                                          “created domain”
                                     r1
                                          branch: default


                                          “project start”
                                     r0
                                          branch: default




Wednesday, November 4, 2009
hg update default




                                        “fix role”
                              r3
                                        branch: release_1.x

     merge changes                 r2
                                        “updated user”
                                        branch: default

     from a branch                 r1
                                        “created domain”
                                        branch: default


                                        “project start”
                                   r0
                                        branch: default




Wednesday, November 4, 2009
hg merge release_1.x
                              <resolve any conflicts>
                              hg commit -m “merged branch”

                                   r4    “merged branch”


                                        “fix role”
                              r3
                                        branch: release_1.x

     merge changes                 r2   “updated user”

     from a branch                 r1   “created domain”



                                   r0   “project start”




Wednesday, November 4, 2009
hg clone http://path.to.repo




       get an existing           b               b



         repository              a               a


                               remote          local




Wednesday, November 4, 2009
hg pull




         get the latest         c

         changes from           b                  b

            another
           repository           a

                              remote
                                                   a


                                                 local




Wednesday, November 4, 2009
hg pull




          pull adds             c                  c

        changes but             b                  b

       doesn’t modify
         file system            a

                              remote
                                                   a

                                                 local




Wednesday, November 4, 2009
hg update




   update your                  c                 c



 working directory              b                 b


 with the changes               a                 a

                              remote            local




Wednesday, November 4, 2009
what if you’ve already made
               a change in your repository?



Wednesday, November 4, 2009
hg pull




   we added c to b              d                  c



                                b                  b



they added d to b               a                  a

                              remote             local




Wednesday, November 4, 2009
hg pull


                                             d



                                d                  c

   pulling in d gives           b                  b

    us a new head               a                  a


                              remote             local




Wednesday, November 4, 2009
hg update
                                       # abort, crosses branches

                                             d


  when we try to                d                  c

 update to the tip,             b                  b

 hg says you need
     to merge                   a

                              remote
                                                   a


                                                 local




Wednesday, November 4, 2009
hg merge
                                                                    <resolve any conflicts>
                                                                    hg commit -m “merge done”

                                                                                       e



                                                                                 d



                                                                        d              c

   merge the                                                            b              b

changes together
                                                                        a              a


                                                                   remote            local




                                 hg fetch does all this in one command
                              (pull, update, merge, commit) use that instead


Wednesday, November 4, 2009
hg push

                                                   e



                                             d



                                d                  c

         push changes           b                  b

           back out
                                a                  a


                              remote             local




Wednesday, November 4, 2009
hg push

                                    e                  e



                              d                  d



                                    c                  c

         push changes               b                  b

           back out
                                    a                  a


                                  remote             local




Wednesday, November 4, 2009
how to get started
                           with mercurial


Wednesday, November 4, 2009
watch the peepcode
                                  screencast




                                     $9, cheap!



Wednesday, November 4, 2009
read the book




                                  free online!



Wednesday, November 4, 2009
install it




Wednesday, November 4, 2009
start small




Wednesday, November 4, 2009
convert your existing
                                  repository



Wednesday, November 4, 2009
commit and share often




Wednesday, November 4, 2009
install and learn to use a
                            3-way merge tool



Wednesday, November 4, 2009
profit!




Wednesday, November 4, 2009
links
                                      mercurial wiki/download
                                       http://mercurial.selenic.com

                              O’Reilly’s Mercurial - The Definitive Guide
                                    http://hgbook.red-bean.com/ (free!)

                                   peepcode intro screencast ($9)
                                http://peepcode.com/products/meet-mercurial

                                      mercurial branching info
       http://stevelosh.com/blog/entry/2009/8/30/a-guide-to-branching-in-mercurial/

                                        ACM article on DVCS
                                     http://preview.tinyurl.com/qezmta




Wednesday, November 4, 2009
Questions?


Wednesday, November 4, 2009

Mais conteúdo relacionado

Último

Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 

Último (20)

Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 

Destaque

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destaque (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Distributed Version Control with Mercurial

  • 1. distributed version control with mercurial or: how I learned to stop worrying and love the merge Presented by Ted Naleid Wednesday, November 4, 2009
  • 2. overview robust and mature “centralized” and “distributed” advantages over subversion why svn merging is broken subversion’s advantages comparison to git concepts basic usage how to get started Wednesday, November 4, 2009
  • 3. mercurial is robust and mature Wednesday, November 4, 2009
  • 4. large projects Python Mozilla NetBeans OpenOffice OpenSolaris OpenJDK Symbian OS Xen Hypervisor Wednesday, November 4, 2009
  • 5. cross platform support great command line on win/mac/linux standalone GUIs windows - TortiseHG mac - murky linux - hgk Wednesday, November 4, 2009
  • 6. IDE support IntelliJ Eclipse NetBeans Visual Studio TextMate BBEdit emacs vi Wednesday, November 4, 2009
  • 7. continuous integration and bug tracking Hudson Cruise Control BuildBot Bamboo TeamCity JIRA Trac FogBugz/Kiln + support in maven and ant Wednesday, November 4, 2009
  • 8. internet hosting bitbucket Google Code SourceForge kenai (Sun) Wednesday, November 4, 2009
  • 9. Build Server commit Remote update Repo centralized version control systems Wednesday, November 4, 2009
  • 10. Build Server Build Repo sh pu ll pu commit Alice's Carl's update Repo Repo Bob's Repo distributed version control system Wednesday, November 4, 2009
  • 11. Build Server Build Repo sh pu ll pu commit push Alice's Carl's update Repo pull Repo pu sh pu ll Bob's Repo distributed version control system Wednesday, November 4, 2009
  • 12. subversion limitations mercurial strengths Wednesday, November 4, 2009
  • 13. shared remote repository owned local repository Wednesday, November 4, 2009
  • 14. requires active net connection always available Wednesday, November 4, 2009
  • 15. slow over-the-wire access speedy local access Wednesday, November 4, 2009
  • 16. single point of failure multiple redundant copies Wednesday, November 4, 2009
  • 17. working with branches is slow and painful simple, in-place branch switching hg update branch_name Wednesday, November 4, 2009
  • 18. expensive public branches discourage experimentation cheap, easy branches encourage experimentation Wednesday, November 4, 2009
  • 19. saving state is intertwined with releasing save whenever, push out when it’s ready Wednesday, November 4, 2009
  • 20. would you use a word processor that only let you save at the end of a paragraph? Wednesday, November 4, 2009
  • 21. litters workspace with .svn directories single .hg directory at project root Wednesday, November 4, 2009
  • 22. time to set up new repository limits use instant setup enables new uses hg init hg add hg commit -m “first commit” Wednesday, November 4, 2009
  • 23. merging is messy, dangerous and often avoided merging is the core operation so it’s done well Wednesday, November 4, 2009
  • 24. why is subversion merging so broken and scary? Wednesday, November 4, 2009
  • 25. #1 when there are conflicts, you’re forced to merge into an unsaved working copy Wednesday, November 4, 2009
  • 26. #2 when there are no conflicts, you aren’t forced to merge this is a bug, not a feature Wednesday, November 4, 2009
  • 27. in mercurial, you commit before pulling new code only fully formed changes get pushed out history is always preserved Wednesday, November 4, 2009
  • 28. merging is a common, trivial operation a merge occurs every time you pull down new code Wednesday, November 4, 2009
  • 29. subversion strengths mercurial limitations Wednesday, November 4, 2009
  • 30. familiar new ideas require understanding Wednesday, November 4, 2009
  • 31. very strong tool support tool support not as mature Wednesday, November 4, 2009
  • 32. better choice for lots of huge binary files not optimal for huge binary files Wednesday, November 4, 2009
  • 33. everyone knows where the canonical repository is convention defines where to push/pull from Wednesday, November 4, 2009
  • 34. checking out part of a repository is easy no easy way to get only part of a repository Wednesday, November 4, 2009
  • 35. allows empty directories tracks files, so empty directories aren’t saved Wednesday, November 4, 2009
  • 36. subversion is the clear leader in free centralized version control annoying holy war raging over hg vs. git Wednesday, November 4, 2009
  • 37. mercurial git Wednesday, November 4, 2009
  • 38. easy local md5 is easy, revision numbers right? Wednesday, November 4, 2009
  • 39. plugin design with kitchen sink basic default functionality design Wednesday, November 4, 2009
  • 40. better slower http performance over performance, no http, built-in quick easy built-in server serverhg serve Wednesday, November 4, 2009
  • 41. works well on windows support windows, mac, is lacking and and linux low priority Wednesday, November 4, 2009
  • 42. history is rewriting history sacred is a badge of (though you can commit sacrilege with plugins) honor Wednesday, November 4, 2009
  • 44. change sets are stored as nodes in a DAG (directed acyclic graph) tip newest r3 file system version r2 time r1 oldest r0 Wednesday, November 4, 2009
  • 45. a change set with no children is a “head” r3 r2 r1 r0 Wednesday, November 4, 2009
  • 46. change sets have zero, one or two parents Wednesday, November 4, 2009
  • 47. the root has zero parents r4 r3 r2 r1 r0 Wednesday, November 4, 2009
  • 48. normal commits have one parent r4 r3 r2 r1 r0 Wednesday, November 4, 2009
  • 49. merges have two parents r4 r3 r2 r1 r0 Wednesday, November 4, 2009
  • 50. branch name is determined by the first parent r4 branch: default r4 branch: release_1.x r3 branch: release_1.x r3 branch: release_1.x r2 branch: default r2 branch: default r1 r1 r0 r0 first parent is r2 first parent is r3 Wednesday, November 4, 2009
  • 52. merging only happens in your local repository Wednesday, November 4, 2009
  • 55. hg status <-> svn status hg log <-> svn log hg diff <-> svn diff hg cat <-> svn cat familiar basic hg hg blame add <-> <-> svn svn blame add commands hg hg hg remove rename update <-> <-> <-> svn svn svn remove rename update hg resolve <-> svn resolve hg commit <-> svn commit hg merge <-> svn merge Wednesday, November 4, 2009
  • 56. hg init hg add hg commit -m “project start” create a new r0 “project start” repository Wednesday, November 4, 2009
  • 57. <changes ...> hg commit -m “created domain” commit changes to your r1 “created domain” local repository r0 “project start” Wednesday, November 4, 2009
  • 58. <more changes...> hg commit -m “updated user” commit changes to your r2 “updated user” local repository r1 “created domain” r0 “project start” Wednesday, November 4, 2009
  • 59. hg update -r 1 switch your file system to a r2 “updated user” different revision r1 “created domain” r0 “project start” Wednesday, November 4, 2009
  • 60. hg branch release_1.0.x <changes...> hg commit -m “fix role” “fix role” r3 branch: release_1.x create a branch r2 “updated user” branch: default “created domain” r1 branch: default “project start” r0 branch: default Wednesday, November 4, 2009
  • 61. hg update default “fix role” r3 branch: release_1.x merge changes r2 “updated user” branch: default from a branch r1 “created domain” branch: default “project start” r0 branch: default Wednesday, November 4, 2009
  • 62. hg merge release_1.x <resolve any conflicts> hg commit -m “merged branch” r4 “merged branch” “fix role” r3 branch: release_1.x merge changes r2 “updated user” from a branch r1 “created domain” r0 “project start” Wednesday, November 4, 2009
  • 63. hg clone http://path.to.repo get an existing b b repository a a remote local Wednesday, November 4, 2009
  • 64. hg pull get the latest c changes from b b another repository a remote a local Wednesday, November 4, 2009
  • 65. hg pull pull adds c c changes but b b doesn’t modify file system a remote a local Wednesday, November 4, 2009
  • 66. hg update update your c c working directory b b with the changes a a remote local Wednesday, November 4, 2009
  • 67. what if you’ve already made a change in your repository? Wednesday, November 4, 2009
  • 68. hg pull we added c to b d c b b they added d to b a a remote local Wednesday, November 4, 2009
  • 69. hg pull d d c pulling in d gives b b us a new head a a remote local Wednesday, November 4, 2009
  • 70. hg update # abort, crosses branches d when we try to d c update to the tip, b b hg says you need to merge a remote a local Wednesday, November 4, 2009
  • 71. hg merge <resolve any conflicts> hg commit -m “merge done” e d d c merge the b b changes together a a remote local hg fetch does all this in one command (pull, update, merge, commit) use that instead Wednesday, November 4, 2009
  • 72. hg push e d d c push changes b b back out a a remote local Wednesday, November 4, 2009
  • 73. hg push e e d d c c push changes b b back out a a remote local Wednesday, November 4, 2009
  • 74. how to get started with mercurial Wednesday, November 4, 2009
  • 75. watch the peepcode screencast $9, cheap! Wednesday, November 4, 2009
  • 76. read the book free online! Wednesday, November 4, 2009
  • 79. convert your existing repository Wednesday, November 4, 2009
  • 80. commit and share often Wednesday, November 4, 2009
  • 81. install and learn to use a 3-way merge tool Wednesday, November 4, 2009
  • 83. links mercurial wiki/download http://mercurial.selenic.com O’Reilly’s Mercurial - The Definitive Guide http://hgbook.red-bean.com/ (free!) peepcode intro screencast ($9) http://peepcode.com/products/meet-mercurial mercurial branching info http://stevelosh.com/blog/entry/2009/8/30/a-guide-to-branching-in-mercurial/ ACM article on DVCS http://preview.tinyurl.com/qezmta Wednesday, November 4, 2009