pythonaro.com

Pythonaro blog

29 May 2009

Notes on Mercurial / MQ and Subversion

I am currently working on some patches for a project. The project uses Subversion for version control; I won't have commit rights, but I still want to track the original sources as well as my changes. Rather than configuring svn externals (which are really thought out for different usecases, typically libraries), I decided to try my hand at one of the newest Distributed Version Control Systems, which are built exactly for this sort of scenario.

Being a Python-whore, I obviously picked Mercurial. Here's a little memo with what I've done, mostly following the page on the Mercurial wiki dedicated to Subversion interop. Note that this may not be the optimal solution, it's a work-in-progress:

  1. enable the MQ extension in .hgrc or Mercurial.ini
  2. check out the original Subversion repository
  3. in the checked-out copy, do
    hg init
  4. in the same place, create a file called .hgignore, listing the files we don't want to track; typically, this means the .svn/ directory and .hgignore itself
  5. add all the files to Mercurial:
    hg ci -Am "Original svn checkout"
  6. initialize MQ:
    hg qinit -c
  7. if you have existing patches, you want to start applying them now. If they create new files, you'll need to "hg add" them
  8. when you want to save state, use
    hg qnew -f mynewpatch
    This will create a patch called "mynewpatch" in the MQ stack, listing differences with the original version, and it will consider it as applied.

In this way, I can always resync the svn repository (using svn itself), commit the new "upstream" revision to the local hg repository, then reapply the patch queue. At least in theory :)

Labels: , ,

posted by GiacomoL @ 9:57 AM   3 comments links to this post

14 January 2008

KDelicious now on public SVN

I migrated the KDelicious SVN repository to SourceForge, mainly to make it easier for people to volunteer translations. If you fancy having a go (as of today we'd really need de/fr/nn/nb/es, but feel free to add other ones!), just download the KDelicious .pot template, save it as yourlang.po (for example, fr.po), open it with a gettext-compliant tool like KBabel, translate the strings and then send the saved file to me (g dot lacava at gmail.com). Thanks a lot!

Labels: , , , ,

posted by GiacomoL @ 10:14 PM   0 comments links to this post

06 January 2008

Thank $DEITY for version control

  • User points out a little bug in program
  • Author meanwhile made several changes to the codebase, not ready for release yet, but the required fix is trivial
  • Author checks out the latest tagged release from svn repository, tags as new release, commits fix, uploads and announces updated version in a few minutes
  • (...and right after that, he realises that there are other places in which the change must be applied, so he repeats the last step...)
  • With calm and tranquility, a day later, author applies changes to trunk (thanks to KDiff3)

Labels: , ,

posted by GiacomoL @ 10:52 AM   2 comments links to this post

27 August 2007

svn+ssh from Windows

Another one for Google, since currently the first hit is from a muppet advising to use a commercial product... If you want to connect to a Subversion repository using the standard SSH tunneling (svn+ssh), but you have a Windows workstation, you can use the Putty utilities. Here's what you need to do:
  1. Go to the Putty download page and download putty.exe, plink.exe, puttygen.exe and pageant.exe (since you are there, you might as well get the full installer, since stuff like pscp is also very useful). Put them in your Windows PATH (e.g. C:\Windows) -- you don't need this if you ran the installer).
  2. Start puttygen.exe and click Generate to generate a key. Enter the comment (usually your email) and a password. Then save the private key somewhere safe.
  3. Start Putty.exe and connect to your machine, with the user/pass you use when working in Subversion.
  4. go back to the puttygen window, and copy the generated key text
  5. in the open ssh session, type
    echo '

    then right-click and Paste then
    ' >> ~/.ssh/authorized_keys

    then Enter
  6. close Puttygen ad exit the ssh session, start Pageant. A small icon will appear in your taskbar.
  7. Right-click on the icon, "Add key". Select your private key and OK, enter the password.
  8. open a new command window, and try this:
    plink your-username@your.host.com

    You shouldn't be asked for a password, and be straight in. Perfect! One last thing...
  9. go to your %APPDATA% directory (C:\Documents & Settings\your-name\Application Data), and enter the Subversion folder. Open the "config" file, locate the [tunnel] section and add this line before saving & closing:
    ssh = plink
  10. Now you should be set! Try doing
    svn co svn+ssh://your-username@your.host.com/your/prj

I don't know if using TortoiseSVN or other UI this process can be easier or more complicated. This works, and it will give you the standard basic svn+ssh features.

Technorati Tags: , , ,

Labels: , , , ,

posted by GiacomoL @ 11:54 AM   0 comments links to this post