55
"""import bzrlib, bzrlib.commands
56
class cmd_myplug(bzrlib.commands.Command):
57
'''Just a simple test plugin.'''
60
print 'Hello from my plugin'
64
os.environ['BZRPLUGINPATH'] = os.path.abspath('plugin_test')
65
help = backtick('bzr help commands')
66
assert help.find('myplug') != -1
67
assert help.find('Just a simple test plugin.') != -1
70
assert backtick('bzr myplug') == 'Hello from my plugin\n'
71
assert backtick('bzr mplg') == 'Hello from my plugin\n'
73
f = open(os.path.join('plugin_test', 'override.py'), 'wb')
74
f.write("""import bzrlib, bzrlib.commands
75
class cmd_commit(bzrlib.commands.cmd_commit):
76
'''Commit changes into a new revision.'''
77
def run(self, *args, **kwargs):
78
print "I'm sorry dave, you can't do that"
80
class cmd_help(bzrlib.commands.cmd_help):
81
'''Show help on a command or other topic.'''
82
def run(self, *args, **kwargs):
83
print "You have been overridden"
84
bzrlib.commands.cmd_help.run(self, *args, **kwargs)
55
# """import bzrlib, bzrlib.commands
56
# class cmd_myplug(bzrlib.commands.Command):
57
# '''Just a simple test plugin.'''
60
# print 'Hello from my plugin'
64
# os.environ['BZRPLUGINPATH'] = os.path.abspath('plugin_test')
65
# help = backtick('bzr help commands')
66
# assert help.find('myplug') != -1
67
# assert help.find('Just a simple test plugin.') != -1
70
# assert backtick('bzr myplug') == 'Hello from my plugin\n'
71
# assert backtick('bzr mplg') == 'Hello from my plugin\n'
73
# f = open(os.path.join('plugin_test', 'override.py'), 'wb')
74
# f.write("""import bzrlib, bzrlib.commands
75
# class cmd_commit(bzrlib.commands.cmd_commit):
76
# '''Commit changes into a new revision.'''
77
# def run(self, *args, **kwargs):
78
# print "I'm sorry dave, you can't do that"
80
# class cmd_help(bzrlib.commands.cmd_help):
81
# '''Show help on a command or other topic.'''
82
# def run(self, *args, **kwargs):
83
# print "You have been overridden"
84
# bzrlib.commands.cmd_help.run(self, *args, **kwargs)