[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1378980 - /subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py

From: Joe Schaefer <joe_schaefer_at_yahoo.com>
Date: Thu, 30 Aug 2012 08:26:19 -0700 (PDT)

Well atm there's only one worker thread, so the assumption is correct.  It's probably a future-proof assumption as well going forward should Greg increase the worker thread pool for whatever reason- it's certainly not needed with our current deployments. >________________________________ > From: Daniel Shahaf <danielsh@apache.org> >To: dev@subversion.apache.org; gstein@apache.org; joes@apache.org >Sent: Thursday, August 30, 2012 11:22 AM >Subject: Re: svn commit: r1378980 - /subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py > >Would appreciate a review of this revision. > >In particular I assumed that _update() will never be run by two threads >concurrently on the same wc path. > >Thanks > >Daniel > >danielsh@apache.org wrote on Thu, Aug 30, 2012 at 15:12:32 -0000: >> 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." >> >> > > >
Received on 2012-08-30 17:26:56 CEST

This is an archived mail posted to the Subversion Dev mailing list.