SlideShare une entreprise Scribd logo
1  sur  46
Télécharger pour lire hors ligne
What is Revision
   Control
• Allows multiple people to collaborate on a
  file.
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)
• OpenOffice.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 official exe.
• Download TortoiseHg (http://tortoisehg.org)
 • Integrates Mercurial directly into explorer.
Installation (Mac OS X)


• Install the DMG file.
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"
.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)

Contenu connexe

En vedette (8)

LessCSS Presentation @ April 2015 GTALUG Meeting
LessCSS Presentation @ April 2015 GTALUG MeetingLessCSS Presentation @ April 2015 GTALUG Meeting
LessCSS Presentation @ April 2015 GTALUG Meeting
 
extending-php
extending-phpextending-php
extending-php
 
Django GTALUG Presentation
Django GTALUG PresentationDjango GTALUG Presentation
Django GTALUG Presentation
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
 
The Internet and Your Business
The Internet and Your BusinessThe Internet and Your Business
The Internet and Your Business
 
GTALUG Presentation on CouchDB
GTALUG Presentation on CouchDBGTALUG Presentation on CouchDB
GTALUG Presentation on CouchDB
 
The Devil and HTML5
The Devil and HTML5The Devil and HTML5
The Devil and HTML5
 
Take a Stroll in the Bazaar
Take a Stroll in the BazaarTake a Stroll in the Bazaar
Take a Stroll in the Bazaar
 

Similaire à GTALUG Short Talk On Mercurial

Build Golang projects properly with Makefiles
Build Golang projects properly with MakefilesBuild Golang projects properly with Makefiles
Build Golang projects properly with Makefiles
Raül Pérez
 
Git Introduction
Git IntroductionGit Introduction
Git Introduction
Gareth Hall
 

Similaire à GTALUG Short Talk On Mercurial (20)

Becoming a Git Master
Becoming a Git MasterBecoming a Git Master
Becoming a Git Master
 
Git For Beginer
Git For BeginerGit For Beginer
Git For Beginer
 
Get Good With Git
Get Good With GitGet Good With Git
Get Good With Git
 
Git real slides
Git real slidesGit real slides
Git real slides
 
Git_real_slides
Git_real_slidesGit_real_slides
Git_real_slides
 
Loading...git
Loading...gitLoading...git
Loading...git
 
Introducción a git y GitHub
Introducción a git y GitHubIntroducción a git y GitHub
Introducción a git y GitHub
 
Build Golang projects properly with Makefiles
Build Golang projects properly with MakefilesBuild Golang projects properly with Makefiles
Build Golang projects properly with Makefiles
 
Becoming a Git Master - Nicola Paolucci
Becoming a Git Master - Nicola PaolucciBecoming a Git Master - Nicola Paolucci
Becoming a Git Master - Nicola Paolucci
 
Git walkthrough
Git walkthroughGit walkthrough
Git walkthrough
 
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017
 
Did you git yet?
Did you git yet?Did you git yet?
Did you git yet?
 
Git basics
Git basicsGit basics
Git basics
 
Working with Git
Working with GitWorking with Git
Working with Git
 
Get going with_git_ppt
Get going with_git_pptGet going with_git_ppt
Get going with_git_ppt
 
Git Concepts, Commands and Connectivity
Git Concepts, Commands and ConnectivityGit Concepts, Commands and Connectivity
Git Concepts, Commands and Connectivity
 
Git - Get Ready To Use It
Git - Get Ready To Use ItGit - Get Ready To Use It
Git - Get Ready To Use It
 
Tool Time
Tool TimeTool Time
Tool Time
 
Advanced Git
Advanced GitAdvanced Git
Advanced Git
 
Git Introduction
Git IntroductionGit Introduction
Git Introduction
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

GTALUG Short Talk On Mercurial

  • 2. • Allows multiple people to collaborate on a file.
  • 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) • OpenOffice.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 official exe. • Download TortoiseHg (http://tortoisehg.org) • Integrates Mercurial directly into explorer.
  • 24. Installation (Mac OS X) • Install the DMG file.
  • 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"
  • 42.
  • 43.
  • 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)