Needing feedback on the Python developer's guide

Arne Babenhauserheide arne_bab at web.de
Sat Feb 26 16:03:22 UTC 2011


On Saturday 26 February 2011 07:04:55 Antoine Pitrou wrote:
> - how do we suggest contributors work on features and patches? we currently
> advocate the use of mq but that introduces (IMHO) a layer of complexity
> above the traditional hg UI. Our process is for people to post collapsed
> patches (not series of changesets) on the issue tracker for review, which
> differs quite a bit from mercurial-devel's process (and I don't think we
> would want to change that).
> 
> see current text at http://potrou.net/hgdevguide/patch.html#patch

I personally don’t like mq (exactly because it creates an additional layer). 
Well, except for strip (for cleaning up).

A way to generate the patches you want is to just commit locally and then 
generating the patch via 

hg diff -r BASE -r PATCH_TIP > patch.diff

The problem here is to find BASE: The latest revision shared between the server 
and your patch, because `hg outgoing` only shows your new changes but omits 
the common base. 

The parentrevspec-extension allows solving that problem. 
→ http://mercurial.selenic.com/wiki/ParentrevspecExtension

Imagine that hg outgoing gives this: 

	$ hg out
	Vergleiche mit ssh://hg@bitbucket.org/ArneBab/1w6/
	Suche nach Änderungen
	Änderung:        1160:3adccebd357c
	Nutzer:          Arne Babenhauserheide <bab at draketo.de>
	Datum:           Mon Feb 21 20:41:02 2011 +0100
	Zusammenfassung: …eingeschüchtert, oder…
	
	Änderung:        1161:d17bf2c89fa9
	Marke:           tip
	Nutzer:          Arne Babenhauserheide <bab at draketo.de>
	Datum:           Mon Feb 21 20:44:06 2011 +0100
	Zusammenfassung: Tara ist auch Geschickt.

Meaning: Your patch includes revision 1160 and 1161. So you want to send the 
difference between the parent of 1160 and 1161. 

To get it, you can simply call: 

	$ hg --config extensions.parentrevspec= diff -r 1160^1 -r 1161

(the --config syntax enables the extension only for one call)

Schematically: Your patch has a first rev (FIRST) and a last rev (LAST). 

The patch is generated via 

	$ hg --config extensions.parentrevspec= diff -r FIRST^1 -r LAST


If you work on more than one patch in the same repo, just use named branches. 
Then hg outgoing BRANCH_NAME will give you all revisions of the patch but not 
of other patches (except if you merge patches instead of working off a common 
base). 

I hope this helps you! 

Best wishes, 
Arne

PS: parentrevspec is distributed with Mercurial, so people can use pristine 
Mercurial for working on patches.
--
Konstruktive Kritik: 

- http://draketo.de/licht/krude-ideen/konstruktive-kritik

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 316 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20110226/0f11d475/attachment.asc>


More information about the Mercurial mailing list