Differences between revisions 4 and 10 (spanning 6 versions)
Revision 4 as of 2010-11-19 23:05:20
Size: 3106
Editor: slabbe
Comment:
Revision 10 as of 2022-04-05 05:16:35
Size: 0
Editor: mkoeppe
Comment: outdated
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
The purpose of this page is to explain how to share your branch of Sage development. I am sure there more than one way to do so, but the solution shown here is the same as the way [[http://wiki.sagemath.org/combinat|Sage Combinat]] shares its development.

First, clone the sage-main. Below, I use my sage trac username to name that branch, because it's my branch of Sage development.

{{{
sage -b main
sage -clone slabbe
}}}

Go to the directory associated to that new branch and initialize the Queue for Mercurial. See [[http://www.sagemath.org/doc/developer/walk_through.html#being-more-efficient-mercurial-queues|Sage Development Manual : Mercurial queues]] for more details.

{{{
cd SAGE_HOME/devel/sage-slabbe
hg qinit
}}}

This last step created a new directory ({{{SAGE_HOME/devel/sage-slabbe/.hg/patches}}}) where your patches will be saved. In order to share your branch, you simply need to share this directory. For example, you can copy its content to a public directory on your web site. You can also use svn, git or any other revision control system. As I want to work on my branch the exact same way as I am working on the sage-combinat branch, I choose to use hg.

Now I log on the server that will host my patches, I create the (public) patches directory and I initialize that directory as an hg directory:

{{{
ssh [email protected]
mkdir patches
cd patches
hg init
}}}

I also add a hook to that public repository so that is update itself automatically when a push is made to it. In other words, I edit the file {{{~/patches/.hg/hgrc}}} so that it becomes :

{{{
#file ~/patches/.hg/hgrc
[hooks]
changegroup = hg update
}}}

I then logout from the server and go to the patches directory on my machine and make a clone of the public patches repository created above. I could use the http adress, but I use the ssh one so that I can push to the server later on:

{{{
cd SAGE_HOME/devel/sage-slabbe/.hg/patches
hg clone ssh://[email protected]:~/patches .
}}}

Like for the Sage-combinat repository, I create in {{{.hg/patches}}} a file called {{{.hgignore}}} containing the following :

{{{
# file .hgignore
syntax: glob
status
guards
}}}

Then, add, commit and push this first change to the server.

{{{
hg add .hgignore
hg commit -m "Added the .hgignore file"
hg push
}}}

I can now create patches on my branch like in sage-combinat:

{{{
cd SAGE_HOME/devel/sage-slabbe/
hg qnew trac_XXXX-fixing-stuff.patch
vim sage/combinat/partition.py
hg qrefresh -e
}}}

I can push my changes to my public server like in sage-combinat:

{{{
cd SAGE_HOME/devel/sage-slabbe/.hg/patches
hg st
hg commit
hg push
}}}

For the first time, you may need to add the series file as well:

{{{
cd SAGE_HOME/devel/sage-slabbe/.hg/patches
hg add series
hg commit
hg push
}}}

Last thing, notice that the sage-combinat script can be used to install your branch on any sage installation with the following one liner :

{{{
sage -combinat install -b slabbe -s http://server.com/path/to/your/username/patches/
}}}