SlideShare una empresa de Scribd logo
1 de 20
MERCURIAL TRAINING
www.phuongdo.vn
https://www.facebook.com/kezaburo
6/4/2012 HCM city
Agenda
• Install the Mercurial on a SUSE machine
• Behind the Mercurial
• Basic commands in the Mercurial
• Mq extension tool for patching
• Common Issues
• The Mercurial vs other SCM
www.phuongdo.vn Eng. TrungHuynh™
INSTALL on SuSE
• Find the version of SUSE
– cat /etc/SuSE-release
• Find the path of repo of the Mercurial for that SuSE version
– http://mercurial.selenic.com/wiki/Download
– http://download.opensuse.org/repositories/devel:/tools:/scm/
openSUSE_11.4/devel:tools:scm.repo
• Use the zypper tool to add the repo’s path
zypper ar http://download.opensuse.org/repositories/devel:/tools:/scm/openSUSE_11.4/devel:tools:scm.repo
• Use the zypper/yast tool to install the Mercurial
zypper install mercurial
Check the installation: hg debuginstall
www.phuongdo.vn
Eng. TrungHuynh™
Basic Concepts
• Topology
– Mercurial is completely decentralized system, and thus has no concept of central
repository
– In Mercurial, the user can define the topology by themselves for sharing the changes
www.phuongdo.vn
Eng. TrungHuynh™
Basic Concepts
• Repository and working directory
– Mercurial repositories contain a working coupled with a store
– For example: /home/repository/ directory is as below figure
• In working directory, the state of files will be refer to a specific revision of repository
• In .hg/store/data/ folder, it contains in formation about changes of each file
www.phuongdo.vn Eng. TrungHuynh™
Main.c Main.h
.hg
Rev 0 Rev 1 Rev 2 Rev 3parent parent parent
Working directory
repository
Basic Concepts
• Revision is local version index for the project
• Changeset is unique version index for global
• In above figure, we have a repository with two heads
and two branches
• Head is the revision has no child revision. And the
biggest revsion head is the tip
www.phuongdo.vn Eng. TrungHuynh™
0 1 2 3 4
5
6(tip)
Working
dirhead
head
Branch Achangeset: 1:d7fd576b6c9b
| user: trunghuynh
| date: Fri Jun 08 17:28:32
2012 +0700
| files: hello1.cc
revision
Common Commands
hg help <command>
• Hg init -> initialize a repository, of course it is a directory
• Hg add -> inform the Mercurial that you want it keep track your files
• Hg clone -> clone the project from a Mercurial repository
– Especial, we can clone with the specific branch: hg clone <main-repo> <new-repo> -r <head of specific
branc>
• Hg pull -> get the changes from our peers into our repository
– Notice that pull command just update our backlog information of our repository
• Hg update -> will update the changes after pulling, in fact it is merging the current
working revision with the change from pulling
• Hg commit -> like saving edited word file. It will create a changeset
• Hg push -> pushing our changes for others pulling
– The backlog information of main repo will automatically update when the child repos push their
changes
• Hg branch ->check the current branch or set branch
– Notice that branch name is permanently recorded as part of the changeset’s metadata
– Branch name is used as the tip revision when we want checkout a branch
• Hg log ->show the information about the repository
• Hg tip ->show information of the “tip” revision. The “tip” revision is the head with largest
revision www.phuongdo.vn
Eng. TrungHuynh™
Common Commands
• Hg merge -> merge the working directory with other
revision
• Hg diff -> show what is changed since the last committing
• Hg revert -> revert the specific file into the unmodified
state
• Hg incoming ->see what will be updated when we do a pull
action
• Hg rollback  uncommit…
• Hg annotate <filename>
• Hg strip <revision number> ->delete a specific revision
www.phuongdo.vn
Eng. TrungHuynh™
Hg commit
www.phuongdo.vn
Eng. TrungHuynh™
0:qe7
1:de5
2:ye2
3:af9
@
Alice’s Repo
main.c
model.h
model.c
Working directory
socket.c
3:a3e
changed
When we commit a new
changeset will be created
hg push/pull
www.phuongdo.vn Eng. TrungHuynh™
Main Repos
0:qe7
1:de5
0:qe7
1:de5
2:af9
Bob’s Repo
0:qe7
1:de5
2:ye2
Alice’s Repo
2:af9
2:af9
hg pull <Bob’s repo>
@
@
@
@ Mark parent revision
of working directory
A revision of repo
hg merge/update
www.phuongdo.vn Eng. TrungHuynh™
Alice’s Repo
0:qe7
1:de5
2:ye2
3:af9
@
The “hg update” command will
change our current working
revision that we are working
on.
The “hg merge” command will
merge a specific revision to the
current working revision. In this
case, the change from af9
changeset will merge into the
revsion 2.
After successful merging, we
has to commit to create a new
changeset/revision which
contains both change from
revision 3 and 2
4:kq6
Advance Using Mercurial
• Merge conflict:
– The conflict happens when two changesets have modified the same file’s section
with different way. In this case, the Mercurial need a help from user.
www.phuongdo.vn Eng. TrungHuynh™
Main()
{
printf(“hello Mercurial world”);
printf(“Merge is fun and easy”);
}
Main()
{
printf(“hello Mercurial world”);
printf(“Merge is difficult”);
}
Changeset 4 Changeset 7
Common Issues
• To resolve that conflicts we need to open that file
and edit to what we want. After that we use “hg
resolve <filename> to correct the confliction.
• To support merging, we can use a graphical tool
such as kdiff3 as the best tool.
www.phuongdo.vn Eng. TrungHuynh™
Common Issues
• abort: outstanding uncommitted changes
– The cause is merging with uncommitted changes.
– There open happens when we pull while there are some
uncommitted change
– Have two solutions are:
• Always commit changes before pulling
• Extract the uncommit changes into the file and pulling. After that imports
the uncommit change file
• abort: push creates new remote heads on branch 'default'!
– When we push some things that will create new heads in remote
repo. Mercurial thinks that is an impolite action. The best way is
when pulling and merge before pushing
• “abort: crosses branches (use 'hg merge' or 'hg update -C')”
– Update the working revision in the different branch
www.phuongdo.vn Eng. TrungHuynh™
MQ tool
• MQ is the extension tool of Mercurial that
manages your patches
– Modify the .hgrc to enable MQ
[extensions]
hgext.mq =
www.phuongdo.vn Eng. TrungHuynh™
MQ tool
what is patch file?
diff --git a/opensaf.spec.in b/opensaf.spec.in
--- a/opensaf.spec.in
+++ b/opensaf.spec.in
@@ -14,6 +14,7 @@
%define is_ais_msg %(test "@AIS_MSG_ENABLED@" = "yes" && echo 1 || echo 0)
%define is_ais_smf %(test "@AIS_SMF_ENABLED@" = "yes" && echo 1 || echo 0)
%define is_tipc_trans %(test "@TIPC_TRANSPORT_ENABLED@" = "yes" && echo 1 || echo 0)
+%define is_ais_pm %(test "@AIS_PM_ENABLED@" = "yes" && echo 1 || echo 0)
%define _pkglibdir %{_libdir}/%{name}
%define _pkgsysconfdir %{_sysconfdir}/%{name}
@@ -541,6 +542,46 @@
%endif
+%if %is_ais_pm
www.phuongdo.vn Eng. TrungHuynh™
Diff header
Hunk
MQ tool
• Create a patch repository
– Hg qinit
• This command will create a “patches” directory in “.hg” directory and
also create a patch queue
• In patches folder contains our patches and more two files that are a
series file and a status file
• The series file contains all of patches name that MQ knows
• The status file contains status of all patches that are applied currently
• Hg qseries command lists every patch that MQ knows
about in a repository
• Hg qapplied command lists every patch that MQ has
applied in a repository
www.phuongdo.vn Eng. TrungHuynh™
MQ tool
• Hg qnew –m “message for patch” <patch name>
– Create a new patch with a patch name
• Hg qrefresh
– Save new change to the top applied patch
Note: hg revert will let you come back the last refresh
state.
www.phuongdo.vn Eng. TrungHuynh™
MQ tool
• Hg qpop
– Pop out the top patch from the queue
• Hg qpush
– Push a patch into the queue
• Hg qdelete <patch.name>
– Delete a patch from a queue. The file is still preserve
in patch repository
• Hg qfinish ??
www.phuongdo.vn Eng. TrungHuynh™
Mercurial vs Others
www.phuongdo.vn Eng. TrungHuynh™
From www.infoQ.com

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Git introduction workshop for scientists
Git introduction workshop for scientists Git introduction workshop for scientists
Git introduction workshop for scientists
 
