changeset 2:e4f64c12923c draft

Finalise session for revset talk
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Wed, 25 Sep 2013 13:57:45 -0400
parents d5300f96f9a2
children ebd9c2539ebd
files session
diffstat 1 files changed, 68 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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