overriding command defaults

Matt Mackall mpm at selenic.com
Fri Dec 5 11:28:52 CST 2008


On Fri, 2008-12-05 at 14:25 +0000, TK Soh wrote:
> On Fri, Dec 5, 2008 at 11:12 AM, Dov Feldstern <dfeldstern at fastimap.com> wrote:
> > TK Soh wrote:
> >>
> >> Recently I tried to debug a problem in hgtk's annotate tool where the
> >> annotate output window came up empty. It turned out that I had the
> >> command default defined in ~/.hgrc for annotate command which give
> >> extra output, it messed up the logic in the annotate tool which calls
> >> 'hg annotate' via command line and parses it's output. IIRC, I had a
> >> similar problem with Qct caused the command defaults.
> >>
> >> Is there anyway to suppress the command defaults?
> >
> > Yes: let's say you have the following in your hgrc:
> >
> > [defaults]
> > qseries = -s
> >
> > if you want non-summary output, you can do this:
> >
> > hg qser --config defaults.qseries=
> >
> > (note: same is in the defaults section in hgrc, the full command name is
> > necessary --- qser is not enough)
> 
> I actually realized that after I posted the message, but thanks for
> the help nonetheless.
> 
> Since we are on this topic... While that fixes my problem within the
> hgtk tools, I often face the same problem at command line (yes, I
> still use the CLI a lot ;-). In this case the 'offender' is the status
> command, where I defaults to '-mard' options. Needless to say the
> "--config default.status=" is too much to type. So I wonder if the
> idea of adding a global option to disable command defaults will be
> acceptable?

Sure. Though it's probably simpler and safer to just use the aliases
extension an make a whole new 'mard' command and leave all the existing
commands with their default behavior.

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial-devel mailing list