Differences between revisions 14 and 24 (spanning 10 versions)
Revision 14 as of 2009-01-26 18:42:54
Size: 4291
Editor: slabbe
Comment:
Revision 24 as of 2009-01-26 19:42:49
Size: 4996
Editor: slabbe
Comment:
Deletions are marked like this. Additions are marked like this.
Line 8: Line 8:
   sage -combinat install $ sage -combinat install
Line 10: Line 10:
  ~+2. Familiarize with moving around the patches+~
Line 13: Line 11:
The sage-combinat is a set of ordered patches. The behavior of moving around those is done like a stack: ~+2. Top, applied and unapplied patches+~

S
age-combinat is a stack of ordered patches. To know which patch is currently on top of the stack :
Line 15: Line 15:
   hg qpop
   hg qpush
   hg qpop -a
   hg qpush -a
}}}
To know which patch is currently on top of the stack :
{{{
   hg qtop
$ hg qtop # Displays the most recently applied patch
Line 26: Line 19:
   hg qapplied
   hg qunapplied
$ hg qapplied # Lists all patches in the queue which are currently applied
$ hg qunapplied # ------------------- " -------------------------- unapplied
Line 31: Line 24:
   hg qseries $ hg qseries
}}}

~+3. Familiarize with moving around the patches+~

