SlideShare a Scribd company logo
Migration
         from
Subversion to Mercurial
          Ladislav Prskavec
      http://blog.prskavec.net
   ladislav.prskavec@gmail.com



   OpenMeeting 27.9.2009
Why Mercurial ?

   Bitbucket.org (php-frameworks.net)
   Google Code (php4hudson, phpchangelogs)
   Keywords (phpdoc, git not support)
   Revisions (git not support)
   Netbeans (native support)
   Eclipse plugin (Zend Studio)
       http://www.vectrace.com/mercurialeclipse/
   Many extensions

Negatives
  partial rebase (extension)
  experimental subrepos in Mercurial 1.3.1 (svn:externals)
Why Mercurial ?
Bitbucket.org (private rep, issues)
SVN xml logs to Hg

Question: How make svn log --xml

Answer: hglog.sh
echo '<?xml version="1.0"?>n<log>n' >$1.xml
hg log --template '<logentry revision="{rev}">
<author>{author|obfuscate}</author>
<date>{date|isodate}</date>
<msg>{desc|escape}n</msg>
<paths><path>{files}</path></paths>
</logentry>n' $1/ >>$1.xml
echo '</log>n' >>$1.xml
RCS keywords

Question: How make keywords?

Answer: Keywords extension (part from .hgrc)
[extensions]
hgext.keyword =
keyword=/usr/share/python-support/mercurial-common/hgext/keyword.py
[keyword]
**.php =
**.xml =
[keywordmaps]
RCSFile = {file|basename},v
Author = {author|user}
Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
Source = {root}/{file},v
Date = {date|utcdate}
Id = {file|basename},v {node|short} {date|utcdate} {author|user}
Revision = {node|short}
Deployment

SVN deployment script

svn --force export http://svn.rep.cz/svn/project/trunk/ /srv/www/project.cz/
/usr/bin/svn2cl --strip-prefix=trunk --break-before-msg=2 --group-by-day --separate-daylogs -i --
authors=/srv/www/project.cz/application/configs/authors.xml http://svn.rep.cz/svn/project/trunk -o /srv/www/project.
cz/changelog
sed -i 's/development/production/g' /srv/www/project.cz/public/.htaccess
chown -Rf www-data:www-data /srv/www/project.cz/


Mercurial deployment script

cd ~/hg-ws/project.cz/
hg pull
hg up
hg archive /srv/www/project.cz/
sed -i 's/development/production/g' /srv/www/project.cz/public/.htaccess
chown -Rf www-data:www-data /srv/www/project.cz/
Hooks scripts

Subversion (server, repos/hooks/pre-commit)
#!/bin/sh
REPOS="$1"
TXN="$2"
# check php
CHANGED=`svnlook changed -t "$TXN" "$REPOS" | awk '{print $2}' | grep .php$`

for FILE in $CHANGED
do
MESSAGE=`svnlook cat -t "$TXN" "$REPOS" "$FILE" | $PHP -l `
if [ $? -ne 0 ]
then
exit 1
fi
done
exit 0


Mercurial (in .hg/hgrc)
[hooks]
precommit = test `find -name *.php -exec php -l {} ; | wc -l` -eq 1
Summary

Evolution not revolution
Some workflow for my projects in Mercurial and Svn
Local commits
hg backout
hg rollback (working only localy)
Check extensions
   http://mercurial.selenic.com/wiki/UsingExtensions
      Convert (from others SCM: cvs, svn, git, darcs, bzr, arch, mnt)
      Fetch
      Keyword
      Notify
      Rebase
      Record (staging area)
Thanks for your attention

http://slideshare.net/ladislavprskavec


           Ladislav Prskavec
       http://blog.prskavec.net
    ladislav.prskavec@gmail.com

More Related Content

What's hot (20)

PPTX
Inside Sqale's Backend at Sapporo Ruby Kaigi 2012
Gosuke Miyashita
 
PDF
NginX - good practices, tips and advanced techniques
Claudio Borges
 
PDF
KubeCon EU 2016: Getting the Jobs Done With Kubernetes
KubeAcademy
 
PDF
CoreOS + Kubernetes @ All Things Open 2015
Brandon Philips
 
