Your SlideShare is downloading. ×
Points.com intro to mercurial hg 2011
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Points.com intro to mercurial hg 2011

1,410
views

Published on

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

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

Published in: Technology

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,410
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
19
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. 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.
  • 2. 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
  • 3. 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
    •  
  • 4. 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
    •  
  • 5. 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.
  • 6. 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
  • 7. 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
  • 8. 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
  • 9. 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
  • 10. Mercurial Concepts: Branching Visualized
  • 11. 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.
  • 12. 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.
  • 13. Mercurial at Points: Branching (2)
      • Builds promoted from dev to prod.
  • 14. Mercurial at Points: Branching (3)
      • Within teams, new feature, hot fixes, etc. on branches.
  • 15. 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.
  • 16. Mercurial: Q&A
    • Silence = You Understood Everything 
    •                 and Won't Ask Me Later.
  • 17. 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