newbie: how to "update" a patch

2 views
Skip to first unread message

Dima Pasechnik

unread,
Feb 3, 2010, 5:50:57 AM2/3/10
to sage-devel
I need to issue updates to the patch on a trac ticket I issued.
What is the correct mode of operation:

open a new ticket referring to this one?
--- clear how to proceed

make a new patch replacing the present one?
--- I have trouble understanding how to do this in mercurial.
Do I backout my previous patch and make a new one? (I tried this
and it didn't seem to work. If anyone knows
how to do this exactly, I'd most appreciate hearing details or being
pointed to a readable manual/howto...)

bang my head on the keyboard endlessly, as I didn't clone the version
I made the original patch against?

Thanks,
Dima

David Joyner

unread,
Feb 3, 2010, 6:33:27 AM2/3/10
to sage-...@googlegroups.com
On Wed, Feb 3, 2010 at 5:50 AM, Dima Pasechnik <dim...@gmail.com> wrote:
> I need to issue updates to the patch on a trac ticket I issued.
> What is the correct mode of operation:
>
> open a new ticket referring to this one?
> --- clear how to proceed
>
> make a new patch replacing the present one?
> --- I have trouble understanding how to do this in mercurial.
>    Do I backout my previous patch and make a new one? (I tried this
> and it didn't seem to work. If anyone knows
> how to do this exactly, I'd most appreciate hearing details or being
> pointed to a readable manual/howto...)


Assuming that the ticket you opened has not been closed, one thing
you could try is to start from a "clean" version of 4.3.2.a1,
create a clone, apply your old patch to the clone,
edit the files you want to edit in devel/sage-myclone/sage/groups/
or whatever, run sage -b, test, create a new patch using
hg_sage.commit etc, post that patch.

There is a way to revert, which might be a better way to go, but
I think the above should work.

>
> bang my head on the keyboard endlessly, as I didn't clone the version
> I made the original patch against?
>
> Thanks,
> Dima
>

> --
> To post to this group, send an email to sage-...@googlegroups.com
> To unsubscribe from this group, send an email to sage-devel+...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org
>

Message has been deleted

bump

unread,
Feb 3, 2010, 2:03:51 PM2/3/10
to sage-devel
> make a new patch replacing the present one?
> --- I have trouble understanding how to do this in mercurial.
> Do I backout my previous patch and make a new one? (I tried this
> and it didn't seem to work. If anyone knows
> how to do this exactly, I'd most appreciate hearing details or being
> pointed to a readable manual/howto...)

It's a good idea to use a mercurial queues, which bring sanity to
working on patches.

Mercurial queues are explained in O'Sullivan's book, which are online:
http://hgbook.red-bean.com/
as well as the doc patches in #8108 and #8147.

But to get started, clone sage:

$ sage -clone work

This will create a subdirectory of the sage root directory called
devel/sage-work. Here $ is command line prompt.

In the directory devel/sage-work you can start a mercurial queue with
the command
$ hg qinit -c

Then you can start a new patch with the command $ hg qnew
or you can import an existing patch that you want to work on with $ hg
qimport [patchname].

The patches are in the directory devel/sage-work/.hg/patches .

Dan

Harald Schilly

unread,
Feb 3, 2010, 2:47:12 PM2/3/10
to sage-devel
On Feb 3, 8:03 pm, bump <b...@match.stanford.edu> wrote:
> It's a good idea to use a mercurial queues, which bring sanity to
> working on patches.

http://wiki.sagemath.org/MercurialQueues

Robert Bradshaw

unread,
Feb 3, 2010, 3:39:49 PM2/3/10
to sage-...@googlegroups.com
On Feb 3, 2010, at 2:50 AM, Dima Pasechnik wrote:

> I need to issue updates to the patch on a trac ticket I issued.
> What is the correct mode of operation:
>
> open a new ticket referring to this one?
> --- clear how to proceed

Better to post a new patch on this ticket. You can either make a new
patch, or make a second patch that applies on top of the first. (The
former would be preferable in your case, the latter is better when you
make a huge amount of changes, then have a couple of tweaks in
response to referee comments.)

> make a new patch replacing the present one?
> --- I have trouble understanding how to do this in mercurial.
> Do I backout my previous patch and make a new one? (I tried this
> and it didn't seem to work.

For future reference, I would look into using queues. Well worth the
effort.

> If anyone knows
> how to do this exactly, I'd most appreciate hearing details or being
> pointed to a readable manual/howto...)
>
> bang my head on the keyboard endlessly, as I didn't clone the version
> I made the original patch against?

I'd always recommend working in a clone. If you didn't clone right
away, that's easily remedied. Inside $SAGE_ROOT/devel there is a
directory called sage-main. Move it to, say, sage-main-old. Now run

sage -f SAGE_ROOT/spkg/standard/sage-x.y.z.spkg

where x.y.z is the version of Sage you are working off of. This will
rebuild a completely fresh sage-main for you.

- Robert

Rob Beezer

unread,
Feb 3, 2010, 4:06:08 PM2/3/10
to sage-devel
On Feb 3, 9:26 am, Minh Nguyen <nguyenmi...@gmail.com> wrote:
> See tickets #8108 and #8147 for introductory materials on patch
> management with Mercurial:
>
> http://trac.sagemath.org/sage_trac/ticket/8108
>
> http://trac.sagemath.org/sage_trac/ticket/8147

To learn more about patch management, please apply the following
patches.... ;-)

Seriously, Minh is a big part of putting these together and getting
them merged into the next release. This new section of the
Developer's Guide should ease a lot of frustration and head-banging,
so consider sending new developers to the new "Walkthrough" section of
the guide once it comes out.

Many thanks to Minh for his release mangement and his conscientious
work on documentation.

Rob

Dima Pasechnik

unread,
Feb 4, 2010, 4:09:31 AM2/4/10
to sage-devel
Mercurial queues are great, as I am just beginning to see.
Thanks for sharing.

Dmitrii

Reply all
Reply to author
Forward
0 new messages