[Bug 5141] New: Redefining an alias referenced by another gives a confusing error message

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Tue Mar 15 16:18:50 EDT 2016


https://bz.mercurial-scm.org/show_bug.cgi?id=5141

            Bug ID: 5141
           Summary: Redefining an alias referenced by another gives a
                    confusing error message
           Product: Mercurial
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: feature
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla at selenic.com
          Reporter: hg at pewpew.net
                CC: mercurial-devel at selenic.com

If you create an alias (let's call it "shadowed"), then another alias that
references it (let's call it "s"), then redefine "shadowed", using the "s"
alias leads to a message like:

abort: alias 's' resolves to unknown command 'shadowed'

I assume this is because 's' references the old 'shadowed' via a hash or
something, but it gets deleted when it's redefined.   I'm not sure what the
best fix is (make 's' point to the new 'shadowed', or just fix the error
message).



Full details:

spectral at dragonair:~/tmp/asodfn$ cat sample_hgrc 
[alias]
shadowed=help log
s=shadowed
shadowed=help clone
spectral at dragonair:~/tmp/asodfn$ HGRCPATH=sample_hgrc hg shadowed
hg clone [OPTION]... SOURCE [DEST]

make a copy of an existing repository

    Create a copy of an existing repository in a new directory.

    If no destination directory name is specified, it defaults to the basename
    of the source.

    The location of the source is added to the new repository's ".hg/hgrc"
    file, as the default to be used for future pulls.

    Only local paths and "ssh://" URLs are supported as destinations. For
    "ssh://" destinations, no working directory or ".hg/hgrc" will be created
    on the remote side.

    If the source repository has a bookmark called '@' set, that revision will
    be checked out in the new repository by default.

    To check out a particular version, use -u/--update, or -U/--noupdate to
    create a clone with no working directory.

    To pull only a subset of changesets, specify one or more revisions
    identifiers with -r/--rev or branches with -b/--branch. The resulting
    clone will contain only the specified changesets and their ancestors.
    These options (or 'clone src#rev dest') imply --pull, even for local
    source repositories.

    Note:
       Specifying a tag will include the tagged changeset but not the
       changeset containing the tag.

    See 'hg help urls' for details on specifying URLs.

    Returns 0 on success.

options ([+] can be repeated):

 -U --noupdate          the clone will include an empty working directory
                        (only a repository)
 -u --updaterev REV     revision, tag, or branch to check out
 -r --rev REV [+]       include the specified changeset
 -b --branch BRANCH [+] clone only the specified branch
    --pull              use pull protocol to copy metadata
    --uncompressed      use uncompressed transfer (fast over LAN)
 -e --ssh CMD           specify ssh command to use
    --remotecmd CMD     specify hg command to run on the remote side
    --insecure          do not verify server certificate (ignoring web.cacerts
                        config)

(some details hidden, use --verbose to show complete help)
spectral at dragonair:~/tmp/asodfn$ HGRCPATH=sample_hgrc hg s
abort: alias 's' resolves to unknown command 'shadowed'
spectral at dragonair:~/tmp/asodfn$ hg version
Mercurial Distributed SCM (version 3.7.1+310-c7f89ad87bae)
(see https://mercurial-scm.org for more information)

Copyright (C) 2005-2016 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
spectral at dragonair:~/tmp/asodfn$

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list