First make a clone:
sage -clone mybranch
Switch to the clone:
sage -b mybranch
Download the patches from trac, say blah1.patch, blah2.patch, and apply them:
cd $SAGE_ROOT/sage/devel/sage
hg qinit
If the qinit command fails then you may need to edit your .hgrc file;
see http://wiki.sagemath.org/MercurialQueues
Now apply the two patches:
hg qimport /somewhere/blah1.patch
hg qpush
hg qimport /somewhere/blah2.patch
hg qpush
Rebuild sage:
sage -b
--
Carlo Hamalainen
http://carlo-hamalainen.net
Interesting -- can you supply more details (and or a reference)?
I have used hg_sage.apply() many times; how does import_patch() differ?
John
You don't have to do that. You can do:
sage: hg_sage.apply('... url ...')
sage: quit
./sage -br
sage: <try it out>
This needs work! Argh.
sage: hg_sage.rollback()
sage: hg_sage.revert('--all')
sage: quit
Now your repo is as if you never applied the patch.
You can only rollback one time though, so you can't apply multiple
patches -- if you want to to that you need to clone or use queues.
William
It never ceases to amaze me how many slightly different ways there are
of doing things, and that we all use slightly different variants!
One reason why I have (temporarily, I expect) stopped using hg queues
was that it was pointed out to me that the patches I made from there
(hg export qtip) did not have a proper commit message. I read all the
documentation, did what it said -- but still there was no commit
message in the patch. I'm sure someone will now tell me what is the
right way to do that (but please don't just point me to the
documentation this time, as what I fould there sis not work for me!)
John
Hi John,
Here is what I do, although it's probably not the right way to do
things: after hg export qtip, I load the resulting patch file in emacs
and insert the commit message by hand. More precisely, I replace the
first line after the hg "comments", which just says [mq] something,
with a reasonable commit message. If I have time and am not sleep
deprived (so, basically never) this also gives me a chance to have a
last look over the patch and see if I forgot anything -- my emacs
displays diff files in a nice readable way, so it's fairly pleasant.
Again, I'm not claiming this is "the right way" to do it, but it works
for me and it's fairly quick.
Best,
Alex
--
Alex Ghitza -- Lecturer in Mathematics -- The University of Melbourne
-- Australia -- http://www.ms.unimelb.edu.au/~aghitza/
On Thu, Aug 27, 2009 at 6:30 PM, John Cremona<john.c...@gmail.com> wrote:
<SNIP>
> One reason why I have (temporarily, I expect) stopped using hg queues
> was that it was pointed out to me that the patches I made from there
> (hg export qtip) did not have a proper commit message.
The person who pointed that out to you is me :-)
> I read all the
> documentation, did what it said -- but still there was no commit
> message in the patch. I'm sure someone will now tell me what is the
> right way to do that (but please don't just point me to the
> documentation this time, as what I fould there sis not work for me!)
In addition to Alex's suggestion, here's another tip to ensure you
have a proper, sensible commit message. After making the necessary
changes, you can refresh your patch with
hg qrefresh -e
where the optional argument "-e" tells Mercurial to open an editor for
you to write your commit message. After you have entered your commit
message in the editor, quit the editor and the commit message is saved
with the refreshed patch.
--
Regards
Minh Van Nguyen
Are you doing hg qnew -e ?
# The -e pops up an editor for me to enter a commit message
# The -f retroactively saves my changes as a patch
# (the changes visible in hg diff)
hg qnew -e -f mypatch.patch
More info here: http://wiki.sagemath.org/MercurialQueues
To Minh: I think this is what I was looking for (hg qrefresh -e). I
had tried hg qrefresh -m "commit message" but it did not work. I will
try this next time.
To Carlo: thanks for updating the wiki on queues, which has grown
since I last looked. I find your solution rather counterintuitive
though: surely ones does "hg -qnew" at the beginning of some work, so
that seems a funny time to write the commit message? But I don't
understand what you mean by the comment "The -f retroactively saves my
changes as a patch" either. Surely you are not editing files *before*
the qnew?
John
PS admire my netiquette: no automatic quotes!
Actually I didn't edit that wiki page, and I do find it a bit
mysterious to be entering the commit message at that point in the
process. Can any Mercurial guru enlighten us?
That text was entered by Jason (according to the wiki revision history).
John
I have to use hg qnew -f fairly often in the following situation: I am
looking at a trac ticket, find the source file in the Sage library
where things need to be fixed/added, and start playing with it.
Eventually I give up or find a solution, at which point I realise that
I forgot to create a new patch in the queue. So I resort to -f and
the universe is ok again. :)
Sometimes, yes. I usually use
hg qnew -e -f trac_XXXX-do_something.patch
after I realize that my most recent changes should comprise a new patch.
For example, the changes may be more than a simple revision to the
topmost applied patch, on a different topic, highly experimental, etc.
I substitute the appropriate ticket number, if I happen to have it. The
first commit message just summarizes what I've done so far and perhaps
also what's left to do.
That describes my usual procedure, which is why the wiki says "hg qnew -f"
If you are disciplined enough to realize that you are going to fix
something in the next N minutes, then by all means, go ahead and do hg
qnew before starting your project. I think I've remembered to do that
about 3 times in the last 1.5 years.
Jason
> Somehow, reading both the mercurial queues manual and the sage wiki
> version of the same, there were still things not understood (by me)!
Of course, the obvious request now is to ask you to update the sage wiki
so that you would have understood it :).
Jason