The behavior of moving around those is done like a stack:
{{{
$ hg qpush # Apply the first patch in the series which is not currently applied
$ hg qpop # Unapply the most recently applied patch
$ hg qpush -a # Apply all the patches
$ hg qpop -a # Upapplied all the patches
Line 35: Line 38:
   sage -b $ sage -b
$ sage
Line 37: Line 41:

~+4. Contents of patches+~
Line 39: Line 46:
   hg qdiff # or
   hg qstatus
$ hg qdiff # or
$ hg qstatus
Line 42: Line 49:
whether to show a complete diff or simply the name of the modified files. whether to show a complete modifications or simply the name of the modified files.
Line 44: Line 51:
~+3. Create a patch+~ ~+5. Create a patch+~
Line 48: Line 55:
    hg qnew my_improvement_AB.patch $ hg qpush -a                    #facultatif
$
hg qnew my_improvement_AB.patch
Line 50: Line 58:
This creates a new patch right after the current top patch. Usually, you want to create a new patch at the complete end of the stack and you can make sure of this by doing: The line {{{hg qpush -a}}} is only to make sure that the new patch is be created on top of the stack, because {{{qnew}}} creates a new patch right after the current top patch. It is suggested to add your initials (here AB) in the name so that everybody knows who owns what. TODO : Add more details about naming of patch.

~+6. Do your modifications+~

Before making any modifications, make sure the current top patch is yours and is the one you want to add your modifications to.
Line 52: Line 64:
    hg qpush -a
    hg qnew my_improvement_AB.patch
$ hg qtop
Line 55: Line 66:
It is suggested to add your initials (here AB) in the name so that everybody knows who owns what. TODO : Add more details about name of patch.

~+4. Do your modifications+~

Before making any modifications, make sure the current top patch is yours and is the one you want to add your modifications.
Do your modifications to one or many existing files. At any time, you can review your modifications done since the last {{{qrefresh}}} (explained below) or since the creation of the patch by doing:
Line 61: Line 68:
    hg qtop $ hg diff #complete modifications
$ hg status #list the modified files
Line 63: Line 71:
Do your modifications to one or many existing files. At any time, you can review your modifications done since the last qrefresh (explained below) or since the creation of the patch by doing: Note that you can *not* use {{{qpop}}} and {{{qpush}}} commands once you started modifications. If you added a file, you must declare it using the command:
Line 65: Line 73:
    hg diff
}}}
or
{{{
    hg status
}}}
to list simply the modified files. Note that you can't use qpop and qpush commands once you started modifications. If you added a file, you must specify it by the command:
{{{
    hg add <filename>
$ hg add <filename>
Line 76: Line 76:
~+5. QRefresh the patch+~ ~+7. QRefresh the patch+~
Line 80: Line 80:
    hg qdiff
    hg qstatus
$ hg qdiff
$ hg qstatus
Line 85: Line 85:
    hg qrefresh $ hg qrefresh
Line 89: Line 89:
    hg qdiff
    hg qstatus
$ hg qdiff
$ hg qstatus
Line 94: Line 94:
    hg diff
    hg status
$ hg diff
$ hg status
Line 99: Line 99:
~+6. Do more modifications+~ ~+8. Do more modifications+~
Line 101: Line 101:
You can now use qpop and qpush again and modify other patches you already created. Then follow again 1-3. After {{{qrefresh}}}, you can now use {{{qpop}}} and {{{qpush}}} again and modify other patches you already created. See steps 2-5.
Line 103: Line 103:
~+7. Commit your changes to the local mercurial database+~ ~+9. Commit your changes to the local mercurial database+~
Line 107: Line 107:
    hg qcommit $ hg qcommit
Line 111: Line 111:
~+8. Merge your changes with other sage-combinat developpers+~ ~+10. Merge your changes with other sage-combinat developpers+~
Line 115: Line 115:
    cd .hg/patches
    hg pull -u
$ cd .hg/patches
$ hg pull -u
Line 120: Line 120:
    hg merge $ hg merge
Line 124: Line 124:
TODO : write about conflicts... If there are conflicts between your changes and some recent changes on the server, then consult the [[http:/combinat/Mercurial|advanced instructions]].
Line 126: Line 126:
~+9. Push your changes to the server+~ ~+11. Push your changes to the server+~
Line 128: Line 128:
Here is where you must be prudent. Before committing any changes to the server, make sure that sage -br works fine: Here is where you must be prudent. Before committing any changes to the server, make sure that {{{sage -br}}} works fine:
Line 130: Line 130:
    hg qpop -a
    hg qpush -a
    sage -br
$ hg qpop -a
$ hg qpush -a
$ sage -br
Line 134: Line 134:
and that it passes the tests: and that it passes the tests
Line 136: Line 136:
    sage -t <filenames> $ sage -t <filenames>
Line 138: Line 138:
Then push your server after making sure again that there is no new changes on the server: and maybe even that the notebook still works (!)
Line 140: Line 140:
    cd .hg/patches
    hg pull -u
    hg push
sage: notebook()
Line 144: Line 142:
Then push your changes to server after making sure again that there is no new changes on the server:
{{{
$ cd .hg/patches
$ hg pull -u
$ hg push
}}}

Use and Contribute to the sage-combinat tree : step by step

Here are the basics steps in order to use and contribute some of your code to sage-combinat. Note that a patch has a unique owner so you should only modify a patch that is already yours.

1. Install sage-combinat

$ sage -combinat install

2. Top, applied and unapplied patches

Sage-combinat is a stack of ordered patches. To know which patch is currently on top of the stack :

$ hg qtop           # Displays the most recently applied patch

or which patches are currently applied or unapplied:

$ hg qapplied       # Lists all patches in the queue which are currently applied
$ hg qunapplied     #  ------------------- " --------------------------  unapplied

or all of them:

$ hg qseries 

3. Familiarize with moving around the patches

The behavior of moving around those is done like a stack:

$ hg qpush             # Apply the first patch in the series which is not currently applied
$ hg qpop              # Unapply the most recently applied patch
$ hg qpush -a          # Apply all the patches
$ hg qpop -a           # Upapplied all the patches

Note that after moving around the stack of patches, it is a good idea to rebuild sage before using it :

$ sage -b
$ sage

4. Contents of patches

To display the content of the current top patch, use

$ hg qdiff         # or
$ hg qstatus

whether to show a complete modifications or simply the name of the modified files.

5. Create a patch

Changes are always saved to the actual top patch currently applied. So before doing any changes, you must determine the patch where the changes should be saved. If it is your first contribution, start by creating a patch:

$ hg qpush -a                      #facultatif
$ hg qnew my_improvement_AB.patch

The line hg qpush -a is only to make sure that the new patch is be created on top of the stack, because qnew creates a new patch right after the current top patch. It is suggested to add your initials (here AB) in the name so that everybody knows who owns what. TODO : Add more details about naming of patch.

6. Do your modifications

Before making any modifications, make sure the current top patch is yours and is the one you want to add your modifications to.

$ hg qtop

Do your modifications to one or many existing files. At any time, you can review your modifications done since the last qrefresh (explained below) or since the creation of the patch by doing:

$ hg diff           #complete modifications
$ hg status         #list the modified files

Note that you can *not* use qpop and qpush commands once you started modifications. If you added a file, you must declare it using the command:

$ hg add <filename>

7. QRefresh the patch

Currently, the modifications are still not part of the patch as seen by the command

$ hg qdiff
$ hg qstatus

that does not display them. Use

$ hg qrefresh

to put the actual modifications in the current top patch. You can see that it worked when typing the command

$ hg qdiff
$ hg qstatus

that should now include your modifications and by the command

$ hg diff
$ hg status

that should not display them anymore.

8. Do more modifications

After qrefresh, you can now use qpop and qpush again and modify other patches you already created. See steps 2-5.

9. Commit your changes to the local mercurial database

After having done modifications to one or to many patches, you migth want to commit them to the local mercurial database:

$ hg qcommit

It includes all the changes to the patches done since the last commit. An editor will appear for you to provide a description of all the changes you made.

10. Merge your changes with other sage-combinat developpers

There is a possibility that somebody else pushed changes to the server since the last time you updated your sage-combinat tree. The local mercurial database will be used to merge those modifications. First pull any recent changes on the server by doing :

$ cd .hg/patches
$ hg pull -u

and

$ hg merge

if needed.

If there are conflicts between your changes and some recent changes on the server, then consult the advanced instructions.

11. Push your changes to the server

Here is where you must be prudent. Before committing any changes to the server, make sure that sage -br works fine:

$ hg qpop -a
$ hg qpush -a
$ sage -br

and that it passes the tests

$ sage -t <filenames>

and maybe even that the notebook still works (!)

sage: notebook()

Then push your changes to server after making sure again that there is no new changes on the server:

$ cd .hg/patches
$ hg pull -u
$ hg push