• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Subversion To Mercurial
 

Subversion To Mercurial

on

  • 3,355 views

Migration from Subversion to Mercurial

Migration from Subversion to Mercurial

Statistics

Views

Total Views
3,355
Views on SlideShare
3,251
Embed Views
104

Actions

Likes
1
Downloads
21
Comments
0

5 Embeds 104

http://blog.prskavec.net 89
http://www.slideshare.net 12
http://webcache.googleusercontent.com 1
http://www.linkedin.com 1
http://www.docshut.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Subversion To Mercurial Subversion To Mercurial Presentation Transcript

    • 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