Need advice how to keep local changes without committing tomain branch

Brendan Cully brendan at kublai.com
Thu Dec 21 13:57:01 CST 2006


On Thursday, 21 December 2006 at 18:34, Andrei Vermel wrote:
> 
> From: "Brendan Cully" <brendan at kublai.com>
> To: "Andrei Vermel" <avermel at mail.ru>
> Cc: <mercurial at selenic.com>
> Sent: Wednesday, December 13, 2006 7:36 PM
> Subject: Re: Need advice how to keep local changes without committing 
> tomain branch
> 
> 
> >On Wednesday, 13 December 2006 at 00:18, Andrei Vermel wrote:
> >>I need to regularly commit changes to the main branch, but there are some 
> >>local changes that I do not want to commit. Also I'd like to be able to 
> >>resolve conflicts if the locally changed files get changed in the main 
> >>branch.
> >>MQ doesn't help as far as I can tell, as with patches applied I can't 
> >>commit easily - would need to qpop / qpush all the time. I can't add the 
> >>files to the .hgignore either, since they are managed by hg.
> >>
> >>Can anyone recommend how to do it properly please?
> >
> >mq's guards are suited to this. Tag your local changes with -upstream,
> >and qselect --reapply upstream when you want a tree without those.
> >
> 
> This works very nicely, but there's one concern left. After I do:
> qselect --reapply upstream 
> commit/update/whatever
> qselect --reapply -n
> 
> the files with local changes get a new timestamp which causes a massive 
> rebuild as the changes are in project configuration files.
> 
> Do you think it would be possible to somehow either optionally restore 
> timestamp
> of patched files, or allow commit/update of files that do not include the 
> patched
> files?

I'm not sure what you mean by the latter. You can qrefresh with -I/-X
and/or a file list to bring only a subset of the working directory
changes into a patch, leaving the rest as uncommitted
modifications. But then you'd be doing a lot of qpush/qpop -f, which
is probably dangerous.

You can also export a subset of your applied patches (eg hg export
qbase:last-upstream). This is probably easiest when your local mods
are at the top of the queue.

Personally, I use ccache to make the rebuild after qselect --reapply
-n fairly snappy.


More information about the Mercurial mailing list