Commits

Yuya Nishihara  committed 446bd7c

hglib: have buildcmdargs evaluate None in boolean context

  • Participants
  • Parent commits b916f6e

Comments (0)

Files changed (1)

File tortoisehg/util/hglib.py

     ['push', '--branch', 'foo']
     >>> buildcmdargs('graft', r=['0', '1'])
     ['graft', '-r', '0', '-r', '1']
-    >>> buildcmdargs('log', no_merges=True, quiet=False)
+    >>> buildcmdargs('log', no_merges=True, quiet=False, limit=None)
     ['log', '--no-merges']
+    >>> buildcmdargs('commit', user='')
+    ['commit', '--user', '']
 
     positional arguments:
 
     """
     fullargs = [name]
     for k, v in opts.iteritems():
+        if v is None:
+            continue
+
         if len(k) == 1:
             aname = '-%s' % k
         else: