[Zope3-checkins] CVS: Zope3/src/zope/fssync - merger.py:1.12
Fred L. Drake, Jr.
fred at zope.com
Wed Aug 6 17:11:06 EDT 2003
Update of /cvs-repository/Zope3/src/zope/fssync
In directory cvs.zope.org:/tmp/cvs-serv10728
Modified Files:
merger.py
Log Message:
- update doc strings
- add/clarify comments
=== Zope3/src/zope/fssync/merger.py 1.11 => 1.12 ===
--- Zope3/src/zope/fssync/merger.py:1.11 Thu May 29 11:07:29 2003
+++ Zope3/src/zope/fssync/merger.py Wed Aug 6 16:11:01 2003
@@ -118,14 +118,14 @@
return self.metadata.getentry(file)
def merge_files(self, local, original, remote, action, state):
- """Helper to carry out a file merge.
+ """Merge files.
The action and state arguments correspond to the return value
- of classify().
+ of classify_files().
Return the state as returned by the second return value of
- classify(). This is either the argument state or recalculated
- based upon the effect of the action.
+ classify_files(). This is either the argument state or
+ recalculated based upon the effect of the action.
"""
method = getattr(self, "merge_files_" + action.lower())
return method(local, original, remote) or state
@@ -155,6 +155,7 @@
origfile = original
else:
origfile = "/dev/null"
+ # commands.mkarg() is undocumented; maybe use fssync.quote()
cmd = "diff3 -m -E %s %s %s" % (commands.mkarg(local),
commands.mkarg(origfile),
commands.mkarg(remote))
@@ -182,6 +183,7 @@
shutil.copy(remote, original)
self.clearflag(local)
self.getentry(local).update(self.getentry(remote))
+ return None
def clearflag(self, file):
"""Helper to clear the added/removed metadata flag."""
@@ -190,7 +192,7 @@
del metadata["flag"]
def classify_files(self, local, original, remote):
- """Helper for merge to classify file changes.
+ """Classify file changes.
Arguments are pathnames to the local, original, and remote
copies.
@@ -216,6 +218,7 @@
return ("Nothing", "Spurious")
else:
# Why are we here?
+ # classify_files() should not have been called in this case.
return ("Nothing", "Nonexistent")
if lmeta.get("flag") == "added":
@@ -228,6 +231,7 @@
if self.cmpfile(local, remote):
return ("Fix", "Uptodate")
else:
+ # CVS would say "move local file out of the way"
return ("Merge", "Modified")
if rmeta and not lmeta:
@@ -268,7 +272,7 @@
# Only local changes
return ("Nothing", "Modified")
else:
- # Some local changes; classify local changes
+ # Some remote changes; classify local changes
if self.cmpfile(local, original):
# Only remote changes
return ("Copy", "Uptodate")
More information about the Zope3-Checkins
mailing list