]> thyrsus.com Git - src.git/commitdiff
Always check fir exisrence of repo directory.
authorEric S. Raymond <esr@thyrsus.com>
Fri, 7 Nov 2014 21:15:24 +0000 (16:15 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Fri, 7 Nov 2014 21:15:24 +0000 (16:15 -0500)
src

diff --git a/src b/src
index b3170cff1e74c491e5448b73de46d76f2de332bc..1e856c7e30bf3d3f70becd6241d01cc477410fca 100755 (executable)
--- a/src
+++ b/src
@@ -312,6 +312,8 @@ def init_method(*args):
 
 def preamble(cmd, args):
     "Common setup code."
+    if not os.path.exists(repodir):
+        croak("repository subdirectory %s does not exist" % repodir)
     args = list(args)
     revspec = None
     if args:
@@ -384,6 +386,8 @@ class lifted:
 
 def commit_method(*args):
     "Commit changes to files."
+    if not os.path.exists(repodir):
+        croak("repository subdirectory %s does not exist" % repodir)
     args = list(args)
     comment = None
     if args[0] == '--':
@@ -556,6 +560,8 @@ def set_tags(args):
 
 def tag_method(*args):
     "Inspect, create, and delete tags."
+    if not os.path.exists(repodir):
+        croak("repository subdirectory %s does not exist" % repodir)
     args = list(args)
     if not args:
         list_tags()
@@ -616,7 +622,6 @@ def fast_export_method(*args):
                 sys.stdout.write("data %s\n%s" % (len(item.log), item.log))
                 if last_commit_mark:
                     sys.stdout.write("from :%d\n" % last_commit_mark)
-                # FIXME: Process executable bit
                 sys.stdout.write("M %s :%d '%s'\n\n" % (perms, mark, arg))
                 last_commit_mark = mark
                 mark += 1