Add/remove bug dependencies
>>> import sys
>>> bd = libbe.bugdir.SimpleBugDir(memory=False)
>>> io = libbe.command.StringInputOutput()
>>> io.stdout = sys.stdout
>>> ui = libbe.command.UserInterface(io=io)
>>> ui.storage_callbacks.set_storage(bd.storage)
>>> cmd = Depend(ui=ui)
>>> ret = ui.run(cmd, args=['/a', '/b'])
abc/a blocked by:
abc/b
>>> ret = ui.run(cmd, args=['/a'])
abc/a blocked by:
abc/b
>>> ret = ui.run(cmd, {'show-status':True}, ['/a'])
abc/a blocked by:
abc/b closed
>>> ret = ui.run(cmd, args=['/b', '/a'])
abc/b blocked by:
abc/a
abc/b blocks:
abc/a
>>> ret = ui.run(cmd, {'show-status':True}, ['/a'])
abc/a blocked by:
abc/b closed
abc/a blocks:
abc/b closed
>>> ret = ui.run(cmd, {'show-summary':True}, ['/a'])
abc/a blocked by:
abc/b Bug B
abc/a blocks:
abc/b Bug B
>>> ret = ui.run(cmd, {'repair':True})
>>> ret = ui.run(cmd, {'remove':True}, ['/b', '/a'])
abc/b blocks:
abc/a
>>> ret = ui.run(cmd, {'remove':True}, ['/a', '/b'])
>>> ui.cleanup()
>>> bd.cleanup()
Methods
bug_string(_bug, params) | |
cleanup() | |
complete([argument, fragment]) | |
help(*args) | |
run([options, args]) | |
usage() |
Note: should probably be DependencyDiGraph.
Methods
blocked_by_tree() | |
blocks_tree() |
Check that links are bi-directional for all bugs in bugdir.
>>> import libbe.bugdir
>>> bugdir = libbe.bugdir.SimpleBugDir()
>>> bugdirs = {bugdir.uuid: bugdir}
>>> a = bugdir.bug_from_uuid('a')
>>> b = bugdir.bug_from_uuid('b')
>>> blocked_by_string = _generate_blocked_by_string(b)
>>> _add_remove_extra_string(a, blocked_by_string, add=True)
>>> good,repaired,broken = check_dependencies(
... bugdirs, repair_broken_links=False)
>>> good
[]
>>> repaired
[]
>>> broken
[(Bug(uuid='a'), Bug(uuid='b'))]
>>> _get_blocks(b)
[]
>>> good,repaired,broken = check_dependencies(
... bugdirs, repair_broken_links=True)
>>> _get_blocks(b)
['a']
>>> good
[]
>>> repaired
[(Bug(uuid='a'), Bug(uuid='b'))]
>>> broken
[]
>>> bugdir.cleanup()
Return a list of bugs blocking the given bug.
Return a list of bugs that the given bug blocks.