aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/bugdir.py
diff options
context:
space:
mode:
authorAaron Bentley <abentley@panoramicfeedback.com>2005-03-09 22:08:45 +0000
committerAaron Bentley <abentley@panoramicfeedback.com>2005-03-09 22:08:45 +0000
commit18b5752e6b696b8ef7839c3e8b8e0373e49b75bd (patch)
tree6bf7b97e63f13b18ce35f9c2ff0353e869096fc1 /libbe/bugdir.py
parent079b9a6c710755e21a0d05132e305ee89fb89863 (diff)
downloadbugseverywhere-18b5752e6b696b8ef7839c3e8b8e0373e49b75bd.tar.gz
Added RCS integration
Diffstat (limited to 'libbe/bugdir.py')
-rw-r--r--libbe/bugdir.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/libbe/bugdir.py b/libbe/bugdir.py
index 7fc1eda..fd7b0f6 100644
--- a/libbe/bugdir.py
+++ b/libbe/bugdir.py
@@ -3,6 +3,7 @@ import os.path
import cmdutil
import errno
import names
+import rcs
class NoBugDir(cmdutil.UserError):
def __init__(self, path):
@@ -28,10 +29,11 @@ def test_version(path):
def create_bug_dir(path):
root = os.path.join(path, ".be")
- os.mkdir(root)
- os.mkdir(os.path.join(root, "bugs"))
- f = file(os.path.join(root, "version"), "wb")
- f.write("Bugs Everywhere Tree 0 0\n")
+ rcs.mkdir(root)
+ rcs.mkdir(os.path.join(root, "bugs"))
+ rcs.set_file_contents(os.path.join(root, "version"),
+ "Bugs Everywhere Tree 0 0\n")
+
return BugDir(path)
class BugDir:
@@ -49,7 +51,7 @@ class BugDir:
def new_bug(self):
uuid = names.uuid()
path = os.path.join(self.bugs_path, uuid)
- os.mkdir(path)
+ rcs.mkdir(path)
return Bug(self.bugs_path, uuid)
@@ -101,6 +103,6 @@ class Bug(object):
def _set_value(self, name, value):
if value is None:
- os.unlink(self.get_path(name))
- file(self.get_path(name), "wb").write("%s\n" % value)
+ rcs.unlink(self.get_path(name))
+ rcs.set_file_contents(self.get_path(name), "%s\n" % value)