# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 1380131865 14400 # Node ID e4f64c12923ccd4c1fd76b4ba5e1cf8f9031ed7c # Parent d5300f96f9a25f9af13053df3532024ed21809bc Finalise session for revset talk diff --git a/session b/session --- a/session +++ b/session @@ -1,5 +1,69 @@ -cd /home/jordi -cd coding/vcs/octave-devel -# a comment -hg log +# This talk is gonna be about a feature called "revsets". What are they? + +# The Octave repo (yeah, I work on Octave) +cd coding/vcs/octave + +# Let's look around +ls +hg summary +hg log -G +hg book + + +# Several ways to refer to a commit +hg log -r mtlpy +hg log -r 17395 +hg log -r ffe05002f437 +hg log -r tip +hg log -r -1 +hg log -r -2 + +# But more advanced! +hg log -r -2::-1 +hg log -r . +hg log -r .~1 +hg log -r .^ + +# Git users, I know what you're thinking... git help revisions + +# But revsets are more advanced than that. Let's take a quick peek. +# It's really its own DSL. +hg help revsets + +# So last example could also have been +hg log -r 'p1(.)' + +# More example, the descendant revset, combining with other revset +# functions. +hg log -r 'descendants(@)' + +# Oops, let's skip @ +hg log -r 'descendants(@) and not @' +hg log -r 'min(descendants(@) and not @)' +hg log -r 'reverse(descendants(@) and not @)' + +# This revset seems handy, let's alias it +emacs ~/.hgrc + +# Of course, anywhere that you can fit revisions, you can also use a +# revset! +hg histedit -r 'children(@)' + +# Only bisect files that touch a particular files +hg bisect --skip 'not file("jit-ir.cc")' + +# In which release was histedit merged into core hg? +cd ../mercurial-source +hg log -r 'min(adds(hgext/histedit.py):: and tag())' + +# Let's write our own revset! +emacs ../revset-talk/lol.py + +# And let's have fun with it +emacs ~/.hgrc + +cd ../octave +hg log -r 'lol()' +hg log -r 'lol() and user(jordigh)' +hg log --patch --verbose --rev 'lol() and user(jordigh) and keyword(wisdom)' \ No newline at end of file