(the source control management)€¦ · knowing mercurial … main features free source control...
TRANSCRIPT
![Page 1: (The Source Control Management)€¦ · Knowing Mercurial … Main Features Free source control management tool & Easier to learn Cross-platform, Fast, Distributed revision control](https://reader034.vdocuments.us/reader034/viewer/2022051914/6005f89c2bbfb75a21797d2c/html5/thumbnails/1.jpg)
ICOSST-2010, Dec 22-24, Lahore, Pakistan
Jamshaid Iqbal Janjua, Shahid Awan
M E R C U R I A L (The Source Control Management)
Al-Khawarizmi Institute of Computer Science
University of Engineering & Technology, Lahore, Pakistan.
Presented in Open Source Series Workshop 2010
22-24 December, 2010 © ICOSST 2010
![Page 2: (The Source Control Management)€¦ · Knowing Mercurial … Main Features Free source control management tool & Easier to learn Cross-platform, Fast, Distributed revision control](https://reader034.vdocuments.us/reader034/viewer/2022051914/6005f89c2bbfb75a21797d2c/html5/thumbnails/2.jpg)
Agenda
Introduction
Source Control Management
Mercurial
Basic Concepts
Branches
Merging
Changesets
Mercurial Features
Underlying Model
Talking to Other Systems
Third Party Tools
Demonstration
Presented in Open Source Series Workshop 2010
22-24 December, 2010 © ICOSST 2010
![Page 3: (The Source Control Management)€¦ · Knowing Mercurial … Main Features Free source control management tool & Easier to learn Cross-platform, Fast, Distributed revision control](https://reader034.vdocuments.us/reader034/viewer/2022051914/6005f89c2bbfb75a21797d2c/html5/thumbnails/3.jpg)
Source Control Management (SCM)
Source Control Management is the administrative
organization of Changes to Documents, Programs,
and Other information stored as computer files.
Also known as
Revision Control System (RCS)
Version Control System (VCS)
Presented in Open Source Series Workshop 2010
22-24 December, 2010 © ICOSST 2010
![Page 4: (The Source Control Management)€¦ · Knowing Mercurial … Main Features Free source control management tool & Easier to learn Cross-platform, Fast, Distributed revision control](https://reader034.vdocuments.us/reader034/viewer/2022051914/6005f89c2bbfb75a21797d2c/html5/thumbnails/4.jpg)
SCM :: Usage
Why is Source Control Management Needed ?
Avoid Manual Management (an error-prone task)
Tracks the History of the Project
Easy to Manage the Drift
Helps to Recover from Mistakes
Presented in Open Source Series Workshop 2010
22-24 December, 2010 © ICOSST 2010
![Page 5: (The Source Control Management)€¦ · Knowing Mercurial … Main Features Free source control management tool & Easier to learn Cross-platform, Fast, Distributed revision control](https://reader034.vdocuments.us/reader034/viewer/2022051914/6005f89c2bbfb75a21797d2c/html5/thumbnails/5.jpg)
SCM :: Options
Software Maintainer Development
Status
Repository
Model
License Cost
Mercurial Matt
Mackall
Actively
developed Distributed
GPL Free
SVN CollabNet,
Inc
Actively
developed
Client–
server
Apache/BSD
style
Free
Git Junio
Hamano
Actively
developed Distributed
GPL Free
CVS The CVS
Team
Maintained but
new features not
added
Client–
server
GPL Free
VSS Microsoft
Serious bug
fixes only
Shared
Folder
Proprietary Non -free
Presented in Open Source Series Workshop 2010
22-24 December, 2010 © ICOSST 2010
![Page 6: (The Source Control Management)€¦ · Knowing Mercurial … Main Features Free source control management tool & Easier to learn Cross-platform, Fast, Distributed revision control](https://reader034.vdocuments.us/reader034/viewer/2022051914/6005f89c2bbfb75a21797d2c/html5/thumbnails/6.jpg)
Knowing Mercurial …
Main Features
Free source control management tool & Easier to learn
Cross-platform, Fast, Distributed revision control system
Robust support for branching & merging
Scales to the demands of Real, Challenging environments
High performance & Extensible
Strong focus on back & forward Compatibility
New Clients can Read/Write all old formats on disk
Old clients can read/Write to all new Servers
Strong focus on Data Safety
Files are not overwritten, only appended to
Easier to recover from disk crashes
http:/
/ w
ww
.mercu
rial.se
lenic.co
m/
Presented in Open Source Series Workshop 2010
22-24 December, 2010 © ICOSST 2010
![Page 7: (The Source Control Management)€¦ · Knowing Mercurial … Main Features Free source control management tool & Easier to learn Cross-platform, Fast, Distributed revision control](https://reader034.vdocuments.us/reader034/viewer/2022051914/6005f89c2bbfb75a21797d2c/html5/thumbnails/7.jpg)
Why Distributed ?
Distributed SCM gives you:
Offline commits
Rich set of fast local operations
Derived effects
Fine file commits
Searchable history
Branching & Merging becomes a natural task
Enables better Work flows
Presented in Open Source Series Workshop 2010
22-24 December, 2010 © ICOSST 2010
![Page 8: (The Source Control Management)€¦ · Knowing Mercurial … Main Features Free source control management tool & Easier to learn Cross-platform, Fast, Distributed revision control](https://reader034.vdocuments.us/reader034/viewer/2022051914/6005f89c2bbfb75a21797d2c/html5/thumbnails/8.jpg)
Who is Using Mercurial ?
And Many Others …..
Presented in Open Source Series Workshop 2010
22-24 December, 2010 © ICOSST 2010
![Page 9: (The Source Control Management)€¦ · Knowing Mercurial … Main Features Free source control management tool & Easier to learn Cross-platform, Fast, Distributed revision control](https://reader034.vdocuments.us/reader034/viewer/2022051914/6005f89c2bbfb75a21797d2c/html5/thumbnails/9.jpg)
Mercurial Commands
Local Commands
hg commit : Save a snapshot into current repository
hg update : Checkout revision into working directory
hg merge : Join different lines of history
Network Commands
hg pull : Retrieve changesets from another repository
hg push : Send your changesets to another repository
Administrative Commands
hg clone : Copies or downloads a repository
hg add : Adds a file or directory to the local source tree
hg remove : Removes a file or directory from the local source
Presented in Open Source Series Workshop 2010
22-24 December, 2010 © ICOSST 2010
![Page 10: (The Source Control Management)€¦ · Knowing Mercurial … Main Features Free source control management tool & Easier to learn Cross-platform, Fast, Distributed revision control](https://reader034.vdocuments.us/reader034/viewer/2022051914/6005f89c2bbfb75a21797d2c/html5/thumbnails/10.jpg)
Key Concepts
Repository
A Remote Copy of Source Tree with Revision History.
Working Copy
Also known as working directory. It's the Top-level Directory in a repository, in which the plain
versions of files are available to read, edit and build.
Changeset
It's a Collection of all the Changes that lead to a new revision of the repository.
Hello.java
Makefile
commit
update
User A
push
pull
Presented in Open Source Series Workshop 2010
22-24 December, 2010 © ICOSST 2010
![Page 11: (The Source Control Management)€¦ · Knowing Mercurial … Main Features Free source control management tool & Easier to learn Cross-platform, Fast, Distributed revision control](https://reader034.vdocuments.us/reader034/viewer/2022051914/6005f89c2bbfb75a21797d2c/html5/thumbnails/11.jpg)
Mercurial Branches
A Key Concept
Parallel lines of development
Used to track releases
Used to isolate disruptive changes
1.0.1 1.0.2
1.0
1.0.1 1.0.2
1.0
Presented in Open Source Series Workshop 2010
22-24 December, 2010 © ICOSST 2010
![Page 12: (The Source Control Management)€¦ · Knowing Mercurial … Main Features Free source control management tool & Easier to learn Cross-platform, Fast, Distributed revision control](https://reader034.vdocuments.us/reader034/viewer/2022051914/6005f89c2bbfb75a21797d2c/html5/thumbnails/12.jpg)
Mercurial Merging
A Key Concept
Combines two branches
Used to merge back bug fixes
Used to integrate feature branches
1.0.1 1.0.2
1.0
Presented in Open Source Series Workshop 2010
22-24 December, 2010 © ICOSST 2010
![Page 13: (The Source Control Management)€¦ · Knowing Mercurial … Main Features Free source control management tool & Easier to learn Cross-platform, Fast, Distributed revision control](https://reader034.vdocuments.us/reader034/viewer/2022051914/6005f89c2bbfb75a21797d2c/html5/thumbnails/13.jpg)
Moving Changesets Around
0 A1 A2 A3
C1 0
B1 0
B1
C2
A1
C4
A2
C3
B1
A3
USER A USER B
USER C
pull
Presented in Open Source Series Workshop 2010
22-24 December, 2010 © ICOSST 2010
![Page 14: (The Source Control Management)€¦ · Knowing Mercurial … Main Features Free source control management tool & Easier to learn Cross-platform, Fast, Distributed revision control](https://reader034.vdocuments.us/reader034/viewer/2022051914/6005f89c2bbfb75a21797d2c/html5/thumbnails/14.jpg)
Distributed Revision Control
Mercurial duplicates the history on many servers
USER B USER C
USER A USER A’s
Laptop
Presented in Open Source Series Workshop 2010
22-24 December, 2010 © ICOSST 2010
![Page 15: (The Source Control Management)€¦ · Knowing Mercurial … Main Features Free source control management tool & Easier to learn Cross-platform, Fast, Distributed revision control](https://reader034.vdocuments.us/reader034/viewer/2022051914/6005f89c2bbfb75a21797d2c/html5/thumbnails/15.jpg)
Distributed Revision Control
Mercurial duplicates the history on many servers
USER B USER C
USER A USER A’s
Laptop
SERVER
Presented in Open Source Series Workshop 2010
22-24 December, 2010 © ICOSST 2010
![Page 16: (The Source Control Management)€¦ · Knowing Mercurial … Main Features Free source control management tool & Easier to learn Cross-platform, Fast, Distributed revision control](https://reader034.vdocuments.us/reader034/viewer/2022051914/6005f89c2bbfb75a21797d2c/html5/thumbnails/16.jpg)
Workflow In a Team
Mercurial scales from a single team ….
USER A
USER C
USER B
TEST
SERVER
PROD
SEVER
Presented in Open Source Series Workshop 2010
22-24 December, 2010 © ICOSST 2010
![Page 17: (The Source Control Management)€¦ · Knowing Mercurial … Main Features Free source control management tool & Easier to learn Cross-platform, Fast, Distributed revision control](https://reader034.vdocuments.us/reader034/viewer/2022051914/6005f89c2bbfb75a21797d2c/html5/thumbnails/17.jpg)
Workflow Between Company Divisions
…. to enterprise wide development ….
SITE A
SITE B
SITE C
Presented in Open Source Series Workshop 2010
22-24 December, 2010 © ICOSST 2010
![Page 18: (The Source Control Management)€¦ · Knowing Mercurial … Main Features Free source control management tool & Easier to learn Cross-platform, Fast, Distributed revision control](https://reader034.vdocuments.us/reader034/viewer/2022051914/6005f89c2bbfb75a21797d2c/html5/thumbnails/18.jpg)
Workflow Between Two Computers
…. to working with yourself
USER A USER B
Presented in Open Source Series Workshop 2010
22-24 December, 2010 © ICOSST 2010
![Page 19: (The Source Control Management)€¦ · Knowing Mercurial … Main Features Free source control management tool & Easier to learn Cross-platform, Fast, Distributed revision control](https://reader034.vdocuments.us/reader034/viewer/2022051914/6005f89c2bbfb75a21797d2c/html5/thumbnails/19.jpg)
The Underlying Model
A Mercurial changeset conceptually consists of:
0-2 parent changeset IDs
Root changeset has no parents
Normal changeset has one parents
Merge changeset has two parents
Date, username, commit message
Difference from first parent changeset
Changeset ID is computed as SHA-1 hash of above.
Presented in Open Source Series Workshop 2010
22-24 December, 2010 © ICOSST 2010
![Page 20: (The Source Control Management)€¦ · Knowing Mercurial … Main Features Free source control management tool & Easier to learn Cross-platform, Fast, Distributed revision control](https://reader034.vdocuments.us/reader034/viewer/2022051914/6005f89c2bbfb75a21797d2c/html5/thumbnails/20.jpg)
Migration
The convert extension in Mercurial can import history from
CVS, SVN, Git, Bazaar, Darcs, etc.
Incremental conversion
The hgsubversion extension in Mercurial let’s you:
Use hg clone on SVN Url
Use hg pull to convert new SVN revisions
Use hg push to commit changesets to SVN Server
Goal: make Mercurial a better Subversion client then SVN!
Presented in Open Source Series Workshop 2010
22-24 December, 2010 © ICOSST 2010
![Page 21: (The Source Control Management)€¦ · Knowing Mercurial … Main Features Free source control management tool & Easier to learn Cross-platform, Fast, Distributed revision control](https://reader034.vdocuments.us/reader034/viewer/2022051914/6005f89c2bbfb75a21797d2c/html5/thumbnails/21.jpg)
Third-Party Tools
Tools with Mercurial support:
Shell integration:
TortoiseHg(Windows, Mac, Linux)
IDEs: Eclipse, NetBeans, IntelliJ,
Visual Studio, Emacs
Project Support: Trac, JIRA,
Maven, Hudson, BuildBot
Ant tasks
Presented in Open Source Series Workshop 2010
22-24 December, 2010 © ICOSST 2010
![Page 22: (The Source Control Management)€¦ · Knowing Mercurial … Main Features Free source control management tool & Easier to learn Cross-platform, Fast, Distributed revision control](https://reader034.vdocuments.us/reader034/viewer/2022051914/6005f89c2bbfb75a21797d2c/html5/thumbnails/22.jpg)
Installation
Presented in Open Source Series Workshop 2010
22-24 December, 2010 © ICOSST 2010
![Page 23: (The Source Control Management)€¦ · Knowing Mercurial … Main Features Free source control management tool & Easier to learn Cross-platform, Fast, Distributed revision control](https://reader034.vdocuments.us/reader034/viewer/2022051914/6005f89c2bbfb75a21797d2c/html5/thumbnails/23.jpg)
Tortoise Overlay Icon Server
Presented in Open Source Series Workshop 2010
22-24 December, 2010 © ICOSST 2010
![Page 24: (The Source Control Management)€¦ · Knowing Mercurial … Main Features Free source control management tool & Easier to learn Cross-platform, Fast, Distributed revision control](https://reader034.vdocuments.us/reader034/viewer/2022051914/6005f89c2bbfb75a21797d2c/html5/thumbnails/24.jpg)
TortoiseHg Global Settings
Presented in Open Source Series Workshop 2010
22-24 December, 2010 © ICOSST 2010
![Page 25: (The Source Control Management)€¦ · Knowing Mercurial … Main Features Free source control management tool & Easier to learn Cross-platform, Fast, Distributed revision control](https://reader034.vdocuments.us/reader034/viewer/2022051914/6005f89c2bbfb75a21797d2c/html5/thumbnails/25.jpg)
D E M O N S T R A T I O N
Presented in Open Source Series Workshop 2010
22-24 December, 2010 © ICOSST 2010
![Page 26: (The Source Control Management)€¦ · Knowing Mercurial … Main Features Free source control management tool & Easier to learn Cross-platform, Fast, Distributed revision control](https://reader034.vdocuments.us/reader034/viewer/2022051914/6005f89c2bbfb75a21797d2c/html5/thumbnails/26.jpg)
Conclusion
Free source control management tool & Easier to Learn
Cross-platform, Fast, Distributed Revision Control system
Simple yet Strong Model for Branching & Merging
Scales to the demands of Real, Challenging Environments
Light Weight & High performance
Presented in Open Source Series Workshop 2010
22-24 December, 2010 © ICOSST 2010
![Page 27: (The Source Control Management)€¦ · Knowing Mercurial … Main Features Free source control management tool & Easier to learn Cross-platform, Fast, Distributed revision control](https://reader034.vdocuments.us/reader034/viewer/2022051914/6005f89c2bbfb75a21797d2c/html5/thumbnails/27.jpg)
Further Information
http://mercurial.selenic.com/
http://hgbook.red-bean.com
http://hginit.com
http://mercurial.selenic.com/wiki/Tutorial
http://www.mercurial.ch
http://jaoo.dk/dl/2009/Web/Mercurial.pdf
http://www.softwareprojects.com/resources/programming/t-
mercurial-version-control-1853.html
Presented in Open Source Series Workshop 2010
22-24 December, 2010 © ICOSST 2010
![Page 28: (The Source Control Management)€¦ · Knowing Mercurial … Main Features Free source control management tool & Easier to learn Cross-platform, Fast, Distributed revision control](https://reader034.vdocuments.us/reader034/viewer/2022051914/6005f89c2bbfb75a21797d2c/html5/thumbnails/28.jpg)
Thank You!
Presented in Open Source Series Workshop 2010
22-24 December, 2010 © ICOSST 2010