ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
What is Revision
   Control
? Allows multiple people to collaborate on a
  ?le.
Apple
Oranges
Cherries
Milk
Apple Pear Chinese
Noodles
Pomegranate
Strawberries
Bananas
$ rc add 2009-12-11.txt
$ rc commit -m 'Added the Grocery List for
Friday 11 Dec, 2009.'
$ rc log
reversion: 1
author: Myles Braithwaite
summary: Added the Grocery List for Friday
11 Dec, 2009.
Apple
Oranges
Cherries
Milk
Chinese White Pear Apple Pear Chinese
Noodles
Pomegranate
Strawberries
Bananas
$ rc status
Modified: 2009-12-11.txt
$ rc commit -m "It's called a Chinese
White Pear not a Apple Pear Chinese Fruit"
$ rc diff -r 1
diff -r 1 2009-12-11.txt
--- a/2009-12-11.txt	 Thu Dec 03 15:45:38
+++ b/2009-12-11.txt	 Thu Dec 03 15:51:39
@@ -2,7 +2,7 @@
 Oranges
 Cherries
 Milk
-Apple Pear Chinese Fruit
+Chinese White Pear
 Noodles
 Pomegranate
 Strawberries
$ rc log
reversion: 1
author: Myles Braithwaite
summary: Added the Grocery List for Friday
11 Dec, 2009.

reversion: 2
author: Other Person
summary: It's called a Chinese White Pear
not a Apple Pear Chinese Fruit
? Attempt to merge changes between two
  commits.
Apple
Oranges
Cherries
Milk
Chinese White Pear
Noodles
Pomegranate
Strawberries
Bananas
Tea
$ rc commit -m 'Added tea to the list'
Apple @done
Oranges @done
Cherries @done
Milk
Chinese White Pear
Noodles
Pomegranate
Strawberries
Bananas
$ rc commit -m 'Went to the Grocery store
and picked up Apples, Oranges, and
Cherries.'

The Repository is Out of Sync. Please
merge the new changes.
$ rc merge
Merge was successful.
$ rc commit -m 'Merging changes'
Strawberries
Bananas
<<< HEAD
Tea (Chai)
>>>>
<<<< 6
Tea (Green)
>>>>
Mercurial
Myles Braithwaite
me@mylesbraithwaite.com
@mylesb
History


? Matt Machall
? Originally developed for the Linux Kernel.
? For some reason Torvalds¡¯ picked Git?
Quick Facts


? Implemented in the awesome Python
  programming language.
 ? But includes a binary diff written in C.
? Originally written to run on Linux.
? But it has been successfully ported to run
  natively on Mac OS X, Windows, and
  other Unix-like systems.
