[PATCH] allow shell-quoting in command defaults

TK Soh teekaysoh at yahoo.com
Thu Sep 7 19:22:25 UTC 2006


Just found out that shell quoting doesn't work in command defaults:

    % hg debugconfig | grep export
    defaults.export=-o "PATCH %b_rev%R.diff"

    % hg export tip
    abort: unknown revision '%b_rev%R.diff"'!

Please review and command on this patch for a fix:

# HG changeset patch
# User TK Soh <teekaysoh at yahoo.com>
# Date 1157655200 18000
# Node ID 15526271eafbc389f792c72b9ef30f6bffba35b9
# Parent  fbd3f9fd645ddbb9074cf802be1950caeffa28cb
allow shell-quoting in command defaults

diff -r fbd3f9fd645d -r 15526271eafb mercurial/commands.py
--- a/mercurial/commands.py	Thu Sep 07 14:13:01 2006 +0200
+++ b/mercurial/commands.py	Thu Sep 07 13:53:20 2006 -0500
@@ -8,7 +8,7 @@ from demandload import demandload
 from demandload import demandload
 from node import *
 from i18n import gettext as _
-demandload(globals(), "os re sys signal shutil imp urllib pdb")
+demandload(globals(), "os re sys signal shutil imp urllib pdb shlex")
 demandload(globals(), "fancyopts ui hg util lock revlog templater bundlerepo")
 demandload(globals(), "fnmatch difflib patch random signal tempfile time")
 demandload(globals(), "traceback errno socket version struct atexit sets bz2")
@@ -3223,7 +3223,7 @@ def parse(ui, args):
         cmd = aliases[0]
         defaults = ui.config("defaults", cmd)
         if defaults:
-            args = defaults.split() + args
+            args = shlex.split(defaults) + args
         c = list(i[1])
     else:
         cmd = None


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Mercurial mailing list