Advanced Git Presentation By Swawibe
Advanced Git Presentation By SwawibeAdvanced Git Presentation By Swawibe
Advanced Git Presentation By Swawibe
 
Git: An introduction of plumbing and porcelain commands
Git: An introduction of plumbing and porcelain commandsGit: An introduction of plumbing and porcelain commands
Git: An introduction of plumbing and porcelain commands
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
 
git and github
git and githubgit and github
git and github
 
Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshell
 
Github
GithubGithub
Github
 
Introduction to Git (part 1)
Introduction to Git (part 1)Introduction to Git (part 1)
Introduction to Git (part 1)
 
Grokking opensource with github
Grokking opensource with githubGrokking opensource with github
Grokking opensource with github
 
Git & GitHub WorkShop
Git & GitHub WorkShopGit & GitHub WorkShop
Git & GitHub WorkShop
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
GIT in a nutshell
GIT in a nutshellGIT in a nutshell
GIT in a nutshell
 
Git github
Git githubGit github
Git github
 
Git commands
Git commandsGit commands
Git commands
 
Deep dark-side of git: How git works internally
Deep dark-side of git: How git works internallyDeep dark-side of git: How git works internally
Deep dark-side of git: How git works internally
 
Git & GitHub for Beginners
Git & GitHub for BeginnersGit & GitHub for Beginners
Git & GitHub for Beginners
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
Git Introduction
Git IntroductionGit Introduction
Git Introduction
 
