]> thyrsus.com Git - src.git/commitdiff
Make sure ordinary commits still work!
authorEric S. Raymond <esr@thyrsus.com>
Wed, 12 Nov 2014 04:35:34 +0000 (23:35 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Wed, 12 Nov 2014 04:35:34 +0000 (23:35 -0500)
Regression test passes.

src
srctest

diff --git a/src b/src
index 06e389f1ef5097bc73d349067d837caf07224878..e631bb3f4647f5ee87d0effd780a19fb59b5752c 100755 (executable)
--- a/src
+++ b/src
@@ -473,7 +473,10 @@ class CommentContext:
 def commit_method(*args):
     "Commit changes to files."
     if not os.path.exists(repodir):
-        croak("repository subdirectory %s does not exist" % repodir)
+        try:
+            os.mkdir(repodir)
+        except OSError:
+            croak(" %s creation failed, check directory permissions." % repodir)
     args = list(args)
     comment = CommentContext("commit", args)
     ctx = CommandContext("commit", args, require_empty=True)
@@ -483,16 +486,11 @@ def commit_method(*args):
     comment.edit()
     for arg in ctx.args:
         if not os.path.exists(backend.master(arg)):
-            if not os.path.exists(repodir):
-                try:
-                    os.mkdir(repodir)
-                except OSError:
-                    croak(" %s creation failed, check directory permissions." % repodir)
             backend.add(arg)
-            with backend.lifter(arg):
-                backend.checkin(arg, comment.content())
-            if not quiet and len(args) > 1:
-                announce("%s -> %d" % (arg, len(History(arg))))
+        with backend.lifter(arg):
+            backend.checkin(arg, comment.content())
+        if not quiet and len(args) > 1:
+            announce("%s -> %d" % (arg, len(History(arg))))
 
 def amend_method(*args):
     "Amend comments in stored revisions."
diff --git a/srctest b/srctest
index 9f4e19b9ed77cace8ae6b8c9863bc0ff40f5b8f7..5eec9ceef04288d8551444680097865aaa344aa8 100755 (executable)
--- a/srctest
+++ b/srctest
@@ -210,10 +210,6 @@ EOF
 src $TESTOPTS ls | diff -u testfile16 -
 check "ls"
 
-src $TESTOPTS add testfile16
-src $TESTOPTS status testfile16 | grep "^A" >/dev/null
-check "A status check after registration"
-
 src $TESTOPTS commit -m "Another sample" testfile16
 src $TESTOPTS status testfile16 | grep "^[.]" >/dev/null
 check ". status check after first commit"