[PATCH 3 of 3] localrepo: pass args and command running as store/write lock metadata

Phillip Cohen phillip at phillip.io
Tue Mar 21 15:21:33 EDT 2017


> Have you actually tried if "commandname" is the command name after resolving
> alias?

It is, for command aliases. For example `hg sf` will correctly return `absorb`.

On Tue, Mar 21, 2017 at 12:18 PM, Jun Wu <quark at fb.com> wrote:
>
> Excerpts from Ryan McElroy's message of 2017-03-21 18:56:19 +0000:
> >
> > On 3/21/17 6:50 PM, Jun Wu wrote:
> > > Excerpts from Augie Fackler's message of 2017-03-21 14:35:43 -0400:
> > >> On Mon, Mar 20, 2017 at 12:39:11PM +0000, Ryan McElroy wrote:
> > >>> Overall, I like the functionality this series adds, but I'm less convinced
> > >>> on the specific implementation. Adding more stuff to the junkyard that is
> > >>> the "ui" class doesn't feel awesome, and I'm concerned with how it will
> > >>> interact with chg and a future direction of ui immutability.
> > >> +1 overall on this paragraph - please avoid adding things to ui if you can.
> > >>
> > >> (The rest of this thread appears to be going in a healthy direction,
> > >> so by all means carry on yourselves and do a resend when you've worked
> > >> out something you're happy with.)
> > > I think ui.args is useful. We can probably avoid "ui.commandname" (use
> > > "ui.args[0]" as an approximate).
> > >
> > > It's currently painful for anyone who wants the "sys.argv" information, for
> > > example the journal extension. For now, it has to be done via wrapping
> > > dispatch.runcommand.
> >
> > I agree that this seems useful, and cleaning up journal to not need to
> > wrap this would be nice. I also can't think of a better place to put
> > this info than 'ui' right now. I'm leaning towards saying "okay".
> >
> > Unfortunately, it can't replace `ui.commandname` I'm afraid: `hg st`
> > might become "status" or it might become "log" because I have an alias.
> > We can't rely on the full command line args to reliably determine what
> > command we dispatch to because of the indirection layer.
>
> The journal extension does not care about aliases. It only needs "fullargs".
>
> Have you actually tried if "commandname" is the command name after resolving
> alias?
>
> I'd argue that "fullargs" is simple and correct, as it's what you typed
> as-is. As a user, you should know what aliases you have.
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list