Learn Git Basics
Learn Git BasicsLearn Git Basics
Learn Git Basics
 

Destacado

Destacado (13)

Mercurial
MercurialMercurial
Mercurial
 
Virt monitoring
Virt monitoringVirt monitoring
Virt monitoring
 
Mercurial DVCS presentation to DevJam 11/4/2009
Mercurial DVCS presentation to DevJam 11/4/2009Mercurial DVCS presentation to DevJam 11/4/2009
Mercurial DVCS presentation to DevJam 11/4/2009
 
Mercurial 簡介
Mercurial 簡介Mercurial 簡介
Mercurial 簡介
 
Puppet_training
Puppet_trainingPuppet_training
Puppet_training
 
Svn vs mercurial vs github
Svn  vs  mercurial vs  githubSvn  vs  mercurial vs  github
Svn vs mercurial vs github
 
Sql joins
Sql joinsSql joins
Sql joins
 
Types Of Join In Sql Server - Join With Example In Sql Server
Types Of Join In Sql Server - Join With Example In Sql ServerTypes Of Join In Sql Server - Join With Example In Sql Server
Types Of Join In Sql Server - Join With Example In Sql Server
 
SQL Joins
SQL JoinsSQL Joins
SQL Joins
 
SQL Joins and Query Optimization
SQL Joins and Query OptimizationSQL Joins and Query Optimization
SQL Joins and Query Optimization
 
Sql joins
Sql joinsSql joins
Sql joins
 
SQL JOIN
SQL JOINSQL JOIN
SQL JOIN
 
Vandyke SecureCRT tips and tricks
Vandyke SecureCRT tips and tricksVandyke SecureCRT tips and tricks
Vandyke SecureCRT tips and tricks
 

