Default behavior of uncommit

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu Jul 24 11:06:22 UTC 2014



On 07/24/2014 12:05 AM, Nathan Goldbaum wrote:
> Hi all,
>
> I just ran into a confusing behavior in uncommit.
>
> Right now when one doesn't specify an argument to uncommit, this happens:
>
> $ hg uncommit
> abort: nothing to uncommit
>
> I would have expected it to uncommit the previous changeset, i.e. the
> inverse of "hg commit".
>
> After perusing "hg help uncommit" I see that I actually wanted:
>
> $ hg uncommit --all
>
> I'm curious, would it be possible to make uncommit use --all by default?


Other mercurial commands tends to not use --all by default:

   > hg revert
   abort: no files or directories specified
   (use --all to revert all files)

   > hg resolve
   abort: no files or directories specified; use --all to remerge all files

So I'm inclined to keep the same logic for `hg uncommit`

> If not, would it possible to print out a more detailed hint besides
> "nothing to uncommit"?

However you are right when pointing that the current message sucks. 
Consider sending a patches to improve it.

This discussion also point out that some of the current core message are 
inconsistent. Unifying them would also be an easy contribution.

Thanks for testing evolve and pointing this out.

-- 
Pierre-Yves David



More information about the Evolve-testers mailing list