PPTX
Big Data Day LA 2016/ Big Data Track - Fluentd and Embulk: Collect More Data,...
Data Con LA
 
PDF
用 Go 語言打造多台機器 Scale 架構
Bo-Yi Wu
 
PDF
Containers: What are they, Really?
Sneha Inguva
 
PDF
Becoming a Git Master
Nicola Paolucci
 
PDF
Lua tech talk
Locaweb
 
PPTX
Docker orchestration v4
Hojin Kim
 
PDF
Docker command
Eric Ahn
 
PDF
Docker remote-api
Eric Ahn
 
PDF
What Have Syscalls Done for you Lately?
Docker, Inc.
 
PPTX
DPNHTW
metaldart
 
PPTX
OpenShift4 Installation by UPI on kvm
Jooho Lee
 
PDF
Quay 3.3 installation
Jooho Lee
 
PDF
Fluentd - CNCF Paris
Horgix
 
PPTX
CoreOS in a Nutshell
CoreOS
 
PDF
Using ngx_lua in UPYUN
Cong Zhang
 
PDF
Ansible with AWS
Allan Denot
 
Inside Sqale's Backend at Sapporo Ruby Kaigi 2012
Gosuke Miyashita
 
NginX - good practices, tips and advanced techniques
Claudio Borges
 
KubeCon EU 2016: Getting the Jobs Done With Kubernetes
KubeAcademy
 
CoreOS + Kubernetes @ All Things Open 2015
Brandon Philips
 
Big Data Day LA 2016/ Big Data Track - Fluentd and Embulk: Collect More Data,...
Data Con LA
 
用 Go 語言打造多台機器 Scale 架構
Bo-Yi Wu
 
Containers: What are they, Really?
Sneha Inguva
 
Becoming a Git Master
Nicola Paolucci
 
Lua tech talk
Locaweb
 
Docker orchestration v4
Hojin Kim
 
Docker command
Eric Ahn
 
Docker remote-api
Eric Ahn
 
What Have Syscalls Done for you Lately?
Docker, Inc.
 
DPNHTW
metaldart
 
OpenShift4 Installation by UPI on kvm
Jooho Lee
 
Quay 3.3 installation
Jooho Lee
 
Fluentd - CNCF Paris
Horgix
 
CoreOS in a Nutshell
CoreOS
 
Using ngx_lua in UPYUN
Cong Zhang
 
Ansible with AWS
Allan Denot
 

Viewers also liked (6)

ODP
Zend Framework
Ladislav Prskavec
 
ODP
SVN základy
Ladislav Prskavec
 
PDF
What We Learned On the Way to the Ballot Box
sarosenblatt
 
PDF
Tessel is a microcontroller that runs JavaScript.
Ladislav Prskavec
 
PPSX
Darren Sprute Portfolio
Darren Sprute
 
PDF
Lee Technologies Corporate Brochure
cwoodson
 
Zend Framework
Ladislav Prskavec
 
SVN základy
Ladislav Prskavec
 
What We Learned On the Way to the Ballot Box
sarosenblatt
 
Tessel is a microcontroller that runs JavaScript.
Ladislav Prskavec
 
Darren Sprute Portfolio
Darren Sprute
 
Lee Technologies Corporate Brochure
cwoodson
 
Ad

Similar to Subversion To Mercurial (20)

ODP
Practical SVN for PHP Developers
Lorna Mitchell
 
ZIP
Mercurial Distributed Version Control
David Stockton
 
PPTX
Mercurial
Robert MacLean
 
PPTX
Mercurial presentation
dotNETUserGroupDnipro
 
PDF
Introduction to mercurial
IT Booze
 
PDF
AtlasCamp 2010: What is DVCS and why it will change the way we work - Jens Sc...
Atlassian
 
PPT
How to start your open source project
Eslam Diaa
 
PDF
Building and Deploying PHP Apps Using phing
Mihail Irintchev
 
PDF
Dvcs With Mercurial (No Notes)
Ted Naleid
 
PDF
Getting Started with (Distributed) Version Control
John Paulett
 
