[Zope3-checkins] CVS: Zope3/utilities/fssync - add.py:1.1.2.3 checkout.py:1.1.2.3 commit.py:1.1.2.3 common.py:1.1.2.3 diff.py:1.1.2.2 sync.py:1.1.2.4 update.py:1.1.2.3 usage.py:1.1.2.2

Guido van Rossum guido@python.org
Mon, 5 May 2003 11:22:52 -0400


Update of /cvs-repository/Zope3/utilities/fssync
In directory cvs.zope.org:/tmp/cvs-serv11291

Modified Files:
      Tag: fssync-branch
	add.py checkout.py commit.py common.py diff.py sync.py 
	update.py usage.py 
Log Message:
Whitespace normalization.

=== Zope3/utilities/fssync/add.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/utilities/fssync/add.py:1.1.2.2	Mon May  5 11:09:56 2003
+++ Zope3/utilities/fssync/add.py	Mon May  5 11:22:51 2003
@@ -2,14 +2,14 @@
 #
 # Copyright (c) 2001, 2002 Zope Corporation and Contributors.
 # All Rights Reserved.
-# 
+#
 # This software is subject to the provisions of the Zope Public License,
 # Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE.
-# 
+#
 ##############################################################################
 
 import string, os
@@ -32,7 +32,7 @@
         , siteconfpath
         , newobjecttype
         , newobjectname):
-    
+
     """Adds objects to File system
 
     Creates an object in the file system based on the object type
@@ -41,11 +41,11 @@
     fspath = os.path.abspath(fspath)
     if not os.path.isdir(fspath):
         return 'sync [add aborted] : %s is not a directory' %(fspath)
-    
+
     if not os.path.exists(os.path.join(fspath, '@@Zope')):
         return 'sync [add aborted] : @@Zope administrative folder not found in %s' \
                %(fspath)
-    
+
     objpath = getZODBPath(fspath)
     root = getApplicationRoot(dbpath, siteconfpath)
     container = getObject(objpath, root)
@@ -54,7 +54,7 @@
         fsroot = os.path.abspath(fspath[:string.find(fspath, objpath)])
         location = os.path.abspath(os.path.join(fsroot, path[1:]))
         fromFS(container, name, location, 'T')
-            
+
     container = getObject(objpath, root)
 
     adapter = getObjectAdapter(container)
@@ -146,7 +146,7 @@
                     ob = Folder()
                     toFS(ob, dir_list[sl_no][2], dir_list[sl_no][0], mode, dir_list[sl_no][1])
             toFS(newobject, objectname, newobjectpath, mode, objpath)
-            
+
     else:
         return 'Not a container type : %s' %(os.path.basename(fspath))
     return None
@@ -174,4 +174,3 @@
                 setPrint(' %s  \n %s \n\n' % (view, doc))
         except:
             pass
-   


=== Zope3/utilities/fssync/checkout.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/utilities/fssync/checkout.py:1.1.2.2	Mon May  5 11:09:56 2003
+++ Zope3/utilities/fssync/checkout.py	Mon May  5 11:22:51 2003
@@ -2,14 +2,14 @@
 #
 # Copyright (c) 2001, 2002 Zope Corporation and Contributors.
 # All Rights Reserved.
-# 
+#
 # This software is subject to the provisions of the Zope Public License,
 # Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE.
-# 
+#
 ##############################################################################
 
 import string, os
@@ -62,7 +62,7 @@
                          , type
                          , factory
                          , o_path)
-            
+
         fspath = sandbox_path
         toFS(main_ob, ob_name, fspath)
         return None


=== Zope3/utilities/fssync/commit.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/utilities/fssync/commit.py:1.1.2.2	Mon May  5 11:09:56 2003
+++ Zope3/utilities/fssync/commit.py	Mon May  5 11:22:51 2003
@@ -2,14 +2,14 @@
 #
 # Copyright (c) 2001, 2002 Zope Corporation and Contributors.
 # All Rights Reserved.
-# 
+#
 # This software is subject to the provisions of the Zope Public License,
 # Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE.
-# 
+#
 ##############################################################################
 
 import os, string, commands
@@ -85,7 +85,7 @@
                                                              , dir)
                     fmt_sandbox_path = os.sep + fmt_sandbox_path
                     fmt_original_path = os.sep + fmt_original_path
-                    
+
                     ob = getObject(zopedb_path, root)
                     zopedb_temp_file = createTempfile(ob, zopedb_path)
                     diff_cmd1 = """diff -q -b %s %s;echo $?""" \
@@ -111,10 +111,10 @@
                             if err is not None:
                                 return err
                             setPrint(msg)
-                    
+
                     if os.path.exists(zopedb_temp_file):
                         os.remove(zopedb_temp_file)
-                
+
     return None
 
 
@@ -123,7 +123,7 @@
     objpath = getZODBPath(fspath)
     objname = string.split(objpath, '/')[-1]
     path = string.split(objpath, '/')[:-1]
-        
+
     for item in path:
         if item:
             container = container +'[\''+item+'\']'
@@ -135,12 +135,12 @@
     except:
         return 'sync [commit aborted] : invalid object path ---  %s' \
                %(objpath)
-     
+
     #copying to ZODB
     fromFS(container, objname , os.path.dirname(fspath), mode)
     get_transaction().commit()
 
-    if mode is None: 
+    if mode is None:
         #copying to original
         f = open(fspath, 'r')
         data = f.read()
@@ -152,6 +152,4 @@
         f = open(original_path, 'w')
         f.write(string.strip(data))
         f.close()
-    return None    
-
-
+    return None


=== Zope3/utilities/fssync/common.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/utilities/fssync/common.py:1.1.2.2	Mon May  5 11:09:56 2003
+++ Zope3/utilities/fssync/common.py	Mon May  5 11:22:51 2003
@@ -2,14 +2,14 @@
 #
 # Copyright (c) 2001, 2002 Zope Corporation and Contributors.
 # All Rights Reserved.
-# 
+#
 # This software is subject to the provisions of the Zope Public License,
 # Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE.
-# 
+#
 ##############################################################################
 
 import os, tempfile, string
@@ -33,7 +33,7 @@
     syncService = getService(ob, 'FSRegistryService')
     adapter = syncService.getSynchronizer(ob)
     return adapter
-    
+
 def getApplicationRoot(dbpath
                        , siteconfpath):
     """Returns the application root.
