Mercurial > hg > revset-talk
view session @ 7:1fb152119488 draft default tip
Add a thanks message at the end
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Wed, 25 Sep 2013 14:01:37 -0400 (2013-09-25) |
parents | e4f64c12923c |
children |
line wrap: on
line source
# 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)'