ODP
PHP Quality Assurance Workshop PHPBenelux
Nick Belhomme
 
PDF
Mercurial The Definitive Guide 1st Edition Bryan O'Sullivan
aydjantertsi22
 
PDF
Hg version control bioinformaticians
Giovanni Marco Dall'Olio
 
PDF
Mercurial byexample
shreeve
 
PDF
Introduction to Mercurial, or "Why we're switching from SVN no matter what"
Adam Pah
 
ODP
Subversion in a distributed world
Lorna Mitchell
 
PDF
Distributed Version Control (DVCS) With Mercurial
Ted Naleid
 
PPTX
Mercurial training
Trung Huynh
 
PDF
The Mercurial SCM
elliando dias
 
ODP
The Galaxy toolshed
Joachim Jacob
 
Practical SVN for PHP Developers
Lorna Mitchell
 
Mercurial Distributed Version Control
David Stockton
 
Mercurial
Robert MacLean
 
Mercurial presentation
dotNETUserGroupDnipro
 
Introduction to mercurial
IT Booze
 
AtlasCamp 2010: What is DVCS and why it will change the way we work - Jens Sc...
Atlassian
 
How to start your open source project
Eslam Diaa
 
Building and Deploying PHP Apps Using phing
Mihail Irintchev
 
Dvcs With Mercurial (No Notes)
Ted Naleid
 
Getting Started with (Distributed) Version Control
John Paulett
 
PHP Quality Assurance Workshop PHPBenelux
Nick Belhomme
 
Mercurial The Definitive Guide 1st Edition Bryan O'Sullivan
aydjantertsi22
 
Hg version control bioinformaticians
Giovanni Marco Dall'Olio
 
Mercurial byexample
shreeve
 
Introduction to Mercurial, or "Why we're switching from SVN no matter what"
Adam Pah
 
Subversion in a distributed world
Lorna Mitchell
 
Distributed Version Control (DVCS) With Mercurial
Ted Naleid
 
Mercurial training
Trung Huynh
 
The Mercurial SCM
elliando dias
 
The Galaxy toolshed
Joachim Jacob
 
Ad

More from Ladislav Prskavec (20)

PDF
SRE in Apiary
Ladislav Prskavec
 
PDF
Modern Web Architecture<br>based on JS, API and Markup
Ladislav Prskavec
 
PDF
How you can kill Wordpress!
Ladislav Prskavec
 
PDF
SRE in Startup
Ladislav Prskavec
 
PDF
CI and CD
Ladislav Prskavec
 
PDF
Datascript: Serverless Architetecture
Ladislav Prskavec
 
PDF
Serverless Architecture
Ladislav Prskavec
 
PDF
CI and CD
Ladislav Prskavec
 
PDF
PragueJS meetups 30th anniversary
Ladislav Prskavec
 
PDF
How to easy deploy app into any cloud
Ladislav Prskavec
 
PDF
Docker - modern platform for developement and operations
Ladislav Prskavec
 
PDF
GDGSCL - Docker a jeho provoz v Heroku a AWS
Ladislav Prskavec
 
PDF
AWS Elastic Container Service
Ladislav Prskavec
 
PDF
Comparison nodejs frameworks using Polls API
Ladislav Prskavec
 
PDF
Docker Elastic Beanstalk
Ladislav Prskavec
 
PDF
Docker včera, dnes a zítra
Ladislav Prskavec
 
PDF
Docker.io
Ladislav Prskavec
 
PDF
Docker.io
Ladislav Prskavec
 
PDF
AngularJS
Ladislav Prskavec
 
PDF
Firebase and AngularJS
Ladislav Prskavec
 
SRE in Apiary
Ladislav Prskavec
 
Modern Web Architecture<br>based on JS, API and Markup
Ladislav Prskavec
 
How you can kill Wordpress!
Ladislav Prskavec
 
SRE in Startup
Ladislav Prskavec
 
Datascript: Serverless Architetecture
Ladislav Prskavec
 
Serverless Architecture
Ladislav Prskavec
 
PragueJS meetups 30th anniversary
Ladislav Prskavec
 
How to easy deploy app into any cloud
Ladislav Prskavec
 
