[Python-Dev] r85838 - python/branches/py3k/.gitignore

Ned Deily nad at acm.org
Tue Oct 26 21:19:52 CEST 2010

In article <20101026200234.5f8e8323 at pitrou.net>,
 Antoine Pitrou <solipsis at pitrou.net> wrote:
> You could use own of the "official" mirrors at
> http://code.python.org/hg/

The "official" hg mirrors work great: in my experience, faster than svn 
and simpler with all the useful history information retained from the 
original svn repos.  Thanks for that!  As an example, for OS X TextMate 
users out there, with up-to-date Mercurial and Subversion bundles, try 
doing an Annotate on an hg clone of a Python branch vs a Blame on an svn 
co.  With the hg clones and the hg rebase extension (now a standard part 
of hg), I've moved away from using hg mq patch queues for patch 
development although I still use the svn repos (until the transition is 
closer) and mq for installer build and regression testing.

FWIW, my hg workflow these days is to clone a local "master" clone for 
each of 27, 31, and py3k repos from the official mirrors then just clone 
working copies from my local masters as needed for each issue.  Using a 
local master speeds things up, potentially saves disk space as hg uses 
hard links for local clones where possible, and saves on network 
bandwidth.  With work-in-progress committed to a working copy, I can 
update automatically to the latest tip by a two-step update: update the 
local master from the official mirror (via "pull") and then update the 
working copy from the local master and use rebase to manage any new 
merge conflicts.  I couldn't quite get the two-stage pulls to completely 
work using one standard hg command so I wrote a "pull-clone" script that 
does the trick for me:

import ConfigParser
import os.path
import subprocess
import sys

HG_DEFAULTS = '.hg/hgrc'
HG_BIN = '/opt/local/bin/hg'

if not os.path.exists(HG_DEFAULTS):
    sys.exit('No hg repository here')
    config = ConfigParser.ConfigParser()
        default = config.get('paths', 'default')
    except ConfigParser.NoSectionError, ConfigParser.NoOptionError:
        default = ''
    if default.startswith('/'):
        subprocess.check_call([HG_BIN, 'pull', '-R', default], 
    subprocess.check_call([HG_BIN, 'pull', '-u', '--rebase'])
    subprocess.check_call([HG_BIN, 'summary', '--remote'])

 Ned Deily,
 nad at acm.org

More information about the Python-Dev mailing list