Commits

Yuya Nishihara  committed d877460

hglib: add basic test for buildcmdargs()

  • Participants
  • Parent commits e58cf6c

Comments (0)

Files changed (1)

File tortoisehg/util/hglib.py

     return hgdispatch._dispatch(req)
 
 def buildcmdargs(**opts):
+    """Build list of command-line arguments
+
+    >>> buildcmdargs(branch='foo')
+    ['--branch', 'foo']
+    >>> buildcmdargs(rev=['0', '1'])
+    ['--rev', '0', '--rev', '1']
+    >>> buildcmdargs(no_merges=True, quiet=False)
+    ['--no-merges']
+    """
     args = []
     for k, v in opts.iteritems():
         if isinstance(v, bool):