[PATCH 4 of 4 V6 STABLE] revert: suggest --rev when working dir is clean

Na'Tosha Bard natosha at unity3d.com
Tue Jun 21 06:33:39 CDT 2011


On Tue, Jun 21, 2011 at 9:51 AM, Adrian Buehlmann <adrian at cadifra.com>wrote:

> On 2011-06-21 06:11, Kevin Bullock wrote:
> > # HG changeset patch
> > # User Kevin Bullock <kbullock at ringworld.org>
> > # Date 1308626997 18000
> > # Branch stable
> > # Node ID 6be8fc98f63c2c767c664dc8079f1a6a8711f3c8
> > # Parent  ee0ea22c40b86d58437630881ec5ea1815ebe354
> > revert: suggest --rev when working dir is clean
> >
> > diff --git a/mercurial/commands.py b/mercurial/commands.py
> > --- a/mercurial/commands.py
> > +++ b/mercurial/commands.py
> > @@ -4199,6 +4199,9 @@
> >                  hint = _('use --all to revert all files, or '
> >                           "'hg update %s' to check out that revision"
> >                           ) % ctx.rev()
> > +        elif not dirty:
> > +            hint = _('nothing changed, use --rev to revert to another'
> > +                     'revision')
> >          raise util.Abort(msg, hint=hint)
> >
> >      mf = ctx.manifest()
>
> IMHO that hint is a very bad idea. There is no need to entice newbies
> into yet more disaster.
>
> And there's no reason to abort if nothing was changed (other than Matt
> saying he wants an abort...).
>
> In my book (status quo):
>
>  $ hg revert commands.py
>  no changes needed to commands.py
>
> fits quite nicely with (my proposal):
>
>  $ hg revert
>  nothing changed
>
> Consider also (status quo):
>
>  $ hg commit -mfoo
>  nothing changed
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>

+1 with Adrian on this.  I see no reason to not politely say "nothing
changed" and leave it at that.  Doing more invites a new user to try
something they wouldn't necessarily have otherwise and later realize it was
a mistake.

Cheers,
N.

-- 
*Na'Tosha Bard*
Build & Infrastructure Developer | Unity Technologies

*E-Mail:* natosha at unity3d.com
*Skype:* natosha.bard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20110621/1e95ef29/attachment.htm>


More information about the Mercurial-devel mailing list