Docker - modern platform for developement and operations
Ladislav Prskavec
 
GDGSCL - Docker a jeho provoz v Heroku a AWS
Ladislav Prskavec
 
AWS Elastic Container Service
Ladislav Prskavec
 
Comparison nodejs frameworks using Polls API
Ladislav Prskavec
 
Docker Elastic Beanstalk
Ladislav Prskavec
 
Docker včera, dnes a zítra
Ladislav Prskavec
 
Firebase and AngularJS
Ladislav Prskavec
 

Recently uploaded (20)

PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 

Subversion To Mercurial

  • 1. Migration from Subversion to Mercurial Ladislav Prskavec http://blog.prskavec.net [email protected] OpenMeeting 27.9.2009
  • 2. Why Mercurial ? Bitbucket.org (php-frameworks.net) Google Code (php4hudson, phpchangelogs) Keywords (phpdoc, git not support) Revisions (git not support) Netbeans (native support) Eclipse plugin (Zend Studio) http://www.vectrace.com/mercurialeclipse/ Many extensions Negatives partial rebase (extension) experimental subrepos in Mercurial 1.3.1 (svn:externals)
  • 3. Why Mercurial ? Bitbucket.org (private rep, issues)
  • 4. SVN xml logs to Hg Question: How make svn log --xml Answer: hglog.sh echo '<?xml version="1.0"?>n<log>n' >$1.xml hg log --template '<logentry revision="{rev}"> <author>{author|obfuscate}</author> <date>{date|isodate}</date> <msg>{desc|escape}n</msg> <paths><path>{files}</path></paths> </logentry>n' $1/ >>$1.xml echo '</log>n' >>$1.xml
  • 5. RCS keywords Question: How make keywords? Answer: Keywords extension (part from .hgrc) [extensions] hgext.keyword = keyword=/usr/share/python-support/mercurial-common/hgext/keyword.py [keyword] **.php = **.xml = [keywordmaps] RCSFile = {file|basename},v Author = {author|user} Header = {root}/{file},v {node|short} {date|utcdate} {author|user} Source = {root}/{file},v Date = {date|utcdate} Id = {file|basename},v {node|short} {date|utcdate} {author|user} Revision = {node|short}
  • 6. Deployment SVN deployment script svn --force export http://svn.rep.cz/svn/project/trunk/ /srv/www/project.cz/ /usr/bin/svn2cl --strip-prefix=trunk --break-before-msg=2 --group-by-day --separate-daylogs -i -- authors=/srv/www/project.cz/application/configs/authors.xml http://svn.rep.cz/svn/project/trunk -o /srv/www/project. cz/changelog sed -i 's/development/production/g' /srv/www/project.cz/public/.htaccess chown -Rf www-data:www-data /srv/www/project.cz/ Mercurial deployment script cd ~/hg-ws/project.cz/ hg pull hg up hg archive /srv/www/project.cz/ sed -i 's/development/production/g' /srv/www/project.cz/public/.htaccess chown -Rf www-data:www-data /srv/www/project.cz/
  • 7. Hooks scripts Subversion (server, repos/hooks/pre-commit) #!/bin/sh REPOS="$1" TXN="$2" # check php CHANGED=`svnlook changed -t "$TXN" "$REPOS" | awk '{print $2}' | grep .php$` for FILE in $CHANGED do MESSAGE=`svnlook cat -t "$TXN" "$REPOS" "$FILE" | $PHP -l ` if [ $? -ne 0 ] then exit 1 fi done exit 0 Mercurial (in .hg/hgrc) [hooks] precommit = test `find -name *.php -exec php -l {} ; | wc -l` -eq 1
  • 8. Summary Evolution not revolution Some workflow for my projects in Mercurial and Svn Local commits hg backout hg rollback (working only localy) Check extensions http://mercurial.selenic.com/wiki/UsingExtensions Convert (from others SCM: cvs, svn, git, darcs, bzr, arch, mnt) Fetch Keyword Notify Rebase Record (staging area)
  • 9. Thanks for your attention http://slideshare.net/ladislavprskavec Ladislav Prskavec http://blog.prskavec.net [email protected]