Patchwork [5,of,5,v2] shelve: suggest the correct tool to continue (not unshelve)

login
register
mail settings
Submitter timeless@mozdev.org
Date Feb. 7, 2016, 7:57 a.m.
Message ID <90beb3cba03525a362e0.1454831860@waste.org>
Download mbox | patch
Permalink /patch/13032/
State Superseded
Commit 98336538246505aa4437960541ac3ceaa917b76d
Headers show

Comments

timeless@mozdev.org - Feb. 7, 2016, 7:57 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1454557658 0
#      Thu Feb 04 03:47:38 2016 +0000
# Node ID 90beb3cba03525a362e061e7bc5e78ac2fea590b
# Parent  80d58999b7343efe3cc9b0ab90d402f400ec35fc
shelve: suggest the correct tool to continue (not unshelve)

Suggest committing (or whatever the current activity is), via
wrongtooltocontinue which uses howtocontinue.
Pierre-Yves David - Feb. 12, 2016, 11:39 a.m.
On 02/07/2016 07:57 AM, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1454557658 0
> #      Thu Feb 04 03:47:38 2016 +0000
> # Node ID 90beb3cba03525a362e061e7bc5e78ac2fea590b
> # Parent  80d58999b7343efe3cc9b0ab90d402f400ec35fc
> shelve: suggest the correct tool to continue (not unshelve)
>
> Suggest committing (or whatever the current activity is), via
> wrongtooltocontinue which uses howtocontinue.
>
> diff --git a/hgext/shelve.py b/hgext/shelve.py
> --- a/hgext/shelve.py
> +++ b/hgext/shelve.py
> @@ -628,7 +628,8 @@
>           except IOError as err:
>               if err.errno != errno.ENOENT:
>                   raise
> -            raise error.Abort(_('no unshelve operation underway'))
> +            cmdutil.wrongtooltocontinue(repo,
> +                _('no unshelve operation underway'))
>
>           if abortf:
>               return unshelveabort(ui, repo, state, opts)
> diff --git a/tests/test-shelve.t b/tests/test-shelve.t
> --- a/tests/test-shelve.t
> +++ b/tests/test-shelve.t
> @@ -374,6 +374,7 @@
>
>     $ hg unshelve -c
>     abort: no unshelve operation underway

We are using "in progress" for all the other action, why did you switch 
to "underway" for unshelve? Can we use "in progress here too?

> +  (continue: hg commit)

I'm kind of confused here. Why is we are offering "hg commit" as an 
alternative to "hg unshelve". They are very different command with quite 
different intends.

To some extend, this also apply to the other action the list. I think we 
shouldn't not include the default "(continue: hg commit)" bits in this 
series and discuss it separately.

Cheers,
timeless - Feb. 12, 2016, 7:13 p.m.
Pierre-Yves David wrote:
> We are using "in progress" for all the other action, why did you switch to
> "underway" for unshelve? Can we use "in progress here too?

As with the other one, I didn't switch. It's just the current value.
I don't like it, but didn't want to fix it here.

>> +  (continue: hg commit)

> I'm kind of confused here. Why is we are offering "hg commit" as an
> alternative to "hg unshelve". They are very different command with quite
> different intends.

The suggestion is more or less "You don't seem to be doing anything
special right now, why not try committing?"
This series is not teaching rebase about histedit or histedit about
rebase or graft about histedit, it's teaching them to all suggest
whatever is current, as generically applicable.

> To some extend, this also apply to the other action the list. I think we
> shouldn't not include the default "(continue: hg commit)" bits in this
> series and discuss it separately.

I can see about excluding the hg commit suggestion.

Patch

diff --git a/hgext/shelve.py b/hgext/shelve.py
--- a/hgext/shelve.py
+++ b/hgext/shelve.py
@@ -628,7 +628,8 @@ 
         except IOError as err:
             if err.errno != errno.ENOENT:
                 raise
-            raise error.Abort(_('no unshelve operation underway'))
+            cmdutil.wrongtooltocontinue(repo,
+                _('no unshelve operation underway'))
 
         if abortf:
             return unshelveabort(ui, repo, state, opts)
diff --git a/tests/test-shelve.t b/tests/test-shelve.t
--- a/tests/test-shelve.t
+++ b/tests/test-shelve.t
@@ -374,6 +374,7 @@ 
 
   $ hg unshelve -c
   abort: no unshelve operation underway
+  (continue: hg commit)
   [255]
   $ hg status
   A foo/foo