--- a/ForgeSCM/forgescm/lib/command.py
+++ b/ForgeSCM/forgescm/lib/command.py
@@ -2,6 +2,7 @@
 import shutil
 import logging
 import subprocess
+import sys
 
 from pylons import c
 
@@ -22,6 +23,7 @@
         if cwd is None:
             cwd=self.cwd()
         log.info('Running command: %r in %s', self.args, cwd)
+        #print >> sys.stderr, 'Running command: %r in %s', self.args, cwd
         self.sp = subprocess.Popen(
             self.args, executable=self.args[0],
             stdin=None, stdout=subprocess.PIPE,
@@ -36,9 +38,13 @@
         # blocks waiting for the OS pipe buffer to accept more data. Use
         # communicate() to avoid that.
         self.sp.wait()
-
         log.info('command result: %s', self.sp.returncode)
-        return self.sp.returncode
+        if self.sp.returncode != 0:
+            print >> sys.stderr, 'command %r (in %s) returned: %s' % (self.args, self.cwd(), self.sp.returncode)
+            assert False
+        if hasattr(self, "finish"):
+            self.finish()
+        return self
 
     def run_exc(self, *args, **kwargs):
         result = self.run(*args, **kwargs)