libbe.command.init

class libbe.command.init.Init(*args, **kwargs)

Create an on-disk bug repository

>>> import os, sys
>>> import libbe.storage.vcs
>>> import libbe.storage.vcs.base
>>> import libbe.util.utility
>>> io = libbe.command.StringInputOutput()
>>> io.stdout = sys.stdout
>>> ui = libbe.command.UserInterface(io=io)
>>> cmd = Init()
>>> dir = libbe.util.utility.Dir()
>>> vcs = libbe.storage.vcs.vcs_by_name('None')
>>> vcs.repo = dir.path
>>> try:
...     vcs.connect()
... except libbe.storage.ConnectionError:
...     'got error'
'got error'
>>> ui.storage_callbacks.set_unconnected_storage(vcs)
>>> ui.run(cmd)
No revision control detected.
BE repository initialized.
>>> bd = libbe.bugdir.BugDir(vcs)
>>> vcs.disconnect()
>>> vcs.connect()
>>> bugdir = libbe.bugdir.BugDir(vcs, from_storage=True)
>>> vcs.disconnect()
>>> vcs.destroy()
>>> dir.cleanup()
>>> dir = libbe.util.utility.Dir()
>>> vcs = libbe.storage.vcs.installed_vcs()
>>> vcs.repo = dir.path
>>> vcs._vcs_init(vcs.repo)
>>> ui.storage_callbacks.set_unconnected_storage(vcs)
>>> if vcs.name in libbe.storage.vcs.base.VCS_ORDER:
...     ui.run(cmd) 
... else:
...     vcs.init()
...     vcs.connect()
...     print 'Using ... for revision control.\nDirectory initialized.'
Using ... for revision control.
BE repository initialized.
>>> vcs.disconnect()
>>> vcs.connect()
>>> bugdir = libbe.bugdir.BugDir(vcs, from_storage=True)
>>> vcs.disconnect()
>>> vcs.destroy()
>>> dir.cleanup()

Methods

cleanup()
complete([argument, fragment])
help(*args)
run([options, args])
usage()
name = 'init'

This Page