[Pkg-bazaar-commits] ./bzr/unstable r429: - New command update-stat-cache for testing
Martin Pool
mbp at sourcefrog.net
Fri Apr 10 08:18:54 UTC 2009
------------------------------------------------------------
revno: 429
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Tue 2005-05-10 16:07:16 +1000
message:
- New command update-stat-cache for testing
- work-cache always stored with unix newlines and in ascii
renamed:
bzrlib/cache.py => bzrlib/statcache.py
modified:
bzrlib/atomicfile.py
bzrlib/commands.py
bzrlib/statcache.py
-------------- next part --------------
=== modified file 'bzrlib/atomicfile.py'
--- a/bzrlib/atomicfile.py 2005-05-10 06:00:59 +0000
+++ b/bzrlib/atomicfile.py 2005-05-10 06:07:16 +0000
@@ -39,7 +39,7 @@
self.f = open(self.tmpfilename, mode)
self.write = self.f.write
- self.closed = property(f.closed)
+ self.closed = property(self.f.closed)
def commit(self):
import sys, os
=== modified file 'bzrlib/commands.py'
--- a/bzrlib/commands.py 2005-05-10 03:56:02 +0000
+++ b/bzrlib/commands.py 2005-05-10 06:07:16 +0000
@@ -798,6 +798,18 @@
help.help(topic)
+class cmd_update_stat_cache(Command):
+ """Update stat-cache mapping inodes to SHA-1 hashes.
+
+ For testing only."""
+ hidden = True
+ def run(self):
+ import statcache
+ b = Branch('.')
+ inv = b.read_working_inventory()
+ statcache.update_cache(b, inv)
+
+
######################################################################
# main routine
=== renamed file 'bzrlib/cache.py' => 'bzrlib/statcache.py'
--- a/bzrlib/cache.py 2005-05-10 06:00:59 +0000
+++ b/bzrlib/statcache.py 2005-05-10 06:07:16 +0000
@@ -72,7 +72,7 @@
def write_cache(branch, entry_iter):
from atomicfile import AtomicFile
- outf = AtomicFile(branch.controlfilename('work-cache.tmp'), 'wt')
+ outf = AtomicFile(branch.controlfilename('work-cache.tmp'), 'wb')
try:
for entry in entry_iter:
outf.write(entry[0] + ' ' + entry[1] + ' ')
@@ -89,7 +89,7 @@
cache = {}
try:
- cachefile = branch.controlfile('work-cache', 'rt')
+ cachefile = branch.controlfile('work-cache', 'rb')
except IOError:
return cache
More information about the Pkg-bazaar-commits
mailing list