hg export with ranges

'Thomas Arendsen Hein' thomas at intevation.de
Wed Jun 29 07:42:02 UTC 2005


* Bryan O'Sullivan <bos at serpentine.com> [20050629 09:22]:
> 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.

This is a job for the default options, see TODO.

Maybe something like:

[options]
hg = -v
export = -o $HOME/patches/%b/%b-%r.patch
# Uh, what can I do to be not verbose? I guess the right solution
# would be -v increasing verbosity by 1 and -q decreasing it by 1:
log = -q

Thomas

-- 
Email: thomas at intevation.de
http://intevation.de/~thomas/



More information about the Mercurial mailing list