Commits

Anonymous committed ab46c78

qctVcsHg does not take the username in __init__, but in initRepo

Comments (0)

Files changed (1)

             break
         
     vcs = None
-    username = None
+    initRepoArgs = {}
     if len(opts) == 0:
         # default to auto-detect VCS back-end if no matches were found
         if os.path.exists('.hg/'):
             from qctlib.version import qct_version
             print qct_version
         elif opt == '-u':
-            username = arg
+            initRepoArgs['username'] = arg
         elif opt == '--help':
             show_help()
         elif opt == '--cg':
             vcs = qctVcsP4()
         elif opt in ("-h", "--hg"):
             from qctlib.vcs.hg import qctVcsHg
-            vcs = qctVcsHg(username)
+            vcs = qctVcsHg()
         elif opt in ("-b", "--bzr"):
             from qctlib.vcs.bzr import qctVcsBzr
             vcs = qctVcsBzr()
             from qctlib.vcs.mtn import qctVcsMtn
             vcs = qctVcsMtn()
 
-    if not vcs or vcs.initRepo(sys.argv) != 0:
+    if not vcs or vcs.initRepo(sys.argv, **initRepoArgs) != 0:
         sys.exit()
 
     # Now we know it's worth the trouble to open the GUI