hg switch

anatoly techtonik techtonik at gmail.com
Thu Oct 23 11:28:00 CDT 2014


On Mon, Oct 20, 2014 at 7:55 PM, Jordi Gutiérrez Hermoso
<jordigh at octave.org> wrote:
> On Sat, 2014-10-18 at 21:17 +0300, anatoly techtonik wrote:
>> http://git-legit.org/
>>
>> $ git switch <branch>
>> # Switches to branch. Stashes and restores unstaged changes.
>
> I don't quite get this. It seems to me like the real problem is
>
>     http://bz.selenic.com/show_bug.cgi?id=4404

The problem described there is about warning if there is merge danger
ahead of doing operation. It is also a cause of non-satisfactory user
experience and it is also a problem, but a different one. First there
should be "command for humans" for switching between branches
in user interface.

> The current workaround is to shelve and unshelve in Mercurial or in
> git, but what benefit is this giving you? Either way, you have to
> merge the working directory. The shelving and unshelving would just
> give you a way to undo this merge state.

I think that you can undo the merge state after unsuccessful update,
but it is not related to the problem of linking intention to switch branch
to the command that does it.

> Maybe instead of growing a new command, the solution is to fix the
> update command to shelve and unshelve and that will be the path
> towards `hg update --abort`?

It is a solution to the "falling to the merge pit" problem. But there is
also the problem of "where is my cheatsheet" that ruins the fun.
-- 
anatoly t.


More information about the Mercurial-devel mailing list