@@ -68,14 +68,14 @@
                  , folders
                  , files):
     """Returns the entire tree of a ZODB object.
-    """    
+    """
     adapter = getObjectAdapter(ob)
     path = ''
     try:
         path = str(getPath(ob))
     except TypeError:
         pass
-    
+
     if IObjectFile.isImplementedBy(adapter):
         files.append(path)
     else:
@@ -115,8 +115,8 @@
         return 1
     else:
         return 0
-    
-def getObjectData(ob): 
+
+def getObjectData(ob):
     """Returns the data of a ZODB object.
     """
     adapter = adapter = getObjectAdapter(ob)
@@ -244,7 +244,7 @@
         isConflict = 1
     else:
         isConflict = 0
-    
+
     return isConflict
 
 


=== Zope3/utilities/fssync/diff.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/utilities/fssync/diff.py:1.1.2.1	Thu May  1 17:39:23 2003
+++ Zope3/utilities/fssync/diff.py	Mon May  5 11:22:51 2003
@@ -2,14 +2,14 @@
 #
 # Copyright (c) 2001, 2002 Zope Corporation and Contributors.
 # All Rights Reserved.
-# 
+#
 # This software is subject to the provisions of the Zope Public License,
 # Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE.
-# 
+#
 ##############################################################################
 
 from common import getObjectDataTempfile, setPrint
@@ -21,11 +21,11 @@
             , siteconfpath
             , diffoption=None):
     """Returns the difference between two files
-    
+
     Gets the diff between :
