[PATCH stable] update: shorten abort message for updating across branches when unclean

Gilles Moris gilles.moris at free.fr
Tue Dec 1 01:54:18 CST 2009


On Tuesday 01 December 2009 06:34:00 am Henrik Stuart wrote:
> > @@ -474,8 +473,8 @@
> >              if pa == p1 or pa == p2: # linear
> >                  pass # all good
> >              elif wc.files() or wc.deleted():
> > -                raise util.Abort(_("crosses branches (use 'hg merge' to merge "
> > -                                 "or use 'hg update -C' to discard changes)"))
> > +                raise util.Abort(_("can't cross branches when there are "
> > +                                   "uncommitted changes"))
> >              elif onode is None:
> >                  raise util.Abort(_("crosses branches (use 'hg merge' or use "
> >                                     "'hg update -c')"))
> 
> In my experience, most people need a bit more hand-holding than what the
> revised message offers. I know that condensing the message to a single
> line is non-trivial, but mentioning the way to discard changes seems
> like a good idea.
> 

I do not quite agree with your last point.
Mercurial has made a great deal of effort to be safe by design, pushing out
of the core some commands that can have some destructive behavior. And the
current message is advertising discarding changes for which there is no
possibility of undo (something we could work on but that's another story).

The use of 'hg up -C' is a fundamental command, but this is not something we
should ask to use in the first place.

Regards.
Gilles.


More information about the Mercurial-devel mailing list