Similar a Mercurial training

Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGeoff Hoffman
 
Working with multiple git repositories
Working with multiple git repositoriesWorking with multiple git repositories
Working with multiple git repositoriesJulien Pivotto
 
Version control git - lecture-1
Version control git - lecture-1Version control git - lecture-1
Version control git - lecture-1Abdul Rahim
 
Luis atencio on_git
Luis atencio on_gitLuis atencio on_git
Luis atencio on_gitLuis Atencio
 
Software Versioning with Bitbucket and Eclipse
Software Versioning with Bitbucket and EclipseSoftware Versioning with Bitbucket and Eclipse
Software Versioning with Bitbucket and EclipseHüseyin Ergin
 
CSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITCSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITPouriaQashqai1
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners HubSpot
 
Take the next step with git
Take the next step with gitTake the next step with git
Take the next step with gitKarin Taliga
 
Composer JSON kills make files
Composer JSON kills make filesComposer JSON kills make files
Composer JSON kills make filesropsu
 
IS - section 1 - modifiedFinal information system.pptx
IS - section 1 - modifiedFinal information system.pptxIS - section 1 - modifiedFinal information system.pptx
IS - section 1 - modifiedFinal information system.pptxNaglaaAbdelhady
 
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Pantheon
 
Git version control and trunk based approach with VSTS
Git version control and trunk based approach with VSTSGit version control and trunk based approach with VSTS
Git version control and trunk based approach with VSTSMurughan Palaniachari
 

Similar a Mercurial training (20)

Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using Git
 
Working with multiple git repositories
Working with multiple git repositoriesWorking with multiple git repositories
Working with multiple git repositories
 
The Galaxy toolshed
The Galaxy toolshedThe Galaxy toolshed
The Galaxy toolshed
 
Version control git - lecture-1
Version control git - lecture-1Version control git - lecture-1
Version control git - lecture-1
 
git2.ppt
git2.pptgit2.ppt
git2.ppt
 
Basics of git
Basics of gitBasics of git
Basics of git
 
Git and Github
Git and GithubGit and Github
Git and Github
 
Luis atencio on_git
Luis atencio on_gitLuis atencio on_git
Luis atencio on_git
 
Software Versioning with Bitbucket and Eclipse
Software Versioning with Bitbucket and EclipseSoftware Versioning with Bitbucket and Eclipse
Software Versioning with Bitbucket and Eclipse
 
git2.ppt
git2.pptgit2.ppt
git2.ppt
 
CSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITCSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GIT
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
 
Take the next step with git
Take the next step with gitTake the next step with git
Take the next step with git
 
Composer JSON kills make files
Composer JSON kills make filesComposer JSON kills make files
Composer JSON kills make files
 
Hg version control bioinformaticians
Hg version control bioinformaticiansHg version control bioinformaticians
Hg version control bioinformaticians
 
Version control
Version controlVersion control
Version control
 
IS - section 1 - modifiedFinal information system.pptx
IS - section 1 - modifiedFinal information system.pptxIS - section 1 - modifiedFinal information system.pptx
IS - section 1 - modifiedFinal information system.pptx
 
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
 
Git version control and trunk based approach with VSTS
Git version control and trunk based approach with VSTSGit version control and trunk based approach with VSTS
Git version control and trunk based approach with VSTS
 
Hg for bioinformatics, second part
Hg for bioinformatics, second partHg for bioinformatics, second part
Hg for bioinformatics, second part
 

Último

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 

Último (20)

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 

