aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/arch.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2008-11-22 19:45:37 -0500
committerW. Trevor King <wking@drexel.edu>2008-11-22 19:45:37 -0500
commit4a626e67b3f401b8e242a55571a802147123a196 (patch)
treee5907e6e16e9110a092d723e43f34571a4cac378 /libbe/arch.py
parent9524d061aa93451a282f45150944878d6b5cf065 (diff)
downloadbugseverywhere-4a626e67b3f401b8e242a55571a802147123a196.tar.gz
Explicit rcs.cleanup() in bugdir test.
Don't use del(rcs), because if there was an error, there is still a reference to rcs in the traceback, so it is never cleaned up. This can leave the external archive cluttering up your Arch install if you're using the Arch backend. See the __del__ documentation http://python.active-venture.com/ref/customization.html#l2h-175 for details. Also fixed some out-of-date method names in libbe.diff
Diffstat (limited to 'libbe/arch.py')
-rw-r--r--libbe/arch.py19
1 files changed, 6 insertions, 13 deletions
diff --git a/libbe/arch.py b/libbe/arch.py
index 6415cef..ba341e6 100644
--- a/libbe/arch.py
+++ b/libbe/arch.py
@@ -21,9 +21,6 @@ import re
import unittest
import doctest
-import traceback
-import sys
-
import config
from beuuid import uuid_gen
from rcs import RCS, RCStestCase, CommandError
@@ -58,10 +55,6 @@ class Arch(RCS):
self._create_archive(path)
self._create_project(path)
self._add_project_code(path)
- #print "RCSid:", id(self), "init", self._archive_project_name()
- #print "BEGIN_TRACE"
- #traceback.print_stack(file=sys.stdout)
- #print "END_TRACE"
def _create_archive(self, path):
# Create a new archive
# http://regexps.srparish.net/tutorial-tla/new-archive.html#Creating_a_New_Archive
@@ -102,6 +95,11 @@ class Arch(RCS):
self._archive_dir = False
self._archive_name = False
def _create_project(self, path):
+ """
+ Create a temporary Arch project in the directory PATH. This
+ project will be removed by
+ __del__->cleanup->_rcs_cleanup->_remove_project
+ """
# http://mwolson.org/projects/GettingStartedWithArch.html
# http://regexps.srparish.net/tutorial-tla/new-project.html#Starting_a_New_Project
category = "bugs-everywhere"
@@ -110,6 +108,7 @@ class Arch(RCS):
self._project_name = "%s--%s--%s" % (category, branch, version)
self._invoke_client("archive-setup", self._project_name,
directory=path)
+ self._tmp_project = True
def _remove_project(self):
assert self._tmp_project == True
assert self._project_name != None
@@ -153,16 +152,11 @@ class Arch(RCS):
self._invoke_client("import", "--summary", "Began versioning",
directory=path)
def _rcs_cleanup(self):
- #print "RCSid:", id(self), "cleaned", self._archive_project_name()
- #print "BEGIN_TRACE"
- #traceback.print_stack(file=sys.stdout)
- #print "END_TRACE"
if self._tmp_project == True:
self._remove_project()
if self._tmp_archive == True:
self._remove_archive()
-
def _rcs_root(self, path):
if not os.path.isdir(path):
dirname = os.path.dirname(path)
@@ -195,7 +189,6 @@ class Arch(RCS):
archive_name,project_name = output.rstrip('\n').split('/')
self._archive_name = archive_name
self._project_name = project_name
-
def _rcs_get_user_id(self):
try:
self._u_invoke_client("archives")