graphlog: escape log -G single value option arguments
authorPatrick Mezard <pmezard@gmail.com>
Sat, 30 Apr 2011 19:42:00 +0200
changeset 14083 2520ebfd9f5c
parent 14082 176b3abb5b8b
child 14084 2285e5c97f72
graphlog: escape log -G single value option arguments
hgext/graphlog.py
tests/test-glog.t
--- a/hgext/graphlog.py	Sat Apr 30 19:42:00 2011 +0200
+++ b/hgext/graphlog.py	Sat Apr 30 19:42:00 2011 +0200
@@ -239,7 +239,7 @@
         if op in ('follow', 'only_merges', 'no_merges', 'removed'):
             revset.append('%s' % revop)
         elif op in ('date',):
-            revset.append('%s(%s)' % (revop, val))
+            revset.append('%s(%r)' % (revop, val))
         elif op in ('include', 'exclude', 'user', 'branch', 'keyword',
                     'prune', 'only_branch'):
             for f in val:
--- a/tests/test-glog.t	Sat Apr 30 19:42:00 2011 +0200
+++ b/tests/test-glog.t	Sat Apr 30 19:42:00 2011 +0200
@@ -1413,4 +1413,6 @@
   \s*28 (re)
   $ hg log -G --no-merges --template 'nodetag {rev}\n' | grep nodetag | wc -l
   \s*9 (re)
-
+  $ hg log -G -d 'brace ) in a date'
+  abort: invalid date: 'brace ) in a date'
+  [255]