-        -- Current in Sandbox and Original of last sync   
-        -- Current in Sandbox and Current in ZODB          
-        -- Current in ZODB and Original of last sync.       
+        -- Current in Sandbox and Original of last sync
+        -- Current in Sandbox and Current in ZODB
+        -- Current in ZODB and Original of last sync.
     """
     temp_file = ''
     objectpath = ''
@@ -47,8 +47,8 @@
     if string.find(os.path.basename(targetfile), ' ')<>-1:
         targetfile = os.path.join(os.path.dirname(targetfile)
                                   , '\''+os.path.basename(targetfile)+'\'')
-        
-    if diffoption == '-1':       
+
+    if diffoption == '-1':
         from_file = os.path.join(os.path.dirname(targetfile)
                                  ,'@@Zope'
                                  ,'Original')
@@ -70,7 +70,7 @@
                                  ,'Original'
                                  ,os.path.basename(targetfile))
         to_file = temp_file
-     
+
     diff_cmd ="""diff -a -b -B -c %s %s""" \
                % (from_file,to_file)
     diff_res = commands.getoutput(diff_cmd)
@@ -79,7 +79,7 @@
                          , objectpath
                          , modification_date)
     setPrint(diff_res)
-    
+
     if temp_file:
         os.remove(temp_file)
 
@@ -138,4 +138,4 @@
             newline = newline + objectpath+'\t\t'+modification_date
             diff_res = string.replace(diff_res, changed_line, newline)
 
-    return "\n\n"+diff_res+"\n\n"
\ No newline at end of file
+    return "\n\n"+diff_res+"\n\n"


=== Zope3/utilities/fssync/sync.py 1.1.2.3 => 1.1.2.4 ===
--- Zope3/utilities/fssync/sync.py:1.1.2.3	Mon May  5 11:15:44 2003
+++ Zope3/utilities/fssync/sync.py	Mon May  5 11:22:51 2003
@@ -1,16 +1,16 @@
-#! /usr/bin/env python
+#!/usr/bin/env python
 ##############################################################################
 #
 # Copyright (c) 2001, 2002 Zope Corporation and Contributors.
 # All Rights Reserved.
-# 
+#
 # This software is subject to the provisions of the Zope Public License,
 # Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE.
-# 
+#
 ##############################################################################
 
 import sys, string, getopt, os, commands
@@ -52,7 +52,7 @@
                  , 'addtypes']
 
     err = ""
-    
+
     usage = USAGE % argv[0]
 
     try:
@@ -68,15 +68,15 @@
         diffoption = '-1'
         newobjectname = ''
         newobjecttype = ''
-        
+
         if env.has_key('SYNCROOT'): fspath = env['SYNCROOT']
         else: fspath = '.'
         if env.has_key('ZODBPATH'): dbpath = env['ZODBPATH']
         else: dbpath = '../../../Data.fs'
         if env.has_key('SITECONFPATH'): siteconfpath = env['SITECONFPATH']
         else: siteconfpath = '../../../site.zcml'
-        
-        if len(optlist) > 0  or len(args) > 0:            
+
+        if len(optlist) > 0  or len(args) > 0:
             for opt in optlist:
                 if (opt[0] == '-f') or (opt[0] == '--fspath'):
                     fspath = opt[1]
@@ -90,7 +90,7 @@
                     diffoption = opt[0]
                     targetfile = opt[1]
                 elif opt[0] == '-t':
-                      newobjecttype = opt[1]
+                    newobjecttype = opt[1]
 
             newobjectname = args[1:]
 
@@ -125,7 +125,7 @@
             else:
                 setPrint(usage)
                 sys.exit(1)
-                
+
         #Calls the specified operation
         err = operate(operation
                       , fspath
@@ -138,14 +138,14 @@
                       , newobjectname)
         if err is not None:
             raise err
-        
+
     except err:
         setPrint(err)
-        sys.exit(1)       
+        sys.exit(1)
+
+
 
-    
 
-    
 def operate(operation
             , fspath
             , dbpath
@@ -191,10 +191,9 @@
     elif operation == 'addtypes':
         err = addTypes(dbpath
                        , siteconfpath)
-        
+
     return err
 
-    
+
 # If called from the command line
 if __name__=='__main__': main(sys.argv)
-


=== Zope3/utilities/fssync/update.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/utilities/fssync/update.py:1.1.2.2	Mon May  5 11:09:56 2003
+++ Zope3/utilities/fssync/update.py	Mon May  5 11:22:51 2003
@@ -2,14 +2,14 @@
 #
 # Copyright (c) 2001, 2002 Zope Corporation and Contributors.
 # All Rights Reserved.
-# 
+#
 # This software is subject to the provisions of the Zope Public License,
 # Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE.
-# 
+#
 ##############################################################################
 
 import string, os, commands
@@ -63,7 +63,7 @@
     mappings = {}
     mapping_paths = {}
     mapping_paths.update(traverseFS(fspath, mapping_paths))
-    
+
     for sandbox_path in mapping_paths.keys():
         original_path = string.strip(mapping_paths[sandbox_path][0])
         zopedb_path = string.strip(mapping_paths[sandbox_path][1])
@@ -88,7 +88,7 @@
                         fmt_original_path = os.path.join(fmt_original_path, dir)
                 fmt_sandbox_path = os.sep + fmt_sandbox_path
                 fmt_original_path = os.sep + fmt_original_path
-                    
+
                 ob = getObject(zopedb_path, root)
                 zopedb_temp_file = createTempfile(ob, zopedb_path)
                 diff3_cmd = """diff3 -a %s %s %s""" %(fmt_sandbox_path
@@ -126,7 +126,7 @@
                                  , ob
                                  , zopedb_path
                                  , sandbox_path)
-                            
+
                 if os.path.exists(zopedb_temp_file):
                     os.remove(zopedb_temp_file)
 
@@ -137,8 +137,8 @@
               , root
               , objectroot
               , fsroot)
-        
-    
+
+
 
 def doUpdate(mode
              , ob
@@ -154,7 +154,3 @@
     elif mode=='C':
         if ob is not None:
             toFS(ob, ob_name, sandbox_path, mode)
-
-
-
-


=== Zope3/utilities/fssync/usage.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/utilities/fssync/usage.py:1.1.2.1	Thu May  1 17:39:23 2003
+++ Zope3/utilities/fssync/usage.py	Mon May  5 11:22:51 2003
@@ -2,225 +2,230 @@
 #
 # Copyright (c) 2001, 2002 Zope Corporation and Contributors.
 # All Rights Reserved.
-# 
+#
 # This software is subject to the provisions of the Zope Public License,
 # Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE.
-# 
+#
 ##############################################################################
 
 USAGE="""
 
