mercurial presentation

33
Feb 2011 DVCS with Mercurial

Post on 14-Sep-2014

1.970 views

Category:

Documents


2 download

DESCRIPTION

by Illia Gryshkevych

TRANSCRIPT

Page 1: Mercurial presentation

Feb 2011

DVCS with Mercurial

Page 2: Mercurial presentation

Agenda What is DVCS? How does it work? Mercurial features Extensions Why not SVN? (SVN vs Mercurial) Questions

Page 3: Mercurial presentation

What is DVCS?

Page 4: Mercurial presentation

What is DVCS? DVCS - A distributed revision control,

distributed version control system (DVCS) keeps track of software revisions and allows many developers to work on a given project independent of network access or a central server. Committing, branching and merging are fast.

Page 5: Mercurial presentation

DVCS is…Distributed version control system (DVCS) takes a peer-to-peer approach, as opposed to the client-server approach of centralized systems. Rather than a single, central repository on which clients synchronize, each peer's working copy of the codebase is a bona-fide repository. Distributed version control conducts synchronization by exchanging patches (change-sets) from peer to peer

Page 6: Mercurial presentation

Currently in SVN

Page 7: Mercurial presentation

Currently in Mercurial

Page 8: Mercurial presentation

DVCS - Advantages Fast

Mercurials implementation and data structures are designed to be fast. You can generate diffs between revisions, or jump back in time within seconds.

Platform independentMercurial was written with platform independence in mind. Therefore most of Mercurial is written in Python, with a small part in portable C for performance reasons. As a result, binary releases are available on all major platforms.

ExtensibleThe functionality of Mercurial can be increased with extensions, either by activating the official ones which are shipped with Mercurial or downloading some from the wiki or by writing your own. Extensions are written in Python and can change the workings of the basic commands, add new commands and access all the core functions of Mercurial.

Open SourceMercurial is free software licensed under the terms of the GNU General Public License Version 2.

Page 9: Mercurial presentation

How does it work?or how it works with TortoiseHG

Page 10: Mercurial presentation

You have:

A working copy. The files you are currently editing. A repository. A directory (.hg in Mercurial) containing all patches and metadata (comments,

guids, dates, etc.). There’s no central server so the data stays with you.

Page 11: Mercurial presentation

How does it work? – Merge

Page 12: Mercurial presentation

How does it work? – Changesets! Like in Subversion, history consists of a number of

commits. They're called changesets in Mercurial. A changeset is an atomic collection of changes to files in

a repository. It contains all recorded local files modification and:

information about who made the change (the "committer"), why ("comments") and when (date/time, timezone)

the name of the branch ("default", if omitted or not set) A changeset is identified uniquely by a changeset ID

(1ef7872431f9c64908c732f0bcd4db5700b4cb70 ). In a single repository, you can identify it using a revision number.

Page 13: Mercurial presentation

How does it work? – Csets tree!

Page 14: Mercurial presentation

How does it work? – Csets tree!

Page 15: Mercurial presentation

How does it work? – Push to stable!

Page 16: Mercurial presentation

How does it work? – Push to stable!

Page 17: Mercurial presentation

How does it work? – Push to stable!

Page 18: Mercurial presentation

Mercurial featuresPushing changes to another repositoryMerging conflicting changesSearching through historyViewing repository through a web browserUsing Mercurial as a “super client” for

Subversion

Page 19: Mercurial presentation

Mercurial Features – Merge conflicts

Page 20: Mercurial presentation

Mercurial Features – Merge conflicts

Page 21: Mercurial presentation

Mercurial Features – web browser

Page 22: Mercurial presentation

How does it work? - basic commands Commit selected diffs in checked files. Undo (rollback) last immediate commit. Visual Diff checked files. Revert checked files to last revisioned state Add checked files Move checked files Remove checked files Forget checked files Pull all changes from another repository into the current

one Push all changes from your repository into another one Shelve changes when they not needed and get them

back in future

Page 23: Mercurial presentation

Extensions

Page 24: Mercurial presentation

Extensions - Enabling

Page 25: Mercurial presentation

Extensions - rebase

Page 26: Mercurial presentation

Extensions – Shelve

The shelve extension lets you to choose which parts of the changes in a working directory you'd like to set aside temporarily, at the granularity of patch hunks. You can later restore the shelved patch hunks using the unshelve command.

Page 27: Mercurial presentation

Extensions – more and more Purge – deletes all files and directories in the

repository that are not being tracked by Mercurial Notify – Send email to subscribed addresses to

notify repository changes Convert – convert repositories from other SCMs

into Mercurial Highlight – Highlight syntax in the file revision

view of hgweb Bisect – Quickly find the revision that introduces

a bug or feature bisecting the history tree …

Page 28: Mercurial presentation

Why not SVN?

Page 29: Mercurial presentation

SVN Limitations

Branching is easy, merging is easy

If your computer is on, you have access to the repository

Sharing changes withselected people is easy (hg serve/hg push/hg pull)

Aware of file history and can merge into renamed file Single .hg directory at root of

source tree Fast performance; you’re working

on local filesystem Cheap to create/throw away local

experimental branch

Branching is easy, but merging is painful

Active net connectionrequired to interact

Unable to share changeswith others without sharing with everyone (including the build server)

Fails to merge changes whensomething is renamed

.svn files are littered throughout your source tree

Slow over-the-wire performance

Discourages experimentation

DVCS/Mercurial Strengths

Page 30: Mercurial presentation

SVN Strengths DVCS/Mercurial limitations

Most developers will need to learn to think differently

Better understanding of version control concepts required

Need to define and adhere to convention to know where the trunk is

Familiar to most developers

Relatively easy to grasp

Everyone knows where the trunk is because there’s only one server

Page 31: Mercurial presentation

Projects using mercurial1. Mozilla2. OpenJDK3. OpenSolaris4. OpenOffice.org5. Symbian OS6. Adium7. Audacious8. Coin3D9. OSSEC10. CubicWeb11. Dovecot IMAP server12. GeeXboX13. RabbitMQ14. Go programming language15. GNU Octave16. GNU Multi-Precision Library

17. Growl18. LEMON19. LinuxTV/Video4Linux20. LuxRender 3D Render Engine21. Mercurial22. MoinMoin wiki software23. Mutt24. Netbeans25. Nuxeo26. Ogre3D27. SAGE28. Vim29. Lugaru HD30. Tryton31. Tuenti

Page 32: Mercurial presentation

Usefull links

Download Mercurial: http://mercurial.selenic.com/wiki/Download

Dvcs With Mercurial presentation: http://www.slideshare.net/tednaleid/dvcs-with-mercurial-no-notes

Migrating from and VCS: http://mercurial.selenic.com/wiki/RepositoryConversion

VS Plugin: http://visualhg.codeplex.com/ Mercurial as a “super client” for Subversion:

http://naleid.com/blog/2008/05/01/using-mercurial-as-a-super-client-for-subversion/

Page 33: Mercurial presentation

Questions?