Differences between revisions 3 and 5 (spanning 2 versions)
Revision 3 as of 2008-02-09 08:19:00
Size: 310
Editor: jason
Comment:
Revision 5 as of 2008-03-10 16:46:17
Size: 1777
Editor: jason
Comment:
Deletions are marked like this. Additions are marked like this.
Line 13: Line 13:

My mercurial queue workflow:

{{{
# cd into the repository
cd sage/devel/sage/


# initialize the queues. This only needs to be done once.
hg qinit



# cd into the directory I am working in
cd sage/graphs/

emacs graph.py # write my function, save the file

# 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

# RUN THE DOCTESTS!!!

sage -b
sage -t graph.py

# Happily all the doctests pass :)

# Review the patch in diff format

hg qdiff

# Oops, I see a mistake in my patch!

emacs graph.py # fix mistake

# refresh the patch to reflect my current source
hg qrefresh

# Export the tip of the queue (the last patch)
hg export qtip > ~/mypatch.patch

# If I want the patch to be unapplied, pop it off of the stack

hg qpop

# Now my source is back to where it was when I started.

}}}

To look at a patch from trac or from somewhere else:

{{{
# Download the patch from trac (in RAW format) and save to, e.g., newpatch.patch

# Pop off all my patches so I have a pristine release
hg qpop -a

# import the new patch
hg qimport newpatch.patch

# apply the new patch
hg qpush

# build and run sage
sage -br

# or doctest a file
sage -b
sage -t file.py

# pop the experimental patch off of the stack
hg qpop

# delete the patch
hg qdelete newpatch.patch

}}}

Mercurial Queues

  • Philosophy
  • Commands
    • qnew, qpop, qpush, qdelete, export
  • Example
  • Advanced usage
    • guards, merge, etc.

See [http://hgbook.red-bean.com/hgbook.html], Chapters 12 and 13.

The mercurial bash completion script is at [http://www.cct.lsu.edu/~mkemp2/mercurial]

My mercurial queue workflow:

# cd into the repository
cd sage/devel/sage/


# initialize the queues.  This only needs to be done once.
hg qinit



# cd into the directory I am working in 
cd sage/graphs/

emacs graph.py # write my function, save the file

# 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

# RUN THE DOCTESTS!!!

sage -b
sage -t graph.py

# Happily all the doctests pass :)

# Review the patch in diff format

hg qdiff

# Oops, I see a mistake in my patch!

emacs graph.py # fix mistake

# refresh the patch to reflect my current source
hg qrefresh 

# Export the tip of the queue (the last patch)
hg export qtip > ~/mypatch.patch

# If I want the patch to be unapplied, pop it off of the stack

hg qpop

# Now my source is back to where it was when I started.

To look at a patch from trac or from somewhere else:

# Download the patch from trac (in RAW format) and save to, e.g., newpatch.patch

# Pop off all my patches so I have a pristine release
hg qpop -a 

# import the new patch
hg qimport newpatch.patch

# apply the new patch
hg qpush

# build and run sage
sage -br

# or doctest a file
sage -b
sage -t file.py

# pop the experimental patch off of the stack
hg qpop 

# delete the patch
hg qdelete newpatch.patch