-    Usage: %s [options] operation
+Usage: %s [options] operation
 
-    The available options are:
+The available options are:
 
-    -f / --fspath=
-    Set the file system path where the object is to be dumped.
-    Is used with all the operation.
+-f / --fspath=
+Set the file system path where the object is to be dumped.
+Is used with all the operation.
+
+-o / --objpath=
+Looks up for the Object in the specified path in the ZODB.
+Is used with checkout operation.
+
+-d / --dbpath=
+The path of ZODB.
+Is used with all the operation.
+
+-s / --siteconfpath=
+The path for site.zcml.
+Is used with all the operation.
+
+-t / --type=
+The type of object to be added to the file system.
+Is used with add operation.
+
+OPERATION
+----------------------------------------------------------------------------
+checkout --- checks out ZODB object in File-system
+             example:
+                $python sync.py -f /home/user/sandbox
+                                -d /zope3/data.fs
+                                -s /zope3/site.zcml
+                                -o /foo/bar
+                                checkout
+                  'or'
+
+                $python sync.py --fspath=/home/user/sandbox
+                                   --dbpath=/zope3/data.fs
+                                   --siteconfpath=/zope3/site.zcml
+                                   --objpath=/foo/bar
+                                   checkout
+
+                This will download the "bar" folder along with it's contents
+                into the /home/user/sandbox folder. In case if the "bar" module
+                already exist in the sandbox it will be overwritten.
+                Checkout generates the following output:
+                UPDATING foldername
+                U foldername/filename
+
+
+update   --- updates the sandbox
+             example:
+                $python sync.py -f /home/user/sandbox/bar
+                                -d /zope3/data.fs
+                                -s /zope3/site.zcml
+                                update
+                  'or'
+
+                $python sync.py --fspath=/home/user/sandbox/bar
+                                --dbpath=/zope3/data.fs
+                                --siteconfpath=/zope3/site.zcml
+                                update
+
+                This will update the contents of "bar" directory in
+                the sandbox.
+
+                An update can undergo various cases like :
+
+                Case1 : When the contents of all the three Sandbox, Original
+                        and ZODB for an object is same an update command won't
+                        do any changes.
+
+                Case2 : When the contents of the Sandbox and Original are same
+                        but ZODB is different, an update command will overwrite
+                        Sandbox and Original from ZODB and print the following:
+                        U /path/filename.
+
+                Case3 : When the contents of the Original and ZODB are same and
+                        the Sandbox is different an update command won't do any
+                        changes and print the following:
+                        M /path/filename.
+                        If the Sandbox contains conflict data the following is
+                        printed:
+                        C /path/filename.
+
+                Case4 : This is a very unlikely case. When the contents of the
+                        Sandbox and ZODB are same but the Original is different
+                        an update command will overwrite the Original with the
+                        ZODB and print the following:
+                        U /path/filename.
+
+                Case5 : When the contents of all the three Sandbox, Original
+                        and ZODB are different, an update command will mearge
+                        all the changes into the Sandbox and the Original is
+                        overwitten by the ZODB and the following is printed:
+                        Merging changes in /path/filename
+                        In case of a conflict the conflict data is copied into
+                        the Sandbox and the Original is overwitten by the ZODB
+                        and the following is printed:
+                        C Merging changes in /path/filename
+
+                Conventionaly an update has to be done on the sandbox before
+                running commit.
+
+commit   --- A commit command copies data from the File-system samdbox
+             into the ZODB
+             example:
+                $python sync.py -f /home/user/sandbox/bar
+                                -d /zope3/data.fs
+                                -s /zope3/site.zcml
+                                commit
+                  'or'
+
+                $python sync.py --fspath=/home/user/sandbox/bar
+                                --dbpath=/zope3/data.fs
+                                --siteconfpath=/zope3/site.zcml
+                                commit
+
+             Commit copies the Sandbox into Original and ZODB, if the ZODB
+             and Original are same or there is no conflict data in the Sandbox
+             and prints the following:
+             /path/filename  <-- filename
+             If the ZODB and Original are not same or the Sandbox
+             contains conflict data a commit command won't do anything
+             and will print the following:
+             /path/filename Conflict, Uptodate checkin failed.
+
+
+fcommit  --- This is a force commit. A fcommit command will forcefully
+             copy Sandbox
+             into Original and ZODB regardless of any constraints.
+             example:
+                $python sync.py -f /home/user/sandbox/bar
+                                -d /zope3/data.fs
+                                -s /zope3/site.zcml
+                                fcommit
+                  'or'
+
+                $python sync.py --fspath=/home/user/sandbox/bar
+                                --dbpath=/zope3/data.fs
+                                --siteconfpath=/zope3/site.zcml
+                                fcommit
+
+
+diff     --- Difference between Three versions of an object
+
+            -1 -- Sandbox and Original
+            -2 -- Sandbox and ZODB
+            -3 -- ZODB and Original
+
+            A diff command will produce the difference of two objects
+            in context output format.
+            example:
+                $python sync.py -2 /home/user/sandbox/bar
+                                -d /zope3/data.fs
+                                -s /zope3/site.zcml
+                                diff
+                  'or'
+
+                $python sync.py -2 /home/user/sandbox/bar
+                                --dbpath=/zope3/data.fs
+                                --siteconfpath=/zope3/site.zcml
+                                diff
+            Default option is -1
 
