diff options
-rw-r--r-- | becommands/close.py | 3 | ||||
-rw-r--r-- | becommands/inprogress.py | 3 | ||||
-rw-r--r-- | becommands/open.py | 3 | ||||
-rw-r--r-- | libbe/bzr.py | 3 | ||||
-rw-r--r-- | libbe/plugin.py | 4 | ||||
-rw-r--r-- | setup.py | 12 | ||||
-rw-r--r-- | test.py | 20 |
7 files changed, 36 insertions, 12 deletions
diff --git a/becommands/close.py b/becommands/close.py index 7e5ac1c..52ab735 100644 --- a/becommands/close.py +++ b/becommands/close.py @@ -30,7 +30,8 @@ def execute(args): >>> tests.clean_up() """ options, args = get_parser().parse_args(args) - assert(len(args) == 1) + if len(args) !=1: + raise cmdutil.UserError("Please specify a bug id.") bug = cmdutil.get_bug(args[0]) bug.status = "closed" bug.save() diff --git a/becommands/inprogress.py b/becommands/inprogress.py index 9e396de..05da971 100644 --- a/becommands/inprogress.py +++ b/becommands/inprogress.py @@ -30,7 +30,8 @@ def execute(args): >>> tests.clean_up() """ options, args = get_parser().parse_args(args) - assert(len(args) == 1) + if len(args) !=1: + raise cmdutil.UserError("Please specify a bug id.") bug = cmdutil.get_bug(args[0]) bug.status = "in-progress" bug.save() diff --git a/becommands/open.py b/becommands/open.py index e51bf79..f7c23c1 100644 --- a/becommands/open.py +++ b/becommands/open.py @@ -30,7 +30,8 @@ def execute(args): >>> tests.clean_up() """ options, args = get_parser().parse_args(args) - assert(len(args) == 1) + if len(args) !=1: + raise cmdutil.UserError("Please specify a bug id.") bug = cmdutil.get_bug(args[0]) bug.status = "open" bug.save() diff --git a/libbe/bzr.py b/libbe/bzr.py index 7aa6a58..b53429c 100644 --- a/libbe/bzr.py +++ b/libbe/bzr.py @@ -121,7 +121,8 @@ def postcommit(directory): try: invoke_client('merge', directory=directory) except CommandError, e: - if 'No merge branch known or specified' in e.err_str: + if ('No merge branch known or specified' in e.err_str or + 'No merge location known or specified' in e.err_str): pass else: status = invoke_client('revert', '--no-backup', diff --git a/libbe/plugin.py b/libbe/plugin.py index b175733..4016ca1 100644 --- a/libbe/plugin.py +++ b/libbe/plugin.py @@ -52,9 +52,7 @@ def get_plugin(prefix, name): return my_import(prefix + "." + name) return None -plugin_path = sys.path[0] -while not os.path.isfile(os.path.join(plugin_path, "libbe/plugin.py")): - plugin_path = os.path.realpath(os.path.dirname(plugin_path)) +plugin_path = os.path.realpath(os.path.dirname(os.path.dirname(__file__))) if plugin_path not in sys.path: sys.path.append(plugin_path) def _test(): diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..bcb3f6d --- /dev/null +++ b/setup.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python + +from distutils.core import setup + +setup( + name='Bugs Everywhere', + version='205', + description='Bugtracker built on distributed revision control', + url='http://panoramicfeedback.com/opensource/', + packages=['becommands', 'libbe'], + scripts=['be'], + ) @@ -3,18 +3,28 @@ import doctest import sys if len(sys.argv) > 1: match = False + libbe_failures = libbe_tries = becommands_failures = becommands_tries = 0 mod = plugin.get_plugin("libbe", sys.argv[1]) if mod is not None: - doctest.testmod(mod) + libbe_failures, libbe_tries = doctest.testmod(mod) match = True mod = plugin.get_plugin("becommands", sys.argv[1]) if mod is not None: - doctest.testmod(mod) + becommands_failures, becommands_tries = doctest.testmod(mod) match = True if not match: print "No modules match \"%s\"" % sys.argv[1] -else: + sys.exit(1) + else: + sys.exit(libbe_failures or becommands_failures) +else: + failed = False for module in plugin.iter_plugins("libbe"): - doctest.testmod(module[1]) + failures, tries = doctest.testmod(module[1]) + if failures: + failed = True for module in plugin.iter_plugins("becommands"): - doctest.testmod(module[1]) + failures, tries = doctest.testmod(module[1]) + if failures: + failed = True + sys.exit(failed) |