[Pkg-bazaar-commits] ./bzr/unstable r551: - Don't fail if unable to update the statcache

Martin Pool mbp at sourcefrog.net
Fri Apr 10 08:18:56 UTC 2009


------------------------------------------------------------
revno: 551
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Wed 2005-05-25 12:58:04 +1000
message:
  - Don't fail if unable to update the statcache
modified:
  bzrlib/statcache.py
-------------- next part --------------
=== modified file 'bzrlib/statcache.py'
--- a/bzrlib/statcache.py	2005-05-24 21:18:02 +0000
+++ b/bzrlib/statcache.py	2005-05-25 02:58:04 +0000
@@ -140,6 +140,16 @@
     finally:
         if not outf.closed:
             outf.abort()
+
+
+def _write_cache_maybe(basedir, entry_iter, dangerfiles):
+    try:
+        return _write_cache(basedir, entry_iter, dangerfiles)
+    except IOError, e:
+        mutter("cannot update statcache in %s: %s" % (basedir, e))
+    except OSError, e:
+        mutter("cannot update statcache in %s: %s" % (basedir, e))
+        
         
         
 def load_cache(basedir):
@@ -270,6 +280,6 @@
         
     if change_cnt:
         mutter('updating on-disk statcache')
-        _write_cache(basedir, cache.itervalues(), dangerfiles)
+        _write_cache_maybe(basedir, cache.itervalues(), dangerfiles)
 
     return cache



More information about the Pkg-bazaar-commits mailing list