Request to make hg pull -u --rebase more friendly

Jonathan Watt jwatt at jwatt.org
Sat Sep 5 15:09:39 CDT 2009


Hi list,

I've been trying to teach some Mercurial newbies enough about hg to quickly get
them off the ground and be productive. One of the first significant hurdles
turns out to be pulling to keep up to date with the "central" repository when
they have local uncommitted changes in their working tree (groking mq appears to
be /way/ beyond them at this stage).

If they do:

  hg pull -u

then hg will pull and update without the local changes causing any problem,
bringing up their merge tool if necessary. However, handling multiple heads is
confusing to newbies, so it would be much easier for them if they could do:

  hg pull -u --rebase

again getting the merge tool if necessary. Unfortunately hg does not allow you
to use --rebase when you have local changes. It simply aborts with the message:

  abort: outstanding uncommitted changes

It seems like hg could store a diff of the local changes, revert them, do the
pull -u --rebase as usual, and then try and apply the saved diff, bringing up
the merge tool if necessary.

Would it be possible to have hg changed to do this?

I also tried getting them to choose between 'hg pull -u' and 'hg pull --rebase'
depending on whether the change they're working on is committed or not, but
apparently they frequently get it wrong and get into a mess, probably because
it's yet another thing to understand and remember. It would be much better if
they could just use -u --rebase together with uncommitted changes, at least
while they build up their understanding and comfort level with hg.

Best regards,
Jonathan




More information about the Mercurial-devel mailing list