Skip to content
Snippets Groups Projects
  1. Aug 12, 2010
  2. Aug 24, 2010
  3. Aug 21, 2010
  4. Aug 20, 2010
  5. Aug 21, 2010
  6. Aug 20, 2010
  7. Aug 19, 2010
  8. Aug 13, 2010
  9. Aug 19, 2010
  10. Aug 18, 2010
    • Steve Losh's avatar
      aliases: provide more flexible ways to work with shell alias arguments · f853873f
      Steve Losh authored
      This patch changes the functionality of shell aliases to add more powerful
      options for working with shell alias arguments.
      
      First: the alias name + arguments to a shell alias are set as an HG_ARGS
      environment variable, delimited by spaces. This matches the behavior of hooks.
      
      Second: any occurrences of "$@" (without quotes) are replaced with the
      arguments, separated by spaces. This happens *before* the alias gets to the shell.
      
      Third: any positive numeric variables ("$1", "$2", etc) are replaced with the
      appropriate argument, indexed from 1. "$0" is replaced with the name of the
      alias. Any "extra" numeric variables are replaced with an empty string.  This
      happens *before* the alias gets to the shell.
      
      These changes allow for more flexible shell aliases:
      
          [alias]
          echo = !echo $@
          count = !hg log -r "$@" --template='.' | wc -c | sed -e 's/ //g'
          qqueuemv = !mv "`hg root`/.hg/patches-$1" "`hg root`/.hg/patches-$2"
      
      In action:
      
          $ hg echo foo
          foo
      
          $ hg count 'branch(default)'
          901
      
          $ hg count 'branch(stable) and keyword(fixes)'
          102
      
          $ hg qqueuemv myfeature somefeature
      f853873f
    • Steve Losh's avatar
      util: add an interpolate() function to for replacing multiple values · 8380ed69
      Steve Losh authored
      util.interpolate can be used to replace multiple items in a string all at once
      (and optionally apply a function to the replacement), without worrying about
      recursing:
      
          >>> import util
          >>> s = '$foo, $spam'
          >>> util.interpolate(r'\$', { 'foo': 'bar', 'spam': 'eggs' }, s)
          'bar, eggs'
          >>> util.interpolate(r'\$', { 'foo': 'spam', 'spam': 'foo' }, s)
          'spam, foo'
          >>> util.interpolate(r'\$', { 'foo': 'spam', 'spam': 'foo' }, s, lambda s: s.upper())
          'SPAM, FOO'
      
      The patch also changes filemerge.py to use this new function.
      8380ed69
    • Brodie Rao's avatar
      convert: use encoding.encoding instead of locale.getpreferredencoding() · 3145951e
      Brodie Rao authored
      The latter may not return useful results in certain OS X environments.
      3145951e
    • Brodie Rao's avatar
      d2796a3c
Loading