On Tue, Jul 05, 2011 at 10:15:09PM -0400, Jasper St. Pierre wrote:
On Tue, Jul 5, 2011 at 5:02 AM, Alessandro Dentella
wrote: On Tue, Jul 05, 2011 at 03:42:04AM -0400, Jasper St. Pierre wrote:
re: Mercurial, I didn't like it when I used it. If someone can tell me how to do this[3] in hg, I'd be more inclined to play along. And that
I do this sort of things using mercurial queues. I pile up patches in a queue and can subsequently navigate in the queue (hg qgoto fix_header1) and fold it with a later one (hg qfold fix_header2).
Hm. So it's like quilt?
I think so
Are patch queues real commits (changesets, revisions, whatever), so I can log and blame and grep them while I'm working?
yes for all 3 (log, blame, grep)
While the queue is not yet committed I can change the commit log of a patch in a simple way.
if the patch is called my_patch1: $ hg goto my_patch1 $ hg qrefresh -e (open editor to change edit log) hg qrefresh alone would just incorporate all modification to working directory in the patch, before committing you can anyhow keep all patches in a separate repository (hg qinit will initialize it for you. I personally don't use it though). If you use such a second repository I guess you can simply share that with other people too, but I'm not using this workflow.
hg qnew -f fix1 -m "this fixed issue 1" hg qnew -I debian/control -m "fix control" hg qnew -f fix1.1 -m "forgot something in issue 1" hg qgoto fix1 hg qfold fix1.1 # This concatenate the 2 comments" hg qrefresh -e # fix your comment as you like it hg qpush hg qfinish -a # commit all queues currently applied
Neato. This requires me to be in a queue *before* I fix my patch, right?
that's simpler. Otherwise you create a second patch and subsequently fold them toghether. Using a third part application called qct (that works also on git and some other I believe) you can also cherry pick single diffs in a single patch to be incorporated in a changeset. I use this a lot to keep the changeset as clean as possible. [disclaimer] I'm not an expert of git, so my comparison should not be taken seriously. It's true that all the time I use git I find it more convoluted than mercurial, and I always thought it was an historical heritage. sandro *:-) -- Sandro Dentella *:-) http://www.reteisi.org Soluzioni libere per le scuole http://sqlkit.argolinux.org SQLkit home page - PyGTK/python/sqlalchemy