diff options
-rw-r--r-- | .be/bugs/4a4609c8-1882-47de-9d30-fee410b8a802/values | 35 | ||||
-rw-r--r-- | .be/bugs/6622c06a-ed84-4d45-8011-a082fca219b6/values | 35 | ||||
-rw-r--r-- | .be/bugs/6eb8141f-b0b1-4d5b-b4e6-d0860d844ada/comments/f2011471-56cb-46e2-813b-1ac336ee7bbc/body | 1 | ||||
-rw-r--r-- | .be/bugs/6eb8141f-b0b1-4d5b-b4e6-d0860d844ada/comments/f2011471-56cb-46e2-813b-1ac336ee7bbc/values | 14 | ||||
-rw-r--r-- | .be/bugs/6eb8141f-b0b1-4d5b-b4e6-d0860d844ada/values | 35 | ||||
-rw-r--r-- | .be/bugs/cf56e648-3b09-4131-8847-02dff12b4db2/values | 35 | ||||
-rw-r--r-- | .be/bugs/e0155831-499f-421a-ad02-cd15fc3fecf1/values | 2 | ||||
-rw-r--r-- | beweb/beweb/controllers.py | 3 | ||||
-rw-r--r-- | libbe/bzr.py | 53 | ||||
-rw-r--r-- | libbe/names.py | 7 | ||||
-rw-r--r-- | libbe/rcs.py | 16 |
11 files changed, 216 insertions, 20 deletions
diff --git a/.be/bugs/4a4609c8-1882-47de-9d30-fee410b8a802/values b/.be/bugs/4a4609c8-1882-47de-9d30-fee410b8a802/values new file mode 100644 index 0000000..5d081cf --- /dev/null +++ b/.be/bugs/4a4609c8-1882-47de-9d30-fee410b8a802/values @@ -0,0 +1,35 @@ + + + +creator=abentley + + + + + + +severity=serious + + + + + + +status=open + + + + + + +summary=Do we need a severity between serious and minor? EG "Moderate"? + + + + + + +time=Wed, 25 Jan 2006 23:14:07 +0000 + + + diff --git a/.be/bugs/6622c06a-ed84-4d45-8011-a082fca219b6/values b/.be/bugs/6622c06a-ed84-4d45-8011-a082fca219b6/values new file mode 100644 index 0000000..fbec03f --- /dev/null +++ b/.be/bugs/6622c06a-ed84-4d45-8011-a082fca219b6/values @@ -0,0 +1,35 @@ + + + +creator=abentley + + + + + + +severity=minor + + + + + + +status=open + + + + + + +summary=Better word wrapping in comments. (kill <pre>.) + + + + + + +time=Mon, 30 Jan 2006 20:03:25 +0000 + + + diff --git a/.be/bugs/6eb8141f-b0b1-4d5b-b4e6-d0860d844ada/comments/f2011471-56cb-46e2-813b-1ac336ee7bbc/body b/.be/bugs/6eb8141f-b0b1-4d5b-b4e6-d0860d844ada/comments/f2011471-56cb-46e2-813b-1ac336ee7bbc/body new file mode 100644 index 0000000..30f02d7 --- /dev/null +++ b/.be/bugs/6eb8141f-b0b1-4d5b-b4e6-d0860d844ada/comments/f2011471-56cb-46e2-813b-1ac336ee7bbc/body @@ -0,0 +1 @@ + On a new bug, if I add comment then click "Update", the Summary goes missing!
\ No newline at end of file diff --git a/.be/bugs/6eb8141f-b0b1-4d5b-b4e6-d0860d844ada/comments/f2011471-56cb-46e2-813b-1ac336ee7bbc/values b/.be/bugs/6eb8141f-b0b1-4d5b-b4e6-d0860d844ada/comments/f2011471-56cb-46e2-813b-1ac336ee7bbc/values new file mode 100644 index 0000000..f20c01d --- /dev/null +++ b/.be/bugs/6eb8141f-b0b1-4d5b-b4e6-d0860d844ada/comments/f2011471-56cb-46e2-813b-1ac336ee7bbc/values @@ -0,0 +1,14 @@ + + + +Date=Fri, 27 Jan 2006 14:30:26 +0000 + + + + + + +From=abentley + + + diff --git a/.be/bugs/6eb8141f-b0b1-4d5b-b4e6-d0860d844ada/values b/.be/bugs/6eb8141f-b0b1-4d5b-b4e6-d0860d844ada/values new file mode 100644 index 0000000..d5d1d51 --- /dev/null +++ b/.be/bugs/6eb8141f-b0b1-4d5b-b4e6-d0860d844ada/values @@ -0,0 +1,35 @@ + + + +creator=abentley + + + + + + +severity=serious + + + + + + +status=open + + + + + + +summary=On a new bug, if I add or edit a comment, then click "Update", the Summary goes missing. + + + + + + +time=Fri, 27 Jan 2006 14:29:51 +0000 + + + diff --git a/.be/bugs/cf56e648-3b09-4131-8847-02dff12b4db2/values b/.be/bugs/cf56e648-3b09-4131-8847-02dff12b4db2/values new file mode 100644 index 0000000..bfbd4ed --- /dev/null +++ b/.be/bugs/cf56e648-3b09-4131-8847-02dff12b4db2/values @@ -0,0 +1,35 @@ + + + +creator=abentley + + + + + + +severity=fatal + + + + + + +status=open + + + + + + +summary=OK, maybe not fatal, but how about a new name that suggests process tracking, not just bugs? + + + + + + +time=Fri, 27 Jan 2006 14:37:25 +0000 + + + diff --git a/.be/bugs/e0155831-499f-421a-ad02-cd15fc3fecf1/values b/.be/bugs/e0155831-499f-421a-ad02-cd15fc3fecf1/values index f2533d7..754904a 100644 --- a/.be/bugs/e0155831-499f-421a-ad02-cd15fc3fecf1/values +++ b/.be/bugs/e0155831-499f-421a-ad02-cd15fc3fecf1/values @@ -15,7 +15,7 @@ severity=minor -status=open +status=in-progress diff --git a/beweb/beweb/controllers.py b/beweb/beweb/controllers.py index cbd0816..9124116 100644 --- a/beweb/beweb/controllers.py +++ b/beweb/beweb/controllers.py @@ -93,6 +93,9 @@ class Bug(PrestHandler): assigned = None bug.assigned = assigned bug.save() + bug.rcs.precommit(bug.path) + bug.rcs.commit(bug.path, "Auto-commit") + bug.rcs.postcommit(bug.path) raise cherrypy.HTTPRedirect(bug_list_url(bug_data["project"])) def instantiate(self, project, bug): diff --git a/libbe/bzr.py b/libbe/bzr.py index 80b9e9b..b8d1c8c 100644 --- a/libbe/bzr.py +++ b/libbe/bzr.py @@ -14,27 +14,26 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -from subprocess import Popen, PIPE import os -import config - -def invoke(args): - q = Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE) - output = q.stdout.read() - error = q.stderr.read() - status = q.wait() - if status >= 0: - return status, output, error - raise Exception("Command failed: %s" % error) +import tempfile +import config +from rcs import invoke, CommandError def invoke_client(*args, **kwargs): + directory = kwargs.get('directory') + expect = kwargs.get('expect', (0, 1)) cl_args = ["bzr"] cl_args.extend(args) - status,output,error = invoke(cl_args) - if status not in (0,): - raise Exception("Command failed: %s" % error) - return output + if directory: + old_dir = os.getcwd() + os.chdir(directory) + try: + status,output,error = invoke(cl_args, expect) + finally: + if directory: + os.chdir(old_dir) + return status, output def add_id(filename, paranoid=False): invoke_client("add", filename) @@ -53,7 +52,7 @@ def set_file_contents(path, contents): add_id(path) def lookup_revision(revno): - return invoke_client("lookup-revision", str(revno)).rstrip('\n') + return invoke_client("lookup-revision", str(revno)).rstrip('\n')[1] def export(revno, revision_dir): invoke_client("export", "-r", str(revno), revision_dir) @@ -70,11 +69,11 @@ def find_or_make_export(revno): return revision_dir def bzr_root(path): - return invoke_client("root", path).rstrip('\r') + return invoke_client("root", path).rstrip('\r')[1] def path_in_reference(bug_dir, spec): if spec is None: - spec = int(invoke_client("revno")) + spec = int(invoke_client("revno")[1]) rel_bug_dir = bug_dir[len(bzr_root(bug_dir)):] export_root = find_or_make_export(spec) return os.path.join(export_root, rel_bug_dir) @@ -101,5 +100,23 @@ def detect(path): old_path = path path = os.path.dirname(path) +def precommit(directory): + pass +def commit(directory, summary, body=None): + if body is not None: + summary += '\n' + body + descriptor, filename = tempfile.mkstemp() + try: + temp_file = os.fdopen(descriptor, 'wb') + temp_file.write(summary) + temp_file.close() + try: + invoke_client('commit', '--unchanged', '--file', filename, + directory=directory) + finally: + os.unlink(filename) + +def postcommit(directory): + pass name = "bzr" diff --git a/libbe/names.py b/libbe/names.py index 19bc2a4..cbcfbf8 100644 --- a/libbe/names.py +++ b/libbe/names.py @@ -16,9 +16,14 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import commands import os +import sys + def uuid(): return commands.getoutput('uuidgen') def creator(): - return os.environ["LOGNAME"] + if sys.platform != "win32": + return os.environ["LOGNAME"] + else: + return os.environ["USERNAME"] diff --git a/libbe/rcs.py b/libbe/rcs.py index c0966f8..ac96734 100644 --- a/libbe/rcs.py +++ b/libbe/rcs.py @@ -14,6 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +from subprocess import Popen, PIPE def rcs_by_name(rcs_name): """Return the module for the RCS with the given name""" if rcs_name == "Arch": @@ -36,3 +37,18 @@ def detect(dir): return bzr import no_rcs return no_rcs + +class CommandError(Exception): + def __init__(self, err_str, status): + Exception.__init__(self, "Command failed (%d): %s" % (status, err_str)) + self.err_str = err_str + self.status = status + +def invoke(args, expect=(0,)): + q = Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE) + output = q.stdout.read() + error = q.stderr.read() + status = q.wait() + if status not in expect: + raise CommandError(error, status) + return status, output, error |