Mercurial training

  • 2. Agenda • Install the Mercurial on a SUSE machine • Behind the Mercurial • Basic commands in the Mercurial • Mq extension tool for patching • Common Issues • The Mercurial vs other SCM www.phuongdo.vn Eng. TrungHuynh™
  • 3. INSTALL on SuSE • Find the version of SUSE – cat /etc/SuSE-release • Find the path of repo of the Mercurial for that SuSE version – http://mercurial.selenic.com/wiki/Download – http://download.opensuse.org/repositories/devel:/tools:/scm/ openSUSE_11.4/devel:tools:scm.repo • Use the zypper tool to add the repo’s path zypper ar http://download.opensuse.org/repositories/devel:/tools:/scm/openSUSE_11.4/devel:tools:scm.repo • Use the zypper/yast tool to install the Mercurial zypper install mercurial Check the installation: hg debuginstall www.phuongdo.vn Eng. TrungHuynh™
  • 4. Basic Concepts • Topology – Mercurial is completely decentralized system, and thus has no concept of central repository – In Mercurial, the user can define the topology by themselves for sharing the changes www.phuongdo.vn Eng. TrungHuynh™
  • 5. Basic Concepts • Repository and working directory – Mercurial repositories contain a working coupled with a store – For example: /home/repository/ directory is as below figure • In working directory, the state of files will be refer to a specific revision of repository • In .hg/store/data/ folder, it contains in formation about changes of each file www.phuongdo.vn Eng. TrungHuynh™ Main.c Main.h .hg Rev 0 Rev 1 Rev 2 Rev 3parent parent parent Working directory repository
  • 6. Basic Concepts • Revision is local version index for the project • Changeset is unique version index for global • In above figure, we have a repository with two heads and two branches • Head is the revision has no child revision. And the biggest revsion head is the tip www.phuongdo.vn Eng. TrungHuynh™ 0 1 2 3 4 5 6(tip) Working dirhead head Branch Achangeset: 1:d7fd576b6c9b | user: trunghuynh | date: Fri Jun 08 17:28:32 2012 +0700 | files: hello1.cc revision
  • 7. Common Commands hg help <command> • Hg init -> initialize a repository, of course it is a directory • Hg add -> inform the Mercurial that you want it keep track your files • Hg clone -> clone the project from a Mercurial repository – Especial, we can clone with the specific branch: hg clone <main-repo> <new-repo> -r <head of specific branc> • Hg pull -> get the changes from our peers into our repository – Notice that pull command just update our backlog information of our repository • Hg update -> will update the changes after pulling, in fact it is merging the current working revision with the change from pulling • Hg commit -> like saving edited word file. It will create a changeset • Hg push -> pushing our changes for others pulling – The backlog information of main repo will automatically update when the child repos push their changes • Hg branch ->check the current branch or set branch – Notice that branch name is permanently recorded as part of the changeset’s metadata – Branch name is used as the tip revision when we want checkout a branch • Hg log ->show the information about the repository • Hg tip ->show information of the “tip” revision. The “tip” revision is the head with largest revision www.phuongdo.vn Eng. TrungHuynh™
  • 8. Common Commands • Hg merge -> merge the working directory with other revision • Hg diff -> show what is changed since the last committing • Hg revert -> revert the specific file into the unmodified state • Hg incoming ->see what will be updated when we do a pull action • Hg rollback  uncommit… • Hg annotate <filename> • Hg strip <revision number> ->delete a specific revision www.phuongdo.vn Eng. TrungHuynh™
  • 9. Hg commit www.phuongdo.vn Eng. TrungHuynh™ 0:qe7 1:de5 2:ye2 3:af9 @ Alice’s Repo main.c model.h model.c Working directory socket.c 3:a3e changed When we commit a new changeset will be created
  • 10. hg push/pull www.phuongdo.vn Eng. TrungHuynh™ Main Repos 0:qe7 1:de5 0:qe7 1:de5 2:af9 Bob’s Repo 0:qe7 1:de5 2:ye2 Alice’s Repo 2:af9 2:af9 hg pull <Bob’s repo> @ @ @ @ Mark parent revision of working directory A revision of repo
  • 11. hg merge/update www.phuongdo.vn Eng. TrungHuynh™ Alice’s Repo 0:qe7 1:de5 2:ye2 3:af9 @ The “hg update” command will change our current working revision that we are working on. The “hg merge” command will merge a specific revision to the current working revision. In this case, the change from af9 changeset will merge into the revsion 2. After successful merging, we has to commit to create a new changeset/revision which contains both change from revision 3 and 2 4:kq6
  • 12. Advance Using Mercurial • Merge conflict: – The conflict happens when two changesets have modified the same file’s section with different way. In this case, the Mercurial need a help from user. www.phuongdo.vn Eng. TrungHuynh™ Main() { printf(“hello Mercurial world”); printf(“Merge is fun and easy”); } Main() { printf(“hello Mercurial world”); printf(“Merge is difficult”); } Changeset 4 Changeset 7
  • 13. Common Issues • To resolve that conflicts we need to open that file and edit to what we want. After that we use “hg resolve <filename> to correct the confliction. • To support merging, we can use a graphical tool such as kdiff3 as the best tool. www.phuongdo.vn Eng. TrungHuynh™
  • 14. Common Issues • abort: outstanding uncommitted changes – The cause is merging with uncommitted changes. – There open happens when we pull while there are some uncommitted change – Have two solutions are: • Always commit changes before pulling • Extract the uncommit changes into the file and pulling. After that imports the uncommit change file • abort: push creates new remote heads on branch 'default'! – When we push some things that will create new heads in remote repo. Mercurial thinks that is an impolite action. The best way is when pulling and merge before pushing • “abort: crosses branches (use 'hg merge' or 'hg update -C')” – Update the working revision in the different branch www.phuongdo.vn Eng. TrungHuynh™
  • 15. MQ tool • MQ is the extension tool of Mercurial that manages your patches – Modify the .hgrc to enable MQ [extensions] hgext.mq = www.phuongdo.vn Eng. TrungHuynh™
  • 16. MQ tool what is patch file? diff --git a/opensaf.spec.in b/opensaf.spec.in --- a/opensaf.spec.in +++ b/opensaf.spec.in @@ -14,6 +14,7 @@ %define is_ais_msg %(test "@AIS_MSG_ENABLED@" = "yes" && echo 1 || echo 0) %define is_ais_smf %(test "@AIS_SMF_ENABLED@" = "yes" && echo 1 || echo 0) %define is_tipc_trans %(test "@TIPC_TRANSPORT_ENABLED@" = "yes" && echo 1 || echo 0) +%define is_ais_pm %(test "@AIS_PM_ENABLED@" = "yes" && echo 1 || echo 0) %define _pkglibdir %{_libdir}/%{name} %define _pkgsysconfdir %{_sysconfdir}/%{name} @@ -541,6 +542,46 @@ %endif +%if %is_ais_pm www.phuongdo.vn Eng. TrungHuynh™ Diff header Hunk
  • 17. MQ tool • Create a patch repository – Hg qinit • This command will create a “patches” directory in “.hg” directory and also create a patch queue • In patches folder contains our patches and more two files that are a series file and a status file • The series file contains all of patches name that MQ knows • The status file contains status of all patches that are applied currently • Hg qseries command lists every patch that MQ knows about in a repository • Hg qapplied command lists every patch that MQ has applied in a repository www.phuongdo.vn Eng. TrungHuynh™
  • 18. MQ tool • Hg qnew –m “message for patch” <patch name> – Create a new patch with a patch name • Hg qrefresh – Save new change to the top applied patch Note: hg revert will let you come back the last refresh state. www.phuongdo.vn Eng. TrungHuynh™
  • 19. MQ tool • Hg qpop – Pop out the top patch from the queue • Hg qpush – Push a patch into the queue • Hg qdelete <patch.name> – Delete a patch from a queue. The file is still preserve in patch repository • Hg qfinish ?? www.phuongdo.vn Eng. TrungHuynh™
  • 20. Mercurial vs Others www.phuongdo.vn Eng. TrungHuynh™ From www.infoQ.com

