Added archive/project init code for `./test_usage.sh arch`.
authorW. Trevor King <wking@drexel.edu>
Sun, 23 Nov 2008 11:51:30 +0000 (06:51 -0500)
committerW. Trevor King <wking@drexel.edu>
Sun, 23 Nov 2008 11:51:30 +0000 (06:51 -0500)
Also some minor cleanups.

becommands/set_root.py
libbe/arch.py
libbe/comment.py
libbe/utility.py
test_usage.sh

index d8fcdf3c18e416bfcfdfb413a48be3480bd6efd9..a2d2d954a1a0241d3706b03d1aa9f4a8789bc468 100644 (file)
@@ -43,6 +43,7 @@ def execute(args):
     >>> execute([])
     Using Arch for revision control.
     Directory initialized.
+    >>> rcs.cleanup()
 
     >>> try:
     ...     execute(['.'])
index ba341e689b0a55f48622e98c7dcff48ec16e47cc..fd953a45238d403a50b7ce5771ebf1413ceab0a5 100644 (file)
@@ -69,7 +69,6 @@ class Arch(RCS):
         self._tmp_archive = True
         self._u_invoke_client("make-archive", self._archive_name,
                               self._archive_dir, directory=path)
-        self._u_invoke_client("archives")
     def _invoke_client(self, *args, **kwargs):
         """
         Invoke the client on our archive.
@@ -191,7 +190,6 @@ class Arch(RCS):
         self._project_name = project_name
     def _rcs_get_user_id(self):
         try:
-            self._u_invoke_client("archives")
             status,output,error = self._u_invoke_client('my-id')
             return output.rstrip('\n')
         except Exception, e:
@@ -202,13 +200,11 @@ class Arch(RCS):
     def _rcs_set_user_id(self, value):
         self._u_invoke_client('my-id', value)
     def _rcs_add(self, path):
-        self._u_invoke_client("archives")
         self._u_invoke_client("add-id", path)
         realpath = os.path.realpath(self._u_abspath(path))
         pathAdded = realpath in self._list_added(self.rootdir)
         if self.paranoid and not pathAdded:
             self._force_source(path)
-        self._u_invoke_client("archives")
     def _list_added(self, root):
         assert os.path.exists(root)
         assert os.access(root, os.X_OK)
@@ -252,9 +248,6 @@ class Arch(RCS):
     def _rcs_commit(self, commitfile):
         summary,body = self._u_parse_commitfile(commitfile)
         #status,output,error = self._invoke_client("make-log")
-        self._u_invoke_client("tree-root")
-        self._u_invoke_client("tree-version")
-        self._u_invoke_client("archives")
         if body == None:
             status,output,error \
                 = self._u_invoke_client("commit","--summary",summary)
index 95dade6000d28b5d3777b93a9475f045bdd9ac3e..0bfc12d1c16094c4821a7a098d1ac7707df90098 100644 (file)
@@ -218,7 +218,7 @@ class Comment(Tree):
 
     def add_reply(self, reply):
         if reply.time != None and self.time != None:
-            assert reply.time > self.time
+            assert reply.time >= self.time
         if self.uuid != INVALID_UUID:
             reply.in_reply_to = self.uuid
         self.append(reply)
index f156ce98fce8d47f3393141c7828bcd2ef58b943..3f69a9539d6889b411c8f5d535b949b62799a17f 100644 (file)
@@ -105,7 +105,6 @@ class Dir (object):
     def __del__(self):
         self.cleanup()
     def cleanup(self):
-        print "Removing", self.path
         self.shutil.rmtree(self.path)
     def __call__(self):
         return self.path
index bba21ee2738d03973a67bd836a889acf13328fd2..11be0d5272304bb1b2db28ad6e79a08d08a4ed9e 100755 (executable)
@@ -60,7 +60,22 @@ then
 elif [ "$RCS" == "arch" ]
 then
     ID=`tla my-id`
-    tla init-tree
+    ARCH_PARAM_DIR="$HOME/.arch-params"
+    ARCH_ARCHIVE_ROOT=`mktemp -d /tmp/BEtest.XXXXXXXXXX`
+    UNIQUE=`echo "$ARCH_ARCHIVE_ROOT" | sed 's/\/tmp\/BEtest.//;s/[0-9]//g'` 
+    ARCH_ARCHIVE="j@x.com--BE-test-usage-$UNIQUE"
+    ARCH_PROJECT="BE-test-usage--twig--99.5"
+    ARCH_ARCHIVE_DIR="$ARCH_ARCHIVE_ROOT/$ARCH_PROJECT"
+    echo "tla make-archive $ARCH_ARCHIVE $ARCH_ARCHIVE_DIR"
+    tla make-archive $ARCH_ARCHIVE $ARCH_ARCHIVE_DIR
+    echo "tla archive-setup -A $ARCH_ARCHIVE $ARCH_PROJECT"
+    tla archive-setup -A $ARCH_ARCHIVE $ARCH_PROJECT
+    echo "tla init-tree -A $ARCH_ARCHIVE $ARCH_PROJECT"
+    tla init-tree -A $ARCH_ARCHIVE $ARCH_PROJECT
+    echo "Adjusing the naming conventions to allow .files"
+    sed -i 's/^source .*/source ^[._=a-zA-X0-9].*$/' '{arch}/=tagging-method'
+    echo "tla import -A $ARCH_ARCHIVE --summary 'Began versioning'"
+    tla import -A $ARCH_ARCHIVE --summary 'Began versioning'
 elif [ "$RCS" == "none" ]
 then
     ID=`id -nu`
@@ -100,4 +115,11 @@ be remove $BUG # decide that you don't like that bug after all
 cd /
 rm -rf $TESTDIR
 
+if [ "$RCS" == "arch" ]
+then
+    # Cleanup everything outside of TESTDIR
+    rm -rf "$ARCH_ARCHIVE_ROOT"
+    rm -rf "$ARCH_PARAM_DIR/=locations/$ARCH_ARCHIVE"
+fi
+
 exec 2>&6 6>&- # restore stderr and close fd 6