[Digicool-CVS] CVS: CVSROOT - postcommit_actions:1.108

klm@cvs.baymountain.com klm@cvs.baymountain.com
Mon, 23 Jul 2001 12:09:56 -0400


Update of /cvs-repository/CVSROOT
In directory cvs.zope.org:/tmp/cvs-serv22407

Modified Files:
	postcommit_actions 
Log Message:
do_mail(): Correct debugging in diff loop so we accumulate entries for
multiple files.

do_diff(): Adapt handling of new files for remote-checkin situation -
we collect the contents of the new file from a "checkout" on stdout.

 [debug - name:CVSROOT, repo:CVSROOT, fn:postcommit_actions
====== Updated CVSROOT/postcommit_actions, 1.107 => 1.108 ======
                            % (fn, name))
             else:
-                diff_msg = ('[debug - name:%s, repo:%s, fn:%s\n'
-                            % (name, repo, fn))
+                diff_msg = (diff_msg
+                            + ('[debug - name:%s, repo:%s, fn:%s\n'
+                               % (name, repo, fn)))
                 new_msg = create_diff(name, repo, fn, old, new)
 
             diff_msg = diff_msg + new_msg + '\n'
@@ -425,14 +426,11 @@
     """ Create a diff comparing old and new versions """
     if old == 'NONE':   # A new file was added
         try:
-            if os.path.exists(file):
-                file_handle = open(file)
-            else:
-                update_cmd = 'cvs -fn update -r %s -p %s' % (new, file)
-                file_handle = os.popen(update_cmd)
-
-            lines = file_handle.readlines()
-            file_handle.close()
+            # "Checkout" to stdout, so we can collect the lines to return.
+            co_stdout_cmd = 'cvs -fn co -p %s/%s' % (repo, file)
+            handle = os.popen(co_stdout_cmd)
+            lines = handle.readlines()
+            handle.close()
             insert_str = ('--- Added File ' + str(file)
                           + ' in package ' + str(name)
                           + ' ---\n')