Bug 3299 - alias for showconfig won't work outside repo
Summary: alias for showconfig won't work outside repo
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: All All
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-01 13:05 UTC by A. Budden
Modified: 2012-07-26 09:59 UTC (History)
3 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description A. Budden 2012-03-01 13:05 UTC
To reproduce:

    $ cat >>~/.hgrc <<EOF
    > [alias]
    > whoami = showconfig ui.username
    > EOF
    $ cd / # I'm assuming that /.hg doesn't exist
    $ hg showconfig ui.username
    A. S. Budden <email@email.com>
    $ hg whoami
    abort: no repository found in '/' (.hg not found)!

More information (from Matt Mackall):

> Any idea what's causing this?

Yep. Each command has a notion of whether or not it requires a repo to
operate on. This is inherited by aliases. But a smaller set of commands
optionally work with a repo (like showconfig), and this property is not
inherited. Please open a bug for this.
Comment 1 Patrick Mézard 2012-05-05 04:32 UTC
Fix submitted here:

  http://selenic.com/pipermail/mercurial-devel/2012-May/039739.html

Thank you for the report.
Comment 2 Bugzilla 2012-05-12 09:28 UTC
--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:28 EDT  ---

This bug was previously known as _bug_ 3298 at http://mercurial.selenic.com/bts/issue3298