Mercurial development workflow

Martin Geisler mgeisler at mgeisler.net
Wed Aug 1 17:26:27 CDT 2007


Giorgos Keramidas <keramida at ceid.upatras.gr> writes:

> Another way to 'edit' local commits is to use the MQ extension.
>
> You can 'import' the tip of a repository into a 'patch queue' with:
>
> 	% hg qinit -c
> 	% hg qimport -r tip -n demopatch
>
> Then you should see a 'local patch' with:
>
> 	% hg qapplied -s
>
> You can edit a few more files, use 'hg delete', 'hg rename' or make
> any other local change, and then 'refresh' the patch with:
>
> 	% hg qrefresh --git
>
> Finally, when the patch has reached a stable state, and you want to
> convert it back to a 'real changeset', you can run:
>
> 	% hg qdelete -r tip
>
> and voila: your old tip has been 'edited in place' :-)

Very cool! I see that this also works for editing revisions further
back than tip. If the tip revision is 100 then

  % hg qimport -r 100
  % hg qimport -r 99
  % hg qimport -r 98

let me edit the last three revisions, and 

  % hg qdelete -r qbase
  % hg qdelete -r qbase
  % hg qdelete -r qbase

really converts them back to normal changesets. The hashes are of
course no longer identical, but that shouldn't matter if this is just
a private repository.

When playing with the MQ extension I keep getting the feeling that the
functionality it provides ought to be available all the time.

So instead of

  % hg qnew
  % ...edit files...
  % hg qrefresh

I would simply commit as usual. To go back and forth, I would push and
pop and refresh. When refreshing, the editor should by default start
out with the previous commit message.

Allowing me to edit old changesets seems like a cool feature (I
believe that is the main reason why MQ exists!) and I think it could
be a native feature of Mercurial.

-- 
Martin Geisler  ---  <mgeisler at mgeisler.net>  ---  http://mgeisler.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
Url : http://selenic.com/pipermail/mercurial/attachments/20070802/bdf17a4f/attachment.pgp 


More information about the Mercurial mailing list