[Zope-CVS] CVS: CVSROOT - postcommit_actions:1.143

Fred L. Drake, Jr. fred@zope.com
Mon, 25 Nov 2002 16:14:31 -0500


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

Modified Files:
	postcommit_actions 
Log Message:
When checking whether a file in the repository has the "binary" mode
set, make sure we look for it in the right places:  If it only exists
on a branch, we have to look in the CVS Attic.


=== CVSROOT/postcommit_actions 1.142 => 1.143 ===
--- CVSROOT/postcommit_actions:1.142	Mon Nov 25 16:03:14 2002
+++ CVSROOT/postcommit_actions	Mon Nov 25 16:14:30 2002
@@ -353,7 +353,7 @@
         header = ("=== %s/%s %s => %s ==="
                   % (str(repo), str(file), old, new))
 
-    if expands_as_binary("%s/%s/%s,v" % (CVSROOT_ABS, repo, file)):
+    if expands_as_binary(get_rcs_filename(repo, file)):
         return "%s\n  <Binary-ish file>" % header
     else:
         total = len(lines)
@@ -369,6 +369,14 @@
             header = header + " (%s/%s lines abridged)" % (omitted, total)
         lines.insert(0, header + "\n")
         return string.join(lines, '')
+
+def get_rcs_filename(repodir, filename):
+    repofn = filename + ',v'
+    repodir = os.path.join(CVSROOT_ABS, repodir)
+    fn = os.path.join(repodir, repofn)
+    if not os.path.isfile(fn):
+        fn = os.path.join(repodir, "Attic", repofn)
+    return fn
 
 def do_special(trigger, action, addrs):
     """Do special action - a script, to be invoked from the CVSROOT dir.