Patchwork [2,of,4] histedit: improve missing rule suggestion

login
register
mail settings
Submitter timeless@mozdev.org
Date Dec. 2, 2015, 8:13 a.m.
Message ID <97b0c60ab14023b65afd.1449044014@waste.org>
Download mbox | patch
Permalink /patch/11736/
State Accepted
Headers show

Comments

timeless@mozdev.org - Dec. 2, 2015, 8:13 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1449042095 0
#      Wed Dec 02 07:41:35 2015 +0000
# Node ID 97b0c60ab14023b65afdaa0563c8efbea6da66a8
# Parent  f28057210ae315e245f61b04b584900c84f274f1
histedit: improve missing rule suggestion

include actual suggested text
Augie Fackler - Dec. 2, 2015, 3:13 p.m.
On Wed, Dec 02, 2015 at 02:13:34AM -0600, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1449042095 0
> #      Wed Dec 02 07:41:35 2015 +0000
> # Node ID 97b0c60ab14023b65afdaa0563c8efbea6da66a8
> # Parent  f28057210ae315e245f61b04b584900c84f274f1
> histedit: improve missing rule suggestion
>
> include actual suggested text
>
> diff --git a/hgext/histedit.py b/hgext/histedit.py
> --- a/hgext/histedit.py
> +++ b/hgext/histedit.py
> @@ -1130,7 +1130,7 @@
>      if missing:
>          raise error.Abort(_('missing rules for changeset %s') %
>                  missing[0][:12],
> -                hint=_('do you want to use the drop action?'))
> +                hint=_('consider adding: "drop %s"') % missing[0][:12])
>      return parsed
>
>  def newnodestoabort(state):
> diff --git a/tests/test-histedit-arguments.t b/tests/test-histedit-arguments.t
> --- a/tests/test-histedit-arguments.t
> +++ b/tests/test-histedit-arguments.t
> @@ -164,7 +164,7 @@
>    > pick 08d98a8350f3 4 five
>    > EOF
>    abort: missing rules for changeset c8e68270e35a
> -  (do you want to use the drop action?)
> +  (consider adding: "drop c8e68270e35a")

how about (use "drop c8e68270e35a" to discard the change) instead of
"consider adding?" I'd like it to be at least somewhat informative in
the space available so as to avoid cargo-culting leading to dataloss.

>    [255]
>
>  Test that extra revisions are detected
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
timeless - Dec. 2, 2015, 9:47 p.m.
Fine with me, can you fix in-flight?

I'm wandering around NYC...
On Dec 2, 2015 10:14 AM, "Augie Fackler" <raf@durin42.com> wrote:

> On Wed, Dec 02, 2015 at 02:13:34AM -0600, timeless wrote:
> > # HG changeset patch
> > # User timeless <timeless@mozdev.org>
> > # Date 1449042095 0
> > #      Wed Dec 02 07:41:35 2015 +0000
> > # Node ID 97b0c60ab14023b65afdaa0563c8efbea6da66a8
> > # Parent  f28057210ae315e245f61b04b584900c84f274f1
> > histedit: improve missing rule suggestion
> >
> > include actual suggested text
> >
> > diff --git a/hgext/histedit.py b/hgext/histedit.py
> > --- a/hgext/histedit.py
> > +++ b/hgext/histedit.py
> > @@ -1130,7 +1130,7 @@
> >      if missing:
> >          raise error.Abort(_('missing rules for changeset %s') %
> >                  missing[0][:12],
> > -                hint=_('do you want to use the drop action?'))
> > +                hint=_('consider adding: "drop %s"') % missing[0][:12])
> >      return parsed
> >
> >  def newnodestoabort(state):
> > diff --git a/tests/test-histedit-arguments.t
> b/tests/test-histedit-arguments.t
> > --- a/tests/test-histedit-arguments.t
> > +++ b/tests/test-histedit-arguments.t
> > @@ -164,7 +164,7 @@
> >    > pick 08d98a8350f3 4 five
> >    > EOF
> >    abort: missing rules for changeset c8e68270e35a
> > -  (do you want to use the drop action?)
> > +  (consider adding: "drop c8e68270e35a")
>
> how about (use "drop c8e68270e35a" to discard the change) instead of
> "consider adding?" I'd like it to be at least somewhat informative in
> the space available so as to avoid cargo-culting leading to dataloss.
>
> >    [255]
> >
> >  Test that extra revisions are detected
> > _______________________________________________
> > Mercurial-devel mailing list
> > Mercurial-devel@selenic.com
> > https://selenic.com/mailman/listinfo/mercurial-devel
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
>
Augie Fackler - Dec. 4, 2015, 1:37 a.m.
On Wed, Dec 02, 2015 at 04:47:35PM -0500, timeless wrote:
> Fine with me, can you fix in-flight?