-    -o / --objpath=
-    Looks up for the Object in the specified path in the ZODB.
-    Is used with checkout operation.
 
-    -d / --dbpath=
-    The path of ZODB.
-    Is used with all the operation.
-
-    -s / --siteconfpath=
-    The path for site.zcml.
-    Is used with all the operation.
-
-    -t / --type=
-    The type of object to be added to the file system.
-    Is used with add operation.
-
-    OPERATION
-    ----------------------------------------------------------------------------
-    checkout --- checks out ZODB object in File-system
+addtypes --- Displays all the list of types that can be added to the ZODB
+                 from the filesystem.
                  example:
-                    $python sync.py -f /home/user/sandbox
-                                    -d /zope3/data.fs
-                                    -s /zope3/site.zcml
-                                    -o /foo/bar
-                                    checkout
-                      'or'
-
-                    $python sync.py --fspath=/home/user/sandbox
-                                       --dbpath=/zope3/data.fs
-                                       --siteconfpath=/zope3/site.zcml
-                                       --objpath=/foo/bar
-                                       checkout
-                    
-                    This will download the "bar" folder along with it's contents
-                    into the /home/user/sandbox folder. In case if the "bar" module
-                    already exist in the sandbox it will be overwritten.
-                    Checkout generates the following output:
-                    UPDATING foldername
-                    U foldername/filename
-                    
+                 $python sync.py addtypes
 
