Commits

mdelagra committed 21256da

changed logic for --target-groups and --target-people to use strings instead of lists, because the lists only had zero or one potential items

Comments (0)

Files changed (3)

mercurial_reviewboard/__init__.py

 
     for field in ('target_groups', 'target_people'):
         if opts.get(field):
-            value = ','.join(opts.get(field))
+            value = opts.get(field)
         else:
             value = ui.config('reviewboard', field)
         if value:
             _('create diff of all revisions on the branch')),
         ('I', 'interactive', False, 
             _('override the default summary and description')),
-        ('U', 'target_people', [], _('comma separated list of people needed to review the code')),
-        ('G', 'target_groups', [], _('comma separated list of groups needed to review the code')),
+        ('U', 'target_people', '', 
+            _('comma separated list of people needed to review the code')),
+        ('G', 'target_groups', '', 
+            _('comma separated list of groups needed to review the code')),
         ],
         _('hg postreview [OPTION]... [REVISION]')),
 }

mercurial_reviewboard/tests/test_commands.py

     opts = {}
     args = fancyopts.fancyopts(['-G', 'foo, bar'], cmdtable['postreview'][1], 
                                opts, True)
-    eq_(['foo, bar'], opts['target_groups'])
+    eq_('foo, bar', opts['target_groups'])
 
 def test_target_people():
     opts = {}
     args = fancyopts.fancyopts(['-U', 'john, jane'], cmdtable['postreview'][1], 
                                opts, True)
-    eq_(['john, jane'], opts['target_people'])
+    eq_('john, jane', opts['target_people'])

mercurial_reviewboard/tests/test_createfields.py

 
 def test_target_people():
     ui, repo, c, parentc, opts = set_up_two_revs()
-    opts['target_people'] = ['john, jane']
+    opts['target_people'] = 'john, jane'
     fields = createfields(ui, repo, c, parentc, opts)
     eq_('john, jane', fields['target_people'])
     
 def test_target_groups():
     ui, repo, c, parentc, opts = set_up_two_revs()
-    opts['target_groups'] = ['foo, bar']
+    opts['target_groups'] = 'foo, bar'
     fields = createfields(ui, repo, c, parentc, opts)
     eq_('foo, bar', fields['target_groups'])