Done. Thanks!

>
> I'm wandering around NYC...
> On Dec 2, 2015 10:14 AM, "Augie Fackler" <raf@durin42.com> wrote:
>
> > On Wed, Dec 02, 2015 at 02:13:34AM -0600, timeless wrote:
> > > # HG changeset patch
> > > # User timeless <timeless@mozdev.org>
> > > # Date 1449042095 0
> > > #      Wed Dec 02 07:41:35 2015 +0000
> > > # Node ID 97b0c60ab14023b65afdaa0563c8efbea6da66a8
> > > # Parent  f28057210ae315e245f61b04b584900c84f274f1
> > > histedit: improve missing rule suggestion
> > >
> > > include actual suggested text
> > >
> > > diff --git a/hgext/histedit.py b/hgext/histedit.py
> > > --- a/hgext/histedit.py
> > > +++ b/hgext/histedit.py
> > > @@ -1130,7 +1130,7 @@
> > >      if missing:
> > >          raise error.Abort(_('missing rules for changeset %s') %
> > >                  missing[0][:12],
> > > -                hint=_('do you want to use the drop action?'))
> > > +                hint=_('consider adding: "drop %s"') % missing[0][:12])
> > >      return parsed
> > >
> > >  def newnodestoabort(state):
> > > diff --git a/tests/test-histedit-arguments.t
> > b/tests/test-histedit-arguments.t
> > > --- a/tests/test-histedit-arguments.t
> > > +++ b/tests/test-histedit-arguments.t
> > > @@ -164,7 +164,7 @@
> > >    > pick 08d98a8350f3 4 five
> > >    > EOF
> > >    abort: missing rules for changeset c8e68270e35a
> > > -  (do you want to use the drop action?)
> > > +  (consider adding: "drop c8e68270e35a")
> >
> > how about (use "drop c8e68270e35a" to discard the change) instead of
> > "consider adding?" I'd like it to be at least somewhat informative in
> > the space available so as to avoid cargo-culting leading to dataloss.
> >
> > >    [255]
> > >
> > >  Test that extra revisions are detected
> > > _______________________________________________
> > > Mercurial-devel mailing list
> > > Mercurial-devel@selenic.com
> > > https://selenic.com/mailman/listinfo/mercurial-devel
> > _______________________________________________
> > Mercurial-devel mailing list
> > Mercurial-devel@selenic.com
> > https://selenic.com/mailman/listinfo/mercurial-devel
> >

> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1130,7 +1130,7 @@ 
     if missing:
         raise error.Abort(_('missing rules for changeset %s') %
                 missing[0][:12],
-                hint=_('do you want to use the drop action?'))
+                hint=_('consider adding: "drop %s"') % missing[0][:12])
     return parsed
 
 def newnodestoabort(state):
diff --git a/tests/test-histedit-arguments.t b/tests/test-histedit-arguments.t
--- a/tests/test-histedit-arguments.t
+++ b/tests/test-histedit-arguments.t
@@ -164,7 +164,7 @@ 
   > pick 08d98a8350f3 4 five
   > EOF
   abort: missing rules for changeset c8e68270e35a
-  (do you want to use the drop action?)
+  (consider adding: "drop c8e68270e35a")
   [255]
 
 Test that extra revisions are detected