-    update   --- updates the sandbox
-                 example:
-                    $python sync.py -f /home/user/sandbox/bar
-                                    -d /zope3/data.fs
-                                    -s /zope3/site.zcml
-                                    update
-                      'or'
-
-                    $python sync.py --fspath=/home/user/sandbox/bar
-                                    --dbpath=/zope3/data.fs
-                                    --siteconfpath=/zope3/site.zcml
-                                    update
-
-                    This will update the contents of "bar" directory in the sandbox.
-                    An update can undergo various cases like :
-
-                    Case1 : When the contents of all the three Sandbox, Original
-                            and ZODB for an object is same an update command won't
-                            do any changes.
-
-                    Case2 : When the contents of the Sandbox and Original are same
-                            but ZODB is different, an update command will overwrite
-                            Sandbox and Original from ZODB and print the following:
-                            U /path/filename.
-
-                    Case3 : When the contents of the Original and ZODB are same and
-                            the Sandbox is different an update command won't do any
-                            changes and print the following:
-                            M /path/filename.
-                            If the Sandbox contains conflict data the following is
-                            printed:
-                            C /path/filename.
-
-                    Case4 : This is a very unlikely case. When the contents of the
-                            Sandbox and ZODB are same but the Original is different
-                            an update command will overwrite the Original with the
-                            ZODB and print the following:
-                            U /path/filename.
-
-                    Case5 : When the contents of all the three Sandbox, Original
-                            and ZODB are different, an update command will mearge
-                            all the changes into the Sandbox and the Original is
-                            overwitten by the ZODB and the following is printed:
-                            Merging changes in /path/filename
-                            In case of a conflict the conflict data is copied into
-                            the Sandbox and the Original is overwitten by the ZODB
-                            and the following is printed:
-                            C Merging changes in /path/filename
-                            
-                    Conventionaly an update has to be done on the sandbox before
-                    running commit.
-    
-    commit   --- A commit command copies data from the File-system samdbox into the ZODB
-                 example:
-                    $python sync.py -f /home/user/sandbox/bar
-                                    -d /zope3/data.fs
-                                    -s /zope3/site.zcml
-                                    commit
-                      'or'
-
-                    $python sync.py --fspath=/home/user/sandbox/bar
-                                    --dbpath=/zope3/data.fs
-                                    --siteconfpath=/zope3/site.zcml
-                                    commit
-
-                 Commit copies the Sandbox into Original and ZODB, if the ZODB
-                 and Original are same or there is no conflict data in the Sandbox
-                 and prints the following:
-                 /path/filename  <-- filename
-                 If the ZODB and Original are not same or the Sandbox contains conflict
-                 data a commit command won't do anything and will print the following:
-                 /path/filename Conflict, Uptodate checkin failed.
 