Notas del editor

  1. pathsAssigns symbolic names to repositories. The left side is the symbolic name, and the right gives the directory or URL that is the location of the repository. Default paths can be declared by setting the following entries.defaultDirectory or URL to use when pulling if no source is specified. Default is set to repository from which the current repository was cloned.default-pushOptional. Directory or URL to use when pushing if no destination is specified.
  2. Mercurial store the differences between the successive versions and periodic complete version of a file. Both of them are compressed before storingNodeId is simplify a SHA1 hash of the current file concatenated with the nodeids of one or both parents of the current revision.What will happens when we change the name of file ?
  3.  Reverts changes in your working directory back to that version, but keeps the current parents for the next checkin. This command exists for undoing changes in current versions, not for working on old versions.hg status reports when file contents or flags have changed relative to either parent. hg diff only reports changed contents relative to the first parent. You can see flag information with the --git option tohg diff and deltas relative to the other parent with -r. I want a clean, empty working directoryThe easiest thing to do is run hg clone -U which will create a fresh clone without checking out a working copy.If the repository already has a working copy, you can remove it running hg update null.If you&apos;ve just committed it, and you haven&apos;t done any other commits or pulls since, you may be able to use rollback (see Rollback) to undo the last commit transactionHow can I do a &quot;hg log&quot; of a remote repository?The correct way to do this is cloning the remote repository to your computer and then doing a hg log locally.
  4. Mercurial will push/pull all branches by default, while git will push/pull only the current branch.If you want to push/pull only a single branch with Mercurial you can use the --rev option (-r for short) and specify the tip revision of the branch
  5. What Mercurial can’t do:Can not check out only on directory of a repository$ hg archive -t zip ../hg1.zip what do you when you want to send the source to some where?$ hg export -o ../hg1-rev28.diff 28 export the change in the revision 28 vs $ hg import ../hg1-rev28.diff (hg1-rev28.diff ~hg1-rev28.patch)When we use “hg merge” command. If there have some conflicts whe has to decide what thing we should keep.That means we has to open the conflict file, then we edit and save. The last thing is “hg resolve &lt;option here&gt; “ command.
  6. What Mercurial can’t do:Can not check out only on directory of a repository$ hg archive -t zip ../hg1.zip what do you when you want to send the source to some where?$ hg export -o ../hg1-rev28.diff 28 export the change in the revision 28 vs $ hg import ../hg1-rev28.diff (hg1-rev28.diff ~hg1-rev28.patch)When we use “hg merge” command. If there have some conflicts whe has to decide what thing we should keep.That means we has to open the conflict file, then we edit and save. The last thing is “hg resolve &lt;option here&gt; “ command.
  7. Obviously, by using patching technique we can separate the changes with base code. If there is unnecessary the changes, we can easy move the changes away. Hgqrefresh can runned any time and the topmost applied patch will be updated.Ancestor of Mq is quilt tool
  8. @@ -14,6 +14,7 @@Begin with number line is 14 original with 6 line after but after modified the number of line is 7Is mean removed line+ is mean added line
  9. the best performance of it. No commentsFirst of all, try to “batch” operations together. Every time you run qpush or qpop, these commands scan the working directory once to make sure you haven&apos;t made some changes and then forgotten to run qrefresh. On a small tree, the time that this scan takes is unnoticeable. However, on a medium-sized tree (containing tens of thousands of files), it can take a second or more. No comments
  10. You should notice that Mercurial doubles the number of files in your repository (the historic is kept per file in .hg/store/data). It doesn&apos;t seem to be a good choice for Windows system running on NTFS. It&apos;s also interesting to see that git takes a big advantage of the system when executing command. While Hg and Bzr do not spend a big proportion of time in system, Git can take up to 10-40% cpu time within system call, which raises the question as to how it will perform on Windows system where the git-developers won&apos;t have access to all the system performance trick they are used to with Linux. Single Merges and Merge Queues should be tested, this is a tiedous part to benchmark.http://www.infoq.com/articles/dvcs-guidehttp://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/