[Python-Dev] Using feature branches for local development

Stephen J. Turnbull stephen at xemacs.org
Sun Mar 13 12:56:04 CET 2011

On Sun, Mar 13, 2011 at 8:25 PM, Nick Coghlan <ncoghlan at gmail.com> wrote:

> 1. While the feature branches are active, is it correct that I can't
> use a bare "hg push" any more, since I don't want to push the feature
> branches to hg.python.org? Instead, I need to name all the branches I
> want to push explicitly.

More or less.  If you only want to push the default branch, you could put

pdef = push -r default

in the .hg/hgrc as an alias.

> 2. Once I'm done with the feature branch, I need to nuke it somehow
> (e.g. by enabling the mq extension to gain access to "hg strip"
> command)

You may *want* to do that, but hg branch obsolete-branch;
hg commit -m "I'm done" --close should also do the trick of getting
it out of the way of most commands.

> If those are both accurate, I may actually create a new subclone,
> leaving the main local repository with only the changes I actually
> want to push upstream.

This is also a good way to work for many people, I think.

I personally manage my not-ready-for-prime time code with mq, though.
This should protect you from pushing code you're not ready to publish.
(hg will tell you

wideload:test/b 20:54$ hg push
pushing to /private/tmp/test/a
abort: source has mq patches applied

if you try to push with patches applied to the workspace.)

More information about the Python-Dev mailing list