+add      --- Adds objects to file system and saves it to the ZODB on
+             commit.
+             This command will give a list of all the available types
+             that can be added.
+             example:
+                 $python sync.py -f /home/user/sandbox/bar
+                                 -d /zope3/data.fs
+                                 -s /zope3/site.zcml
+                                 -t file
+                                 add file1.html file2.txt file3.xyz
+                    'or'
+
+                $python sync.py --fspath=/home/user/sandbox/bar
+                                --dbpath=/zope3/data.fs
+                                --siteconfpath=/zope3/site.zcml
+                                --type=file
+                                add file1.html file2.txt file3.xyz
+
+            This command will add file1.html, file2.txt, file3.xyz in
+            the bar folder of the sandbox and on commit this will be
+            checked in as file type objects in ZODB.
+            If type is not specified with -t option then the types will
+            be checked based on file extensions and only the valid type
+            will be added to the sandbox.
+            File/Folder names with spaces has to be enclosed withing quotes.
+
+
+ENVIRONMENT VARIABLES
+----------------------------------------------------------------------------
+
+SYNCROOT     --- Path for the File-system folder where the ZODB object
+                 has to be checked out.If not set it takes the default
+                 directory. Or can be specified with the --fspath or -f
+                 option
+
+ZODBPATH     --- Path where the Data.fs file exist in the File-system.
+                 if not set it takes the default is ../../Data.fs.
+                 Or can be specified with the --dbpath or -d option.
+
+SITECONFPATH --- Path for the site.zcml file.if not set it takes the
+                 default is ../../site.zcml. Or can be specified with
+                 the --siteconfpath or -s option.
 
-    fcommit  --- This is a force commit. A fcommit command will forcefully copy Sandbox
-                 into Original and ZODB regardless of any constraints.
-                 example:
-                    $python sync.py -f /home/user/sandbox/bar
-                                    -d /zope3/data.fs
-                                    -s /zope3/site.zcml
-                                    fcommit
-                      'or'
-
-                    $python sync.py --fspath=/home/user/sandbox/bar
-                                    --dbpath=/zope3/data.fs
-                                    --siteconfpath=/zope3/site.zcml
-                                    fcommit
-                 
-
-    diff     --- Difference between Three versions of an object
-    
-                -1 -- Sandbox and Original
-                -2 -- Sandbox and ZODB
-                -3 -- ZODB and Original
-
-                A diff command will produce the difference of two objects
-                in context output format.
-                example:
-                    $python sync.py -2 /home/user/sandbox/bar
-                                    -d /zope3/data.fs
-                                    -s /zope3/site.zcml
-                                    diff
-                      'or'
-
-                    $python sync.py -2 /home/user/sandbox/bar
-                                    --dbpath=/zope3/data.fs
-                                    --siteconfpath=/zope3/site.zcml
-                                    diff
-                Default option is -1
-
-                
-    addtypes --- Displays all the list of types that can be added to the ZODB
-                     from the filesystem.
-                     example:
-                     $python sync.py addtypes
-
-                     
-    add      --- Adds objects to file system and saves it to the ZODB on
-                 commit.
-                 This command will give a list of all the available types
-                 that can be added.
-                 example:
-                     $python sync.py -f /home/user/sandbox/bar
-                                     -d /zope3/data.fs
-                                     -s /zope3/site.zcml 
-                                     -t file
-                                     add file1.html file2.txt file3.xyz
-                        'or'
-                    
-                    $python sync.py --fspath=/home/user/sandbox/bar
-                                    --dbpath=/zope3/data.fs
-                                    --siteconfpath=/zope3/site.zcml
-                                    --type=file
-                                    add file1.html file2.txt file3.xyz
-
-                This command will add file1.html, file2.txt, file3.xyz in
-                the bar folder of the sandbox and on commit this will be
-                checked in as file type objects in ZODB.
-                If type is not specified with -t option then the types will
-                be checked based on file extensions and only the valid type
-                will be added to the sandbox.
-                File/Folder names with spaces has to be enclosed withing quotes.
-                
-    
-    ENVIRONMENT VARIABLES
-    ----------------------------------------------------------------------------
-
-    SYNCROOT     --- Path for the File-system folder where the ZODB object
-                     has to be checked out.If not set it takes the default
-                     directory. Or can be specified with the --fspath or -f
-                     option
-
-    ZODBPATH     --- Path where the Data.fs file exist in the File-system.
-                     if not set it takes the default is ../../Data.fs.
-                     Or can be specified with the --dbpath or -d option.
-
-    SITECONFPATH --- Path for the site.zcml file.if not set it takes the
-                     default is ../../site.zcml. Or can be specified with
-                     the --siteconfpath or -s option.
-  
-"""
\ No newline at end of file
+"""