[Zope3-checkins] CVS: Zope3/src/zope/fssync - fssync.py:1.37 main.py:1.26 zsync.txt:1.8

Fred L. Drake, Jr. fred at zope.com
Fri Aug 8 11:36:53 EDT 2003


Update of /cvs-repository/Zope3/src/zope/fssync
In directory cvs.zope.org:/tmp/cvs-serv801

Modified Files:
	fssync.py main.py zsync.txt 
Log Message:
implement a "zsync mkdir" command, similar to "svn mkdir"

=== Zope3/src/zope/fssync/fssync.py 1.36 => 1.37 ===
--- Zope3/src/zope/fssync/fssync.py:1.36	Thu Aug  7 18:08:39 2003
+++ Zope3/src/zope/fssync/fssync.py	Fri Aug  8 10:36:47 2003
@@ -510,6 +510,24 @@
         else:
             print "A", path
 
+    def mkdir(self, path):
+        dir, name = split(path)
+        if dir:
+            if not exists(dir):
+                raise Error("directory %r does not exist" % dir)
+            if not isdir(dir):
+                raise Error("%r is not a directory" % dir)
+        else:
+            dir = os.curdir
+        if exists(path):
+            raise Error("%r already exists" % path)
+        os.mkdir(path)
+        mdmanager = self.metadata.getmanager(dir)
+        entry = mdmanager.getentry(name)
+        entry["flag"] = "added"
+        mdmanager.flush()
+        print "A", path
+
     def remove(self, path):
         if exists(path):
             raise Error("'%s' still exists", path)


=== Zope3/src/zope/fssync/main.py 1.25 => 1.26 ===
--- Zope3/src/zope/fssync/main.py:1.25	Thu Aug  7 18:08:39 2003
+++ Zope3/src/zope/fssync/main.py	Fri Aug  8 10:36:47 2003
@@ -323,6 +323,13 @@
     fs = FSSync()
     fs.multiple(args, fs.revert)
 
+def mkdir(opts, args):
+    """%(program)s revert [TARGET ...]
+
+    """
+    fs = FSSync()
+    fs.multiple(args, fs.mkdir)
+
 def extract_message(opts, cmd):
     L = []
     message = None
@@ -361,6 +368,7 @@
     "checkin":  ("F:m:", ["file=", "message="], checkin),
     "ci":       ("F:m:", ["file=", "message="], checkin),
     "revert":   ("", [], revert),
+    "mkdir":    ("", [], mkdir),
     }
 
 if __name__ == "__main__":


=== Zope3/src/zope/fssync/zsync.txt 1.7 => 1.8 ===
--- Zope3/src/zope/fssync/zsync.txt:1.7	Thu Aug  7 18:08:39 2003
+++ Zope3/src/zope/fssync/zsync.txt	Fri Aug  8 10:36:47 2003
@@ -52,6 +52,11 @@
   not made to the object database itself until the next **zsync
   commit**.
 
+**mkdir**
+  Create new directories and schedule them for addition.  The
+  additions are not made to the object database itself until the next
+  **zsync commit**.
+
 **remove** (rm)
   Mark an object for removal from the object database.  The change is
   not made to the object database itself until the next **zsync
@@ -242,6 +247,23 @@
   Use the unified output format, showing *NUM* (an integer) lines of
   context, or three if *NUM* is not given.  For proper operation,
   **patch** typically needs at least two lines of context.
+
+
+The **zsync mkdir** Command
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Synopsis
+++++++++
+
+**mkdir** *path* ...
+
+Description
++++++++++++
+
+Create one or more directories and schedule them for addition.  The
+additions are not made to the object database itself until the next
+**zsync commit**.  Reverting these additions with **zsync revert**
+will not cause the directories themselves to be removed.
 
 
 The **zsync remove** Command




More information about the Zope3-Checkins mailing list