• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Points.com intro to mercurial hg 2011
 

Points.com intro to mercurial hg 2011

on

  • 1,604 views

Points.com introduction to Mercurial (Hg). May 2011. See: lifeatpoints.com

Points.com introduction to Mercurial (Hg). May 2011. See: lifeatpoints.com

Statistics

Views

Total Views
1,604
Views on SlideShare
1,603
Embed Views
1

Actions

Likes
1
Downloads
16
Comments
0

1 Embed 1

http://www.docshut.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Points.com intro to mercurial hg 2011 Points.com intro to mercurial hg 2011 Presentation Transcript

    • Private and Confidential Private and Confidential July 7, 2011 Private and Confidential Intro to Mercurial (Hg) May 2011 Prepared by Michael Lossos He likes Git, too.
    • Private and Confidential Private and Confidential Agenda: Help! I'm Time Boxed!
      • 30 minutes (hopefully)
      • Why Mercurial and not Git?
      • Mercurial Concepts
      • Mercurial Branching
      • Mercurial at Points
      • Q&A
    • Private and Confidential Why Mercurial (Hg) and not Git?
        • Easier adoption:
          • Hg is easier to learn. (Really.)
          • Hg commands are more like Subversion.
        • Your experience:
          • Many of you have used Subversion or Mercurial.
          • Few of you have used Git.
      •  
        • Hg's Windows / Eclipse tools are better than Git's. 
        • SurveyMonkey said:
          • 40% Hg
          • 40% Git
          • 20% Don't Care
      •  
    • Mercurial Concepts: DVCS
        • DVCS: Distributed Version Control System
          • No central repo required.
          • No network connection required. (Local)
        • Everybody gets a clone !
          • Local .hg dir: copy of remote repo.
          • All repo history is available locally.
      •  
        • Massively parallel development.
          •   Git:
            • Linux, Android
          •   Mercurial:
            • Python, Mozilla, OpenJDK
      •  
    • Mercurial Terminology
        • Head
          • Latest commit on a branch.
          • Can be multiple heads.
      •  
      •  
      •  
      •                                                               http://mercurial.selenic.com/wiki/Head
        • Tip
          • Latest commit in a repo.
        • Working directory
          • Local copy of files/dirs from the repo.
    • Mercurial Concepts: Commits
        • Commits are local .
        • Pushes are remote .
          • Send commit(s) to remote repo.
          • 2 steps to share with others: commit, push .
        • Pushes are atomic (think ACID)
          • No more 8-ball germs.
        • Pushes are permanent. 
          • This isn't Git.
      •  
        • Changesets are the commit unit:
          • File Contents and Paths
          • Unique ids: 82:853a723193a6
    • Mercurial Concepts: Workflow
        • Clone the repo to local. Just once.
          • hg clone  https://hg.points.com/hgweb.cgi/yourRepo/
        • Change to your dev branch.
          • hg update dev_bgt_xxxxx
        • Typical workflow:
          • Code
          • Commit locally : 
            • hg commit
          • Code more. Commit more. All local .
          • Ready to share? Push to remote repo.   
            • hg push
    • Mercurial Concepts: Workflow (2)
      • Typical workflow (the real one):
        • Code
        • Commit (local)
        • Outgoing: preview what will be sent on push.
          • hg outgoing
        • Push : FAIL 
          •   abort: push creates new remote heads!
        • Someone beat you to push! 
        • Pull
          • hg pull
        • Update / Merge
          • hg update
          • OR   
          • hg pull --update      To update immediately after pull.
        • Commit
        • Push
    • Mercurial Concepts: Branching
        • CVS: branches are sticky tags.
        • Mercurial: branches are lines of parent/child changesets.
        • Branch names are "sticky".
          • Parent lineage known.
      •  
        • Default branch is called:
          • 'default'
          • Vaguely like CVS HEAD (not really).
          • We won't use 'default'.
      •  
        • Example branch name:
          • dev_bgt_giftregistry_rc
    • Mercurial Concepts: Branching Visualized
    • Mercurial at Points
        • When? Soon. Now, if you ask nicely.
        • Get ready. 
          • Please start learning now:
          • https://wikixxxxxx.points.com/wiki/Mercurial
        • How?
          • TortoiseHg
          • Eclipse 3.6 with HGE (Mercurial Eclipse) plugin.
            • Coming soon to Points.
        • Who? Where do you get help?
          • Ask your team lead.
          • Ask around:
            • BGT devs, Shared Services devs.
    • Mercurial at Points: Branching
        • Branch naming conventions:
          • Do not use 'default' branch.
        • Do not name branches (usually).
          • Until asked.
        • Named branches: feature dev, build promotions.
          • prod_head
          • staging_head
          • dev_bgt_giftregistry
        • New heads:
          • Inherit parent branch name (e.g. 'default')
          • Bookmarks for tracking lines.
    • Mercurial at Points: Branching (2)
        • Builds promoted from dev to prod.
    • Mercurial at Points: Branching (3)
        • Within teams, new feature, hot fixes, etc. on branches.
    • Mercurial Concepts: Features You'll Love
        • Go back in time -- almost instantly!
          • hg update <changeset#>
          • To any changeset / branch.
        • Renames tracked, can be auto-detected.
          • hg addremove --similarity 80
        • Branching easy , merging easier:
          • Implicit local branching.
          • Named branches: 
            • hg branch myNamedBranch
          • Parenting understood.
          • Automerge is better, safer.
        • Cool stuff :
          • bookmarks, multiple heads, backout, rollback, strip (for git lovers)
          • clone your clone, prune dead branches.
    • Mercurial: Q&A
      • Silence = You Understood Everything 
      •                 and Won't Ask Me Later.
    • Further Reading
        • Official docs: http://mercurial.selenic.com/learn/
          • PLEASE READ THE QUICK START : http://mercurial.selenic.com/quickstart/
        • If you like pretty pictures: http://hginit.com/
        • If you like Python people: http://hgbook.red-bean.com/read/a-tour-of-mercurial-the-basics.html
        • If you like Joel Spoelsky: http://hginit.com/
        • Visualizing branch models (Git but applies to Hg): http://nvie.com/posts/a-successful-git-branching-model/
        • The Safari Definitive Guide's website (with the book online, with inline comments): http://hgbook.red-bean.com/
          • The implementation is interesting in order to understanding how to use Hg: http://hgbook.red-bean.com/read/behind-the-scenes.html