? Python (http://hg.python.org)
? Mozilla (http://hg.mozilla.org)
? OpenSolaris
? OpenJDK (http://hg.openjdk.java.net)
? OpenOf?ce.org
? More here: http://j.mp/ProjectUsingHg
Installation (Linux)
# Debian or Ubuntu
$ aptitude install mercurial

# Fedora
$ yum install mercurial

# Gentoo
$ emerge mercurial

# OpenSolaris
$ pkg install SUNWmercurial
Installation (Windows)


? Download and install the of?cial exe.
? Download TortoiseHg (http://tortoisehg.org)
 ? Integrates Mercurial directly into explorer.
Installation (Mac OS X)


? Install the DMG ?le.
Installation (PyPi)


$ easy_install mercurial

$ pip install mercurial
Installation from Source

$ wget http://mercurial.selenic.com/
release/mercurial-1.4.1.tar.gz
$ tar -xzf mercurial-1.4.1.tar.gz
$ cd mercurial-1.4.1
$ python setup.py build
$ sudo python setup.py install
$ hg --version
Mercurial Distributed SCM (version 1.4.1)
$ $EDITOR ~/.hgrc

[ui]
username = Myles Braithwaite <me@myles.tk>
$ export P_DIR=~/GroceryList
$
$ # Create an empty repository on your
$ # local machine.
$ mkdir $P_DIR; cd $P_DIR
$ hg init
$
$ # Clone a remote repository.
$ hg clone ssh://hg.mb/grocery_list $P_DIR
destination directory: /home/m/GroveryList
...
3 files updated, 0 files merged, 0 files
removed, 0 files unresolved
$ echo 'Apple' > cat 2009-12-08.txt
$ hg status
? 2009-12-08.txt
$ hg add 2009-12-08.txt
$ hg status
A 2009-12-08.txt
$ hg commit -m 'Added the grocery list for
9th Dec. 2009.'
$ hg status
M 2009-12-08.txt
$ hg diff
diff -r 012549b5c017 2009-12-08.txt
--- a/2009-12-08.txt	 19:42:25
+++ b/2009-12-08.txt 19:44:46
@@ -1,1 +1,2 @@
 Apples
+Pizza
$ hg commit -m 'I am hungry for some
Pizza.'
$ hg log -l 2
changeset:    14:848072d17be0
tag:          tip
user:         Myles Braithwaite
date:         19:49:10
summary:      I am hungry for some Pizza

changeset:   13:012549b5c017
user:        Myles Braithwaite
date:        19:42:25
summary:     Added the grocery list for
9th Dec. 2009.
$ hg annotate 2009-12-08.txt
13: Apples
14: Pizza
15: Nuts
16: Hot Chocolate Mix
$ hg tags
tip                   16:54c53457b1ac
2009-12-04            9:d1361977c248
$ hg tag 2009-12-08
$ hg tags
tip                   17:21598a08291c
2009-12-08            16:54c53457b1ac
2009-12-04             9:d1361977c248
$ cat .hgtags
d1361977c2... 2009-12-04
54c53457b1... 2009-12-08
# If we cloned the repository.
$ hg push

$ hg push ssh://hg.mb/grocery_list
$ hg pull ssh://hg.mb/grocery_list
pulling from ssh://hg.mb/grocery_list
searching for changes
...
(run 'hg update' to get a working copy)
$ hg update
1 files updated, 0 files merged, 0 files
removed, 0 files unresolved
$ hg log -l 2
changeset:    20:6dfef8e8a348
tag:          tip
user:         Other Person
summary:      Remove some things fromthe
list that were already entered on Friday'
list.

changeset:     19:1564f5195566
date:          16:30:18
summary:       Added a shopping list for
Sat. 12 Dec.   2009
$ hg diff -r 19
diff -r 1564f5195566 2009-12-12.odt
Binary file 2009-12-12.odt has changed
$ # Using an extension we can call an
$ # external program to run the diff.
$ hg extdiff -p oodiff -r 19
--- GroceryList.1565f5195566/2009-12-12.odt
+++ GroveryList/2009-12-12.odt
@@ -1,12 +1,4 @@

-   Oranges
-
-   Apples
-
-   Bananas
-
-   Cereal
-
    Cherios

    Beer
$ # To enable external diff's extension.
$ $EDITOR .hg/hgrc
[extensions]
extdiff =
$ hg serve -n "Shopping List"
GTALUG Short Talk On Mercurial
GTALUG Short Talk On Mercurial
.hgignore
# use global syntax.
syntax: glob
*.pyc
*.pyo
*~

# switch to regular expressions syntax.
syntax: regexp
^.pc/
Find out more...


? http://mercurial.selenic.com
Other cool stuff...


? Google Code (http://code.google.com/p)
? Bitbucket (http://bitbucket.org)

More Related Content

Viewers also liked (8)

PDF
LessCSS Presentation @ April 2015 GTALUG Meeting
Myles Braithwaite
?
PDF
extending-php
tutorialsruby
?
ZIP
Django GTALUG Presentation
Myles Braithwaite
?
ZIP
Google App Engine
Myles Braithwaite
?
KEY
The Internet and Your Business
Myles Braithwaite
?
PDF
GTALUG Presentation on CouchDB
Myles Braithwaite
?
KEY
The Devil and HTML5
Myles Braithwaite
?
PDF
Take a Stroll in the Bazaar
Myles Braithwaite
?
LessCSS Presentation @ April 2015 GTALUG Meeting
Myles Braithwaite
?
extending-php
tutorialsruby
?
Django GTALUG Presentation
Myles Braithwaite
?
Google App Engine
Myles Braithwaite
?
The Internet and Your Business
Myles Braithwaite
?
GTALUG Presentation on CouchDB
Myles Braithwaite
?
The Devil and HTML5
Myles Braithwaite
?
Take a Stroll in the Bazaar
Myles Braithwaite
?

Similar to GTALUG Short Talk On Mercurial (20)

ZIP
Mercurial Distributed Version Control
David Stockton
?
PDF
Hg version control bioinformaticians
Giovanni Marco Dall'Olio
?
PDF
·Ö²¼Ê½°æ±¾¹ÜÀí
jeffz
?
PDF
Dvcs With Mercurial (No Notes)
Ted Naleid
?
PDF
Mercurial: Modern Source Control Management
John Paulett
?
PDF
Hg for bioinformatics, second part
Giovanni Marco Dall'Olio
?
PDF
Mercurial intro
RealNitro
?
PDF
Git vs. Mercurial
Marian Marinov
?
PDF
The Mercurial SCM
elliando dias
?
KEY
Mercurial
Fabrizio Giudici
?
PDF
Git Going With DVCS v1.5.2
Matthew McCullough
?
PDF
Loading...git
Rafael Garc¨ªa
?
PDF
Introduction to mercurial
IT Booze
?
PPTX
Git/Github/Bitbucket@TalkIt. Humber college.
Andrew Romanenco
?
PDF
Git training
eric7master
?
PPTX
Mercurial training
Trung Huynh
?
PPT
Introduction to git
Nguyen Van Hung
?
PPTX
Git presentation, Viktor Pyskunov
Viktor Pyskunov
?
PDF
Git-podstawy
tymon Tobolski
?
PDF
Git session day 1
Mosaab Ehab
?
Mercurial Distributed Version Control
David Stockton
?
Hg version control bioinformaticians
Giovanni Marco Dall'Olio
?
·Ö²¼Ê½°æ±¾¹ÜÀí
jeffz
?
Dvcs With Mercurial (No Notes)
Ted Naleid
?
Mercurial: Modern Source Control Management
John Paulett
?
Hg for bioinformatics, second part
Giovanni Marco Dall'Olio
?
Mercurial intro
RealNitro
?
Git vs. Mercurial
Marian Marinov
?
The Mercurial SCM
elliando dias
?
Git Going With DVCS v1.5.2
Matthew McCullough
?
Loading...git
Rafael Garc¨ªa
?
Introduction to mercurial
IT Booze
?
Git/Github/Bitbucket@TalkIt. Humber college.
Andrew Romanenco
?
Git training
eric7master
?
Mercurial training
Trung Huynh
?
Introduction to git
Nguyen Van Hung
?
Git presentation, Viktor Pyskunov
Viktor Pyskunov
?
Git-podstawy
tymon Tobolski
?
Git session day 1
Mosaab Ehab
?
Ad

Recently uploaded (20)

PDF
Open Source Milvus Vector Database v 2.6
Zilliz
?
PDF
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
?
PDF
From Chatbot to Destroyer of Endpoints - Can ChatGPT Automate EDR Bypasses (1...
Priyanka Aash
?
PPTX
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
?
PDF
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
ScyllaDB
?
PDF
Unlocking FME Flow¡¯s Potential: Architecture Design for Modern Enterprises
Safe Software
?
PPTX
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
?
PPTX
Enabling the Digital Artisan ¨C keynote at ICOCI 2025
Alan Dix
?
PDF
The Growing Value and Application of FME & GenAI
Safe Software
?
PDF
Plugging AI into everything: Model Context Protocol Simplified.pdf
Abati Adewale
?
PPTX
UserCon Belgium: Honey, VMware increased my bill
stijn40
?
PDF
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
?
PDF
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
?
PDF
UiPath Agentic AI ile Ak?ll? Otomasyonun Yeni ?a??
UiPathCommunity
?
PPTX
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
?
PDF
LLM Search Readiness Audit - Dentsu x SEO Square - June 2025.pdf
Nick Samuel
?
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
?
PPTX
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
?
PDF
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
?
PPTX
Simplifica la seguridad en la nube y la detecci¨®n de amenazas con FortiCNAPP
Cristian Garcia G.
?
Open Source Milvus Vector Database v 2.6
Zilliz
?
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
?
From Chatbot to Destroyer of Endpoints - Can ChatGPT Automate EDR Bypasses (1...
Priyanka Aash
?
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
?
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
ScyllaDB
?
Unlocking FME Flow¡¯s Potential: Architecture Design for Modern Enterprises
Safe Software
?
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
?
Enabling the Digital Artisan ¨C keynote at ICOCI 2025
Alan Dix
?
The Growing Value and Application of FME & GenAI
Safe Software
?
Plugging AI into everything: Model Context Protocol Simplified.pdf
Abati Adewale
?
UserCon Belgium: Honey, VMware increased my bill
stijn40
?
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
?
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
?
UiPath Agentic AI ile Ak?ll? Otomasyonun Yeni ?a??
UiPathCommunity
?
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
?
LLM Search Readiness Audit - Dentsu x SEO Square - June 2025.pdf
Nick Samuel
?
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
?
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
?
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
?
Simplifica la seguridad en la nube y la detecci¨®n de amenazas con FortiCNAPP
Cristian Garcia G.
?
Ad

GTALUG Short Talk On Mercurial

  • 2. ? Allows multiple people to collaborate on a ?le.
  • 4. $ rc add 2009-12-11.txt $ rc commit -m 'Added the Grocery List for Friday 11 Dec, 2009.'
  • 5. $ rc log reversion: 1 author: Myles Braithwaite summary: Added the Grocery List for Friday 11 Dec, 2009.
  • 6. Apple Oranges Cherries Milk Chinese White Pear Apple Pear Chinese Noodles Pomegranate Strawberries Bananas
  • 7. $ rc status Modified: 2009-12-11.txt $ rc commit -m "It's called a Chinese White Pear not a Apple Pear Chinese Fruit"
  • 8. $ rc diff -r 1 diff -r 1 2009-12-11.txt --- a/2009-12-11.txt Thu Dec 03 15:45:38 +++ b/2009-12-11.txt Thu Dec 03 15:51:39 @@ -2,7 +2,7 @@ Oranges Cherries Milk -Apple Pear Chinese Fruit +Chinese White Pear Noodles Pomegranate Strawberries
  • 9. $ rc log reversion: 1 author: Myles Braithwaite summary: Added the Grocery List for Friday 11 Dec, 2009. reversion: 2 author: Other Person summary: It's called a Chinese White Pear not a Apple Pear Chinese Fruit
  • 10. ? Attempt to merge changes between two commits.
  • 12. $ rc commit -m 'Added tea to the list'
  • 13. Apple @done Oranges @done Cherries @done Milk Chinese White Pear Noodles Pomegranate Strawberries Bananas
  • 14. $ rc commit -m 'Went to the Grocery store and picked up Apples, Oranges, and Cherries.' The Repository is Out of Sync. Please merge the new changes.
  • 15. $ rc merge Merge was successful. $ rc commit -m 'Merging changes'
  • 18. History ? Matt Machall ? Originally developed for the Linux Kernel. ? For some reason Torvalds¡¯ picked Git?
  • 19. Quick Facts ? Implemented in the awesome Python programming language. ? But includes a binary diff written in C.
  • 20. ? Originally written to run on Linux. ? But it has been successfully ported to run natively on Mac OS X, Windows, and other Unix-like systems.
  • 21. ? Python (http://hg.python.org) ? Mozilla (http://hg.mozilla.org) ? OpenSolaris ? OpenJDK (http://hg.openjdk.java.net) ? OpenOf?ce.org ? More here: http://j.mp/ProjectUsingHg
  • 22. Installation (Linux) # Debian or Ubuntu $ aptitude install mercurial # Fedora $ yum install mercurial # Gentoo $ emerge mercurial # OpenSolaris $ pkg install SUNWmercurial
  • 23. Installation (Windows) ? Download and install the of?cial exe. ? Download TortoiseHg (http://tortoisehg.org) ? Integrates Mercurial directly into explorer.
  • 24. Installation (Mac OS X) ? Install the DMG ?le.
  • 25. Installation (PyPi) $ easy_install mercurial $ pip install mercurial
  • 26. Installation from Source $ wget http://mercurial.selenic.com/ release/mercurial-1.4.1.tar.gz $ tar -xzf mercurial-1.4.1.tar.gz $ cd mercurial-1.4.1 $ python setup.py build $ sudo python setup.py install $ hg --version Mercurial Distributed SCM (version 1.4.1)
  • 27. $ $EDITOR ~/.hgrc [ui] username = Myles Braithwaite <me@myles.tk>
  • 28. $ export P_DIR=~/GroceryList $ $ # Create an empty repository on your $ # local machine. $ mkdir $P_DIR; cd $P_DIR $ hg init $ $ # Clone a remote repository. $ hg clone ssh://hg.mb/grocery_list $P_DIR destination directory: /home/m/GroveryList ... 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
  • 29. $ echo 'Apple' > cat 2009-12-08.txt $ hg status ? 2009-12-08.txt $ hg add 2009-12-08.txt $ hg status A 2009-12-08.txt $ hg commit -m 'Added the grocery list for 9th Dec. 2009.'
  • 30. $ hg status M 2009-12-08.txt $ hg diff diff -r 012549b5c017 2009-12-08.txt --- a/2009-12-08.txt 19:42:25 +++ b/2009-12-08.txt 19:44:46 @@ -1,1 +1,2 @@ Apples +Pizza $ hg commit -m 'I am hungry for some Pizza.'
  • 31. $ hg log -l 2 changeset: 14:848072d17be0 tag: tip user: Myles Braithwaite date: 19:49:10 summary: I am hungry for some Pizza changeset: 13:012549b5c017 user: Myles Braithwaite date: 19:42:25 summary: Added the grocery list for 9th Dec. 2009.
  • 32. $ hg annotate 2009-12-08.txt 13: Apples 14: Pizza 15: Nuts 16: Hot Chocolate Mix
  • 33. $ hg tags tip 16:54c53457b1ac 2009-12-04 9:d1361977c248 $ hg tag 2009-12-08 $ hg tags tip 17:21598a08291c 2009-12-08 16:54c53457b1ac 2009-12-04 9:d1361977c248
  • 34. $ cat .hgtags d1361977c2... 2009-12-04 54c53457b1... 2009-12-08
  • 35. # If we cloned the repository. $ hg push $ hg push ssh://hg.mb/grocery_list
  • 36. $ hg pull ssh://hg.mb/grocery_list pulling from ssh://hg.mb/grocery_list searching for changes ... (run 'hg update' to get a working copy) $ hg update 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  • 37. $ hg log -l 2 changeset: 20:6dfef8e8a348 tag: tip user: Other Person summary: Remove some things fromthe list that were already entered on Friday' list. changeset: 19:1564f5195566 date: 16:30:18 summary: Added a shopping list for Sat. 12 Dec. 2009
  • 38. $ hg diff -r 19 diff -r 1564f5195566 2009-12-12.odt Binary file 2009-12-12.odt has changed
  • 39. $ # Using an extension we can call an $ # external program to run the diff. $ hg extdiff -p oodiff -r 19 --- GroceryList.1565f5195566/2009-12-12.odt +++ GroveryList/2009-12-12.odt @@ -1,12 +1,4 @@ - Oranges - - Apples - - Bananas - - Cereal - Cherios Beer
  • 40. $ # To enable external diff's extension. $ $EDITOR .hg/hgrc [extensions] extdiff =
  • 41. $ hg serve -n "Shopping List"
  • 44. .hgignore # use global syntax. syntax: glob *.pyc *.pyo *~ # switch to regular expressions syntax. syntax: regexp ^.pc/
  • 45. Find out more... ? http://mercurial.selenic.com
  • 46. Other cool stuff... ? Google Code (http://code.google.com/p) ? Bitbucket (http://bitbucket.org)