Managing local changes I don't want to push?

Patrick Mézard pmezard at gmail.com
Thu Aug 9 05:11:42 CDT 2007


Martin Sjögren a écrit :
> tor 2007-08-09 klockan 11:03 +0200 skrev Patrick Mézard:
>> Martin Sjögren a écrit :
> Replacing "svn update + hg ci" with "hg pull -u" here would make that
> work for my scenario, I guess? But how about when I want to push changes
> I make? (not the ones I want to keep local, that is) Won't those changes
> depend on the MQ changeset? I suppose I could do "hg qpop" before "hg
> commit" and "hg push" and then do "hg qpush" again afterwards? Sounds a
> bit cumbersome. :(

# Create the local patch
$ hg qnew localchanges
$ echo "local-target:" >> Makefile
$ hg qrefresh
$ hg qguard localchanges +local
$ hg qpop -a

# Activate and push the local patch
$ hg qselect local
$ hg qpush
$ echo "new file" > other_file
$ hg add other_file
$ hg qnew -f other_file.diff
# Inactivate the local changes and refresh the queue
$ hg qselect -n
$ hg qpop -a
$ hg qpush -a
$ hg qdel -r qbase:

You might want to use --git patches everywhere here. (see [diff] git=1).

Sure, if you have to recreate the localchanges every time this is 
cumbersome. But it would mean you have a real problem with your 
development process. These kinds of local patches tends to be long-lived 
in my experience.

A real problem might be the push/pop sequences changing your files 
timestamps too much and triggering unwanted rebuilds. This issue was 
raised recently on the mailing list.

--
Patrick Mézard


More information about the Mercurial mailing list