subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1378980 - /subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py
Date Thu, 30 Aug 2012 15:12:32 GMT
Author: danielsh
Date: Thu Aug 30 15:12:32 2012
New Revision: 1378980

URL: http://svn.apache.org/viewvc?rev=1378980&view=rev
Log:
[in tools/server-side/svnpubsub/]

* svnwcsub.py
  (BackgroundWorker._update):
    Delete .revision and recreate it (just in case it's a symlink).

Modified:
    subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py

Modified: subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py?rev=1378980&r1=1378979&r2=1378980&view=diff
==============================================================================
--- subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py (original)
+++ subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py Thu Aug 30 15:12:32 2012
@@ -29,6 +29,7 @@
 # See svnwcsub.conf for more information on its contents.
 #
 
+import errno
 import subprocess
 import threading
 import sys
@@ -252,7 +253,15 @@ class BackgroundWorker(threading.Thread)
         ### check the loglevel before running 'svn info'?
         info = svn_info(self.svnbin, self.env, wc.path)
         logging.info("updated: %s now at r%s", wc.path, info['Revision'])
-        open(os.path.join(wc.path, '.revision'), 'w').write(info['Revision'])
+
+        ### update the .revision file
+        dotrevision = os.path.join(wc.path, '.revision') 
+        try:
+            os.unlink(dotrevision)
+        except IOError, e:
+            if e.errno != errno.ENOENT:
+                raise
+        open(dotrevision, 'w').write(info['Revision'])
 
     def _cleanup(self, wc):
         "Run a cleanup on the specified working copy."



Mime
View raw message