[Zope3-checkins] CVS: Zope3/src/zope/fssync - fsmerger.py:1.16

Fred L. Drake, Jr. fred at zope.com
Thu Aug 28 12:38:47 EDT 2003


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

Modified Files:
	fsmerger.py 
Log Message:
- improve the default ignore() filter
- use the ignore() filter for directories as well as files
- normalize whitespace


=== Zope3/src/zope/fssync/fsmerger.py 1.15 => 1.16 ===
--- Zope3/src/zope/fssync/fsmerger.py:1.15	Sun Aug 17 02:08:56 2003
+++ Zope3/src/zope/fssync/fsmerger.py	Thu Aug 28 11:38:47 2003
@@ -2,14 +2,14 @@
 #
 # Copyright (c) 2003 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.
-# 
+#
 ##############################################################################
 """Higher-level three-way file and directory merger.
 
@@ -19,7 +19,7 @@
 import os
 import shutil
 
-from os.path import exists, isfile, isdir, join
+from os.path import basename, exists, isfile, isdir, join
 from os.path import realpath, normcase, normpath
 
 from zope.xmlpickle import dumps
@@ -254,6 +254,8 @@
         This adds a separator (e.g. '/') to the end of the pathname to
         signal that it is a directory.
         """
+        if letter == "?" and self.ignore(localdir):
+            letter = "*"
         self.reporter("%s %s" % (letter, join(localdir, "")))
 
     def reportaction(self, action, state, local):
@@ -297,4 +299,6 @@
     def ignore(self, path):
         # XXX This should have a larger set of default patterns to
         # ignore, and honor .cvsignore
-        return path.endswith("~")
+        fn = basename(path)
+        return (fn.endswith("~")
+                or fn in (".cvsignore", "CVS", "RCS", "SCCS", ".svn"))




More information about the Zope3-Checkins mailing list