hg export with ranges (was: Re: diff to tag includes .hgtags)

Bryan O'Sullivan bos at serpentine.com
Wed Jun 29 07:22:45 UTC 2005


On Wed, 2005-06-29 at 09:04 +0200, 'Thomas Arendsen Hein' wrote:

> But not very useful without a built-in output file support, e.g.:
> 
> $ hg export -o ~/hg-export-%r.patch rev1-rev2
> 
> with:
> %n - number of patch starting at 1
> %r - changeset revision number
> %h - short hash
> %H - full hash

Excellent idea.  In case someone starts coding this up before I get to
it, a few more notions:

%b - basename of the directory from which this patch is being exported

So if I export from ~/hg/hg-funkmonster to %b-%r.patch, I get a patch
file named hg-funkmonster-223.patch.

Finally, for the creme de la creme, specify in hgrc a default format for
patch files:

[export]
path = $HOME/patches/%b/%b-%r.patch

With this set, if I type "hg export tip", it simply creates the
correctly named file for me, instead of printing the patch on stdout.

	<b




More information about the Mercurial mailing list