libbe.command.diff

class libbe.command.diff.Diff(*args, **kwargs)

Compare bug reports with older tree

>>> import sys
>>> import libbe.bugdir
>>> bd = libbe.bugdir.SimpleBugDir(memory=False, versioned=True)
>>> io = libbe.command.StringInputOutput()
>>> io.stdout = sys.stdout
>>> ui = libbe.command.UserInterface(io=io)
>>> ui.storage_callbacks.set_storage(bd.storage)
>>> cmd = Diff()
>>> original = bd.storage.commit('Original status')
>>> bug = bd.bug_from_uuid('a')
>>> bug.status = 'closed'
>>> changed = bd.storage.commit('Closed bug a')
>>> ret = ui.run(cmd, args=[original])
Modified bugs:
  abc/a:cm: Bug A
    Changed bug settings:
      status: open -> closed
>>> ret = ui.run(cmd, {'subscribe':'DIR:mod', 'uuids':True}, [original])
a
>>> bd.storage.versioned = False
>>> ret = ui.run(cmd, args=[original])
Traceback (most recent call last):
  ...
UserError: This repository is not revision-controlled.
>>> ui.cleanup()
>>> bd.cleanup()

Methods

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

This Page