rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
pnv=u64(read(8)) | pnv=U64(read(8)) | def pack(self, t, referencesf): """Copy data from the current database file to a packed file Non-current records from transactions with time-stamp strings less than packtss are ommitted. As are all undone records. Also, data back pointers that point before packtss are resolved and the associated data are copied, sinc... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
p=u64(p) | p=U64(p) | def pack(self, t, referencesf): """Copy data from the current database file to a packed file Non-current records from transactions with time-stamp strings less than packtss are ommitted. As are all undone records. Also, data back pointers that point before packtss are resolved and the associated data are copied, sinc... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
if el < 0: el=t32-el tl=u64(stl) | tl=U64(stl) | def shift_transactions_forward(index, vindex, tindex, file, pos, opos): """Copy transactions forward in the data file This might be done as part of a recovery effort """ # Cache a bunch of methods seek=file.seek read=file.read write=file.write tappend=tindex.append index_get=index.get vindex_get=vindex.get # Initia... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
plen=u64(splen) | plen=U64(splen) | def shift_transactions_forward(index, vindex, tindex, file, pos, opos): """Copy transactions forward in the data file This might be done as part of a recovery effort """ # Cache a bunch of methods seek=file.seek read=file.read write=file.write tappend=tindex.append index_get=index.get vindex_get=vindex.get # Initia... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
dlen=dlen+16+vlen pnv=u64(read(8)) | dlen=dlen+(16+vlen) pnv=U64(read(8)) | def shift_transactions_forward(index, vindex, tindex, file, pos, opos): """Copy transactions forward in the data file This might be done as part of a recovery effort """ # Cache a bunch of methods seek=file.seek read=file.read write=file.write tappend=tindex.append index_get=index.get vindex_get=vindex.get # Initia... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
p=u64(p) | p=U64(p) | def shift_transactions_forward(index, vindex, tindex, file, pos, opos): """Copy transactions forward in the data file This might be done as part of a recovery effort """ # Cache a bunch of methods seek=file.seek read=file.read write=file.write tappend=tindex.append index_get=index.get vindex_get=vindex.get # Initia... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
l=u64(read(8)) | l=U64(read(8)) | def search_back(file, pos): seek=file.seek read=file.read seek(0,2) s=p=file.tell() while p > pos: seek(p-8) l=u64(read(8)) if l <= 0: break p=p-l-8 return p, s | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
ltid=z64, start=4, maxoid=z64, recover=0): | ltid=z64, start=4L, maxoid=z64, recover=0): | def read_index(file, name, index, vindex, tindex, stop='\377'*8, ltid=z64, start=4, maxoid=z64, recover=0): read=file.read seek=file.seek seek(0,2) file_size=file.tell() if file_size: if file_size < start: raise FileStorageFormatError, file.name seek(0) if read(4) != packed_version: raise FileStorageFormatError, name... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
return 4, maxoid, ltid | return 4L, maxoid, ltid | def read_index(file, name, index, vindex, tindex, stop='\377'*8, ltid=z64, start=4, maxoid=z64, recover=0): read=file.read seek=file.seek seek(0,2) file_size=file.tell() if file_size: if file_size < start: raise FileStorageFormatError, file.name seek(0) if read(4) != packed_version: raise FileStorageFormatError, name... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
tpos=0 | def read_index(file, name, index, vindex, tindex, stop='\377'*8, ltid=z64, start=4, maxoid=z64, recover=0): read=file.read seek=file.seek seek(0,2) file_size=file.tell() if file_size: if file_size < start: raise FileStorageFormatError, file.name seek(0) if read(4) != packed_version: raise FileStorageFormatError, name... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py | |
tl=u64(stl) if tl+pos+8 > file_size or status=='c': | tl=U64(stl) if pos+(tl+8) > file_size or status=='c': | def read_index(file, name, index, vindex, tindex, stop='\377'*8, ltid=z64, start=4, maxoid=z64, recover=0): read=file.read seek=file.seek seek(0,2) file_size=file.tell() if file_size: if file_size < start: raise FileStorageFormatError, file.name seek(0) if read(4) != packed_version: raise FileStorageFormatError, name... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
rtl=u64(read(8)) | rtl=U64(read(8)) | def read_index(file, name, index, vindex, tindex, stop='\377'*8, ltid=z64, start=4, maxoid=z64, recover=0): read=file.read seek=file.seek seek(0,2) file_size=file.tell() if file_size: if file_size < start: raise FileStorageFormatError, file.name seek(0) if read(4) != packed_version: raise FileStorageFormatError, name... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
if recover: return tpos, None, None | if recover: return pos, None, None | def read_index(file, name, index, vindex, tindex, stop='\377'*8, ltid=z64, start=4, maxoid=z64, recover=0): read=file.read seek=file.seek seek(0,2) file_size=file.tell() if file_size: if file_size < start: raise FileStorageFormatError, file.name seek(0) if read(4) != packed_version: raise FileStorageFormatError, name... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
pos=tpos+23+ul+dl+el | pos=tpos+(23+ul+dl+el) | def read_index(file, name, index, vindex, tindex, stop='\377'*8, ltid=z64, start=4, maxoid=z64, recover=0): read=file.read seek=file.seek seek(0,2) file_size=file.tell() if file_size: if file_size < start: raise FileStorageFormatError, file.name seek(0) if read(4) != packed_version: raise FileStorageFormatError, name... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
prev=u64(sprev) tloc=u64(stloc) plen=u64(splen) | prev=U64(sprev) tloc=U64(stloc) plen=U64(splen) | def read_index(file, name, index, vindex, tindex, stop='\377'*8, ltid=z64, start=4, maxoid=z64, recover=0): read=file.read seek=file.seek seek(0,2) file_size=file.tell() if file_size: if file_size < start: raise FileStorageFormatError, file.name seek(0) if read(4) != packed_version: raise FileStorageFormatError, name... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
dlen=dlen+16+vlen | dlen=dlen+(16+vlen) | def read_index(file, name, index, vindex, tindex, stop='\377'*8, ltid=z64, start=4, maxoid=z64, recover=0): read=file.read seek=file.seek seek(0,2) file_size=file.tell() if file_size: if file_size < start: raise FileStorageFormatError, file.name seek(0) if read(4) != packed_version: raise FileStorageFormatError, name... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
pv=u64(read(8)) | pv=U64(read(8)) | def read_index(file, name, index, vindex, tindex, stop='\377'*8, ltid=z64, start=4, maxoid=z64, recover=0): read=file.read seek=file.seek seek(0,2) file_size=file.tell() if file_size: if file_size < start: raise FileStorageFormatError, file.name seek(0) if read(4) != packed_version: raise FileStorageFormatError, name... | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
old=u64(back) | old=U64(back) | def _loadBack(file, oid, back): seek=file.seek read=file.read while 1: old=u64(back) if not old: raise KeyError, oid seek(old) h=read(42) doid,serial,prev,tloc,vlen,plen = unpack(">8s8s8s8sH8s", h) if vlen: seek(vlen+16,1) if plen != z64: return read(u64(plen)), serial back=read(8) # We got a back pointer! | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
if plen != z64: return read(u64(plen)), serial | if plen != z64: return read(U64(plen)), serial | def _loadBack(file, oid, back): seek=file.seek read=file.read while 1: old=u64(back) if not old: raise KeyError, oid seek(old) h=read(42) doid,serial,prev,tloc,vlen,plen = unpack(">8s8s8s8sH8s", h) if vlen: seek(vlen+16,1) if plen != z64: return read(u64(plen)), serial back=read(8) # We got a back pointer! | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
old=u64(back) | old=U64(back) | def _loadBackPOS(file, oid, back): seek=file.seek read=file.read while 1: old=u64(back) if not old: raise KeyError, oid seek(old) h=read(42) doid,serial,prev,tloc,vlen,plen = unpack(">8s8s8s8sH8s", h) if vlen: seek(vlen+16,1) if plen != z64: return old back=read(8) # We got a back pointer! | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
self._pos=4 | self._pos=4L | def __init__(self, file): if type(file) is type(''): file=open(file, 'r+b') self._file=file if file.read(4) != packed_version: raise FileStorageFormatError, name file.seek(0,2) self._file_size=file.tell() self._pos=4 | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
tl=u64(stl) if tl+pos+8 > self._file_size or status=='c': | tl=U64(stl) if pos+(tl+8) > self._file_size or status=='c': | def next(self, index=0): file=self._file seek=file.seek read=file.read pos=self._pos | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
def next(self, index=0): file=self._file seek=file.seek read=file.read pos=self._pos | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py | ||
rtl=u64(read(8)) | rtl=U64(read(8)) | def next(self, index=0): file=self._file seek=file.seek read=file.read pos=self._pos | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
warn("It appears that there is invalid data at the end of the " "file, possibly due to a system crash. %s truncated " "to recover from bad data at end." | warn("It appears that there is invalid data at the end of " "the file, possibly due to a system crash. %s " "truncated to recover from bad data at end." | def next(self, index=0): file=self._file seek=file.seek read=file.read pos=self._pos | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
pos=tpos+23+ul+dl+el | pos=tpos+(23+ul+dl+el) | def next(self, index=0): file=self._file seek=file.seek read=file.read pos=self._pos | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
prev=u64(sprev) tloc=u64(stloc) plen=u64(splen) | prev=U64(sprev) tloc=U64(stloc) plen=U64(splen) | def next(self, index=0): name='' pos = self._pos tend, file, seek, read, tpos = self._stuff while pos < tend: # Read the data records for this transaction | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
dlen=dlen+16+vlen | dlen=dlen+(16+vlen) | def next(self, index=0): name='' pos = self._pos tend, file, seek, read, tpos = self._stuff while pos < tend: # Read the data records for this transaction | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
pv=u64(read(8)) | pv=U64(read(8)) | def next(self, index=0): name='' pos = self._pos tend, file, seek, read, tpos = self._stuff while pos < tend: # Read the data records for this transaction | e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py |
log("wait() async=%d" % self.is_async(), level=zLOG.TRACE) | log("wait(%d), async=%d" % (msgid, self.is_async()), level=zLOG.TRACE) | def wait(self, msgid): """Invoke asyncore mainloop and wait for reply.""" if __debug__: log("wait() async=%d" % self.is_async(), level=zLOG.TRACE) if self.is_async(): self.trigger.pull_trigger() | 8cba505590688054372b55b2e09e37ee054879c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/8cba505590688054372b55b2e09e37ee054879c5/connection.py |
asyncore.poll(10.0, self._map) | if __debug__: log("wait(%d): asyncore.poll(%s)" % (msgid, delay), level=zLOG.TRACE) asyncore.poll(delay, self._map) if delay < 1.0: delay += delay | def wait(self, msgid): """Invoke asyncore mainloop and wait for reply.""" if __debug__: log("wait() async=%d" % self.is_async(), level=zLOG.TRACE) if self.is_async(): self.trigger.pull_trigger() | 8cba505590688054372b55b2e09e37ee054879c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/8cba505590688054372b55b2e09e37ee054879c5/connection.py |
def testItemsNegativeIndex(self): L = [-3, 6, -11, 4] for i in L: self.t[i] = i L.sort() items = self.t.items() for i in range(-1, -4, -1): self.assertEqual(items[i], (L[i], L[i])) self.assertRaises(IndexError, lambda: items[-5]) | def testItemsWorks(self): for x in range(100): self.t[x] = 2*x v = self.t.items() i = 0 for x in v: self.assertEqual(x[0], i) self.assertEqual(x[1], 2*i) i += 1 | b4ae0a53abf9984d8b2f9327eb9b84ff5e5717da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/b4ae0a53abf9984d8b2f9327eb9b84ff5e5717da/testBTrees.py | |
zLOG.LOG(label or _label, level, message, error=error) | label = label or _label if LOG_THREAD_ID: label = "%s:%s" % (label, threading.currentThread().getName()) zLOG.LOG(label, level, message, error=error) | def log(message, level=zLOG.BLATHER, label=None, error=None): zLOG.LOG(label or _label, level, message, error=error) | b3c871b25737cbea7b058b724774e748319b8604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/b3c871b25737cbea7b058b724774e748319b8604/log.py |
return | def checkSize(self): # XXX need to fix return self.assertEqual(self.db.cacheSize(), 0) self.assertEqual(self.db.cacheDetailSize(), []) | 069ef5f3c7632edb828d987ae21e4bf5535b0fdb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/069ef5f3c7632edb828d987ae21e4bf5535b0fdb/testCache.py | |
self.assertEquals(self.db.cacheSize(), CACHE_SIZE * CONNS) details = self.db.cacheDetailSize() self.assertEquals(len(details), CONNS) for d in details: self.assertEquals(d['ngsize'], CACHE_SIZE) self.assertEquals(d['size'], CACHE_SIZE + 1) | self.assertEquals(self.db.cacheSize(), 0) | def checkSize(self): # XXX need to fix return self.assertEqual(self.db.cacheSize(), 0) self.assertEqual(self.db.cacheDetailSize(), []) | 069ef5f3c7632edb828d987ae21e4bf5535b0fdb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/069ef5f3c7632edb828d987ae21e4bf5535b0fdb/testCache.py |
return | def checkDetail(self): # XXX need to fix return CACHE_SIZE = 10 self.db.setCacheSize(CACHE_SIZE) | 069ef5f3c7632edb828d987ae21e4bf5535b0fdb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/069ef5f3c7632edb828d987ae21e4bf5535b0fdb/testCache.py | |
for klass, count in self.db.cacheDetail(): print klass, count if klass.endswith('MinPO'): self.assertEqual(count, CONNS * CACHE_SIZE) if klass.endswith('PersistentMapping'): self.assertEqual(count, CONNS) | [(klass, count)] = self.db.cacheDetail() self.assertEqual(klass, "Persistence.PersistentMapping") self.assertEqual(count, CONNS) | def checkDetail(self): # XXX need to fix return CACHE_SIZE = 10 self.db.setCacheSize(CACHE_SIZE) | 069ef5f3c7632edb828d987ae21e4bf5535b0fdb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/069ef5f3c7632edb828d987ae21e4bf5535b0fdb/testCache.py |
print details if details['klass'].endswith('PersistentMapping'): self.assertEqual(details['state'], None) else: self.assert_(details['klass'].endswith('MinPO')) self.assertEqual(details['state'], 0) | self.assertEqual(details["klass"], "Persistence.PersistentMapping") self.assertEqual(details['state'], None) | def checkDetail(self): # XXX need to fix return CACHE_SIZE = 10 self.db.setCacheSize(CACHE_SIZE) | 069ef5f3c7632edb828d987ae21e4bf5535b0fdb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/069ef5f3c7632edb828d987ae21e4bf5535b0fdb/testCache.py |
'r': (self._commit_lock_release, 0), | 'U': (self._commit_lock_release, 0), | def out_of_band_hook( code, args, get_hook={ 'b': (invalidator.begin, 0), 'i': (invalidator.invalidate, 1), 'e': (invalidator.end, 0), 'I': (invalidator.Invalidate, 1), 'r': (self._commit_lock_release, 0), 's': (self._serials.append, 1), 'S': (self._info.update, 1), }.get): | 4a43e943716c5499ee5e2bc8a6b74152d44467c7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/4a43e943716c5499ee5e2bc8a6b74152d44467c7/ClientStorage.py |
return unittest.makeSuite(StorageTestCase) | suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(StorageTestCase)) import BDBStorage if BDBStorage.is_available: suite.addTest(unittest.makeSuite(BDBStorageTests)) return suite | def test_suite(): return unittest.makeSuite(StorageTestCase) | f784f9a84ebabfece0d07cee097ebbe940cdbbae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/f784f9a84ebabfece0d07cee097ebbe940cdbbae/testStorageConfig.py |
test_merge(base, b1, b2, bm, 'empty one and not other') | test_merge(base, b1, b2, bm, 'empty one and not other', should_fail=1) | def testMergeEmpty(self): base, b1, b2, bm, e1, e2, items = self._setupConflict() | d52b5766355fd097c24bb77e6d6dc916db8bd138 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/d52b5766355fd097c24bb77e6d6dc916db8bd138/testConflict.py |
test_merge(base, b1, b2, bm, 'empty one and not other') | test_merge(base, b1, b2, bm, 'empty one and not other', should_fail=1) | def testMergeEmpty(self): base, b1, b2, bm, e1, e2, items = self._setupConflict() | d52b5766355fd097c24bb77e6d6dc916db8bd138 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/d52b5766355fd097c24bb77e6d6dc916db8bd138/testConflict.py |
get_transaction().commit() self.assertRaises(AssertionError, b._check) | self.assertRaises(ConflictError, get_transaction().commit) get_transaction().abort() | def testEmptyBucketConflict(self): # Tests that an emptied bucket *created by* conflict resolution is # viewed as a conflict: conflict resolution doesn't have enough # info to unlink the empty bucket from the BTree correctly. b = self.t for i in range(0, 200, 4): b[i] = i # bucket 0 has 15 values: 0, 4 .. 56 # bucket ... | d52b5766355fd097c24bb77e6d6dc916db8bd138 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/d52b5766355fd097c24bb77e6d6dc916db8bd138/testConflict.py |
"phase commmit") | "phase commit") | def _finishCommit(self, txn): self.logger.debug("%s: commit", txn) try: for r in txn._resources: r.commit(txn) txn._status = Status.COMMITTED except: # An error occured during the second phase of 2PC. We can # no longer guarantee the system is in a consistent state. # The best we can do is abort() all the resource man... | 2b55027b0cc5584dcab4195dbf1d643da4c46df1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/2b55027b0cc5584dcab4195dbf1d643da4c46df1/manager.py |
raise TransactionError("Transaction failed during second " "phase of two-phase commit") | raise TransactionError(msg) | def _finishCommit(self, txn): self.logger.debug("%s: commit", txn) try: for r in txn._resources: r.commit(txn) txn._status = Status.COMMITTED except: # An error occured during the second phase of 2PC. We can # no longer guarantee the system is in a consistent state. # The best we can do is abort() all the resource man... | 2b55027b0cc5584dcab4195dbf1d643da4c46df1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/2b55027b0cc5584dcab4195dbf1d643da4c46df1/manager.py |
def checkLoadSerial(self): oid = self._storage.new_oid() revid = ZERO revisions = {} for i in range(31, 38): revid = self._dostore(oid, revid=revid, data=MinPO(i)) revisions[revid] = MinPO(i) # Now make sure all the revisions have the correct value for revid, value in revisions.items(): data = self._storage.loadSerial(... | fce53a9aff34fdd8b1985b1d63f410371e52b815 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/fce53a9aff34fdd8b1985b1d63f410371e52b815/BasicStorage.py | ||
LOG("ZODB FS", BLATHER, "next(%d)" % index) | def next(self, index=0): if self._file is None: # A closed iterator. XXX: Is IOError the best we can do? For # now, mimic a read on a closed file. raise IOError, 'iterator is closed' file=self._file seek=file.seek read=file.read pos=self._pos | 0f0899719267f94787a4dabe8ca2adfe326f5f14 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/0f0899719267f94787a4dabe8ca2adfe326f5f14/FileStorage.py | |
if self._stop is not None: LOG("ZODB FS", BLATHER, ("tid %x > stop %x ? %d" % (U64(tid), U64(self._stop), tid > self._stop))) | def next(self, index=0): if self._file is None: # A closed iterator. XXX: Is IOError the best we can do? For # now, mimic a read on a closed file. raise IOError, 'iterator is closed' file=self._file seek=file.seek read=file.read pos=self._pos | 0f0899719267f94787a4dabe8ca2adfe326f5f14 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/0f0899719267f94787a4dabe8ca2adfe326f5f14/FileStorage.py | |
self.description = "%s\n\n%s" % (self.description, test.strip()) | self.description = "%s\n\n%s" % (self.description, text.strip()) | def note(self, text): if self.description: self.description = "%s\n\n%s" % (self.description, test.strip()) else: self.description = text.strip() | bf2e68092a2883a167d3d329f9b3cfb62ec44759 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/bf2e68092a2883a167d3d329f9b3cfb62ec44759/Transaction.py |
def resume(self, txn): if self._current is not None: raise TransactionError("Can't resume while other " "transaction is active") self._suspended.remove(txn) self._current = txn | d75a3239c0321f93985e4d3bf301222339db156c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/d75a3239c0321f93985e4d3bf301222339db156c/manager.py | ||
elif err[0] == 0: break | def pending(self): """Invoke mainloop until any pending messages are handled.""" if __debug__: log("pending(), async=%d" % self.is_async(), level=zLOG.TRACE) if self.is_async(): return # Inline the asyncore poll() function to know whether any input # was actually read. Repeat until no input is ready. # XXX This only d... | ddf9f94aa56510b4202ad686728b222b38b51667 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/ddf9f94aa56510b4202ad686728b222b38b51667/connection.py | |
else: | except: | def pending(self): """Invoke mainloop until any pending messages are handled.""" if __debug__: log("pending(), async=%d" % self.is_async(), level=zLOG.TRACE) if self.is_async(): return # Inline the asyncore poll() function to know whether any input # was actually read. Repeat until no input is ready. # XXX This only d... | ddf9f94aa56510b4202ad686728b222b38b51667 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/ddf9f94aa56510b4202ad686728b222b38b51667/connection.py |
def read_transaction_header(file, pos, file_size): | def read_txn_header(f, pos, file_size, outp, ltid): | def read_transaction_header(file, pos, file_size): # Read the transaction record file.seek(pos) h = file.read(23) if len(h) < 23: raise EOFError tid, stl, status, ul, dl, el = unpack(">8s8scHHH",h) if el < 0: el=t32-el tl=u64(stl) if status=='c': raise EOFError if pos+(tl+8) > file_size: error("bad transaction leng... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
file.seek(pos) h = file.read(23) | f.seek(pos) h = f.read(23) | def read_transaction_header(file, pos, file_size): # Read the transaction record file.seek(pos) h = file.read(23) if len(h) < 23: raise EOFError tid, stl, status, ul, dl, el = unpack(">8s8scHHH",h) if el < 0: el=t32-el tl=u64(stl) if status=='c': raise EOFError if pos+(tl+8) > file_size: error("bad transaction leng... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
tl=u64(stl) if status=='c': raise EOFError if pos+(tl+8) > file_size: | tl = u64(stl) if pos + (tl + 8) > file_size: | def read_transaction_header(file, pos, file_size): # Read the transaction record file.seek(pos) h = file.read(23) if len(h) < 23: raise EOFError tid, stl, status, ul, dl, el = unpack(">8s8scHHH",h) if el < 0: el=t32-el tl=u64(stl) if status=='c': raise EOFError if pos+(tl+8) > file_size: error("bad transaction leng... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
if status not in ' up': error('invalid status, %s, at %s', status, pos) if tl < (23+ul+dl+el): error('invalid transaction length, %s, at %s', tl, pos) tpos=pos tend=tpos+tl if status=='u': | if tl < (23 + ul + dl + el): error("invalid transaction length, %s, at %s", tl, pos) if ltid and tid < ltid: error("time-stamp reducation %s < %s, at %s", u64(tid), u64(ltid), pos) if status == "c": truncate(f, pos, file_size, output) raise EOFError if status not in " up": error("invalid status, %r, at %s", status, ... | def read_transaction_header(file, pos, file_size): # Read the transaction record file.seek(pos) h = file.read(23) if len(h) < 23: raise EOFError tid, stl, status, ul, dl, el = unpack(">8s8scHHH",h) if el < 0: el=t32-el tl=u64(stl) if status=='c': raise EOFError if pos+(tl+8) > file_size: error("bad transaction leng... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
file.seek(tend) h = file.read(8) | f.seek(tend) h = f.read(8) | def read_transaction_header(file, pos, file_size): # Read the transaction record file.seek(pos) h = file.read(23) if len(h) < 23: raise EOFError tid, stl, status, ul, dl, el = unpack(">8s8scHHH",h) if el < 0: el=t32-el tl=u64(stl) if status=='c': raise EOFError if pos+(tl+8) > file_size: error("bad transaction leng... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
error('inconsistent transaction length at %s', pos) | error("inconsistent transaction length at %s", pos) | def read_transaction_header(file, pos, file_size): # Read the transaction record file.seek(pos) h = file.read(23) if len(h) < 23: raise EOFError tid, stl, status, ul, dl, el = unpack(">8s8scHHH",h) if el < 0: el=t32-el tl=u64(stl) if status=='c': raise EOFError if pos+(tl+8) > file_size: error("bad transaction leng... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
return pos, None | return pos, None, tid | def read_transaction_header(file, pos, file_size): # Read the transaction record file.seek(pos) h = file.read(23) if len(h) < 23: raise EOFError tid, stl, status, ul, dl, el = unpack(">8s8scHHH",h) if el < 0: el=t32-el tl=u64(stl) if status=='c': raise EOFError if pos+(tl+8) > file_size: error("bad transaction leng... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
user = file.read(ul) description = file.read(dl) | user = f.read(ul) description = f.read(dl) | def read_transaction_header(file, pos, file_size): # Read the transaction record file.seek(pos) h = file.read(23) if len(h) < 23: raise EOFError tid, stl, status, ul, dl, el = unpack(">8s8scHHH",h) if el < 0: el=t32-el tl=u64(stl) if status=='c': raise EOFError if pos+(tl+8) > file_size: error("bad transaction leng... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
try: e=loads(file.read(el)) | try: e=loads(f.read(el)) | def read_transaction_header(file, pos, file_size): # Read the transaction record file.seek(pos) h = file.read(23) if len(h) < 23: raise EOFError tid, stl, status, ul, dl, el = unpack(">8s8scHHH",h) if el < 0: el=t32-el tl=u64(stl) if status=='c': raise EOFError if pos+(tl+8) > file_size: error("bad transaction leng... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
file, tpos) pos=tend | f, tpos) pos = tend | def read_transaction_header(file, pos, file_size): # Read the transaction record file.seek(pos) h = file.read(23) if len(h) < 23: raise EOFError tid, stl, status, ul, dl, el = unpack(">8s8scHHH",h) if el < 0: el=t32-el tl=u64(stl) if status=='c': raise EOFError if pos+(tl+8) > file_size: error("bad transaction leng... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
file.seek(pos) h = file.read(8) | f.seek(pos) h = f.read(8) | def read_transaction_header(file, pos, file_size): # Read the transaction record file.seek(pos) h = file.read(23) if len(h) < 23: raise EOFError tid, stl, status, ul, dl, el = unpack(">8s8scHHH",h) if el < 0: el=t32-el tl=u64(stl) if status=='c': raise EOFError if pos+(tl+8) > file_size: error("bad transaction leng... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
return pos, result def scan(file, pos): """Return a potential transaction location following pos in file. | return pos, result, tid def truncate(f, pos, file_size, outp): """Copy data from pos to end of f to a .trNNN file.""" i = 0 while 1: trname = outp + ".tr%d" % i if os.path.exists(trname): i += 1 tr = open(trname, "wb") copy(f, tr, file_size - pos) f.seek(pos) tr.close() def copy(src, dst, n): while n: buf = src.read... | def read_transaction_header(file, pos, file_size): # Read the transaction record file.seek(pos) h = file.read(23) if len(h) < 23: raise EOFError tid, stl, status, ul, dl, el = unpack(">8s8scHHH",h) if el < 0: el=t32-el tl=u64(stl) if status=='c': raise EOFError if pos+(tl+8) > file_size: error("bad transaction leng... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
file.seek(pos) data = file.read(8096) | f.seek(pos) data = f.read(8096) | def scan(file, pos): """Return a potential transaction location following pos in file. This routine scans forward from pos looking for the last data record in a transaction. A period '.' always occurs at the end of a pickle, and an 8-byte transaction length follows the last pickle. If a period is followed by a plaus... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
l = data.find('.', s) | l = data.find(".", s) | def scan(file, pos): """Return a potential transaction location following pos in file. This routine scans forward from pos looking for the last data record in a transaction. A period '.' always occurs at the end of a pickle, and an 8-byte transaction length follows the last pickle. If a period is followed by a plaus... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
if l > len(data) - 8: | s = l + 1 if s > len(data) - 8: | def scan(file, pos): """Return a potential transaction location following pos in file. This routine scans forward from pos looking for the last data record in a transaction. A period '.' always occurs at the end of a pickle, and an 8-byte transaction length follows the last pickle. If a period is followed by a plaus... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
s = l + 1 | def scan(file, pos): """Return a potential transaction location following pos in file. This routine scans forward from pos looking for the last data record in a transaction. A period '.' always occurs at the end of a pickle, and an 8-byte transaction length follows the last pickle. If a period is followed by a plaus... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py | |
print '.', | print ".", | def iprogress(i): if i % 2: print '.', else: print (i/2) % 10, sys.stdout.flush() | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
opts, (inp, outp) = getopt.getopt(sys.argv[1:], 'fv:pP:') | opts, (inp, outp) = getopt.getopt(sys.argv[1:], "fv:pP:") | def main(): try: opts, (inp, outp) = getopt.getopt(sys.argv[1:], 'fv:pP:') except getopt.error: die() print __doc__ % argv[0] force = partial = verbose = 0 pack = None for opt, v in opts: if opt == '-v': verbose = int(v) elif opt == '-p': partial = 1 elif opt == '-f': force = 1 elif opt == '-P': pack = time.time() - f... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
if opt == '-v': | if opt == "-v": | def main(): try: opts, (inp, outp) = getopt.getopt(sys.argv[1:], 'fv:pP:') except getopt.error: die() print __doc__ % argv[0] force = partial = verbose = 0 pack = None for opt, v in opts: if opt == '-v': verbose = int(v) elif opt == '-p': partial = 1 elif opt == '-f': force = 1 elif opt == '-P': pack = time.time() - f... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
elif opt == '-p': | elif opt == "-p": | def main(): try: opts, (inp, outp) = getopt.getopt(sys.argv[1:], 'fv:pP:') except getopt.error: die() print __doc__ % argv[0] force = partial = verbose = 0 pack = None for opt, v in opts: if opt == '-v': verbose = int(v) elif opt == '-p': partial = 1 elif opt == '-f': force = 1 elif opt == '-P': pack = time.time() - f... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
elif opt == '-f': | elif opt == "-f": | def main(): try: opts, (inp, outp) = getopt.getopt(sys.argv[1:], 'fv:pP:') except getopt.error: die() print __doc__ % argv[0] force = partial = verbose = 0 pack = None for opt, v in opts: if opt == '-v': verbose = int(v) elif opt == '-p': partial = 1 elif opt == '-f': force = 1 elif opt == '-P': pack = time.time() - f... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
elif opt == '-P': | elif opt == "-P": | def main(): try: opts, (inp, outp) = getopt.getopt(sys.argv[1:], 'fv:pP:') except getopt.error: die() print __doc__ % argv[0] force = partial = verbose = 0 pack = None for opt, v in opts: if opt == '-v': verbose = int(v) elif opt == '-p': partial = 1 elif opt == '-f': force = 1 elif opt == '-P': pack = time.time() - f... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
print 'Recovering', inp, 'into', outp | print "Recovering", inp, "into", outp | def recover(inp, outp, verbose=0, partial=0, force=0, pack=0): print 'Recovering', inp, 'into', outp if os.path.exists(outp) and not force: die("%s exists" % outp) file = open(inp, "rb") if file.read(4) != ZODB.FileStorage.packed_version: die("input is not a file storage") file.seek(0,2) file_size = file.tell() ofs... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
file = open(inp, "rb") if file.read(4) != ZODB.FileStorage.packed_version: | f = open(inp, "rb") if f.read(4) != ZODB.FileStorage.packed_version: | def recover(inp, outp, verbose=0, partial=0, force=0, pack=0): print 'Recovering', inp, 'into', outp if os.path.exists(outp) and not force: die("%s exists" % outp) file = open(inp, "rb") if file.read(4) != ZODB.FileStorage.packed_version: die("input is not a file storage") file.seek(0,2) file_size = file.tell() ofs... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
file.seek(0,2) file_size = file.tell() | f.seek(0,2) file_size = f.tell() | def recover(inp, outp, verbose=0, partial=0, force=0, pack=0): print 'Recovering', inp, 'into', outp if os.path.exists(outp) and not force: die("%s exists" % outp) file = open(inp, "rb") if file.read(4) != ZODB.FileStorage.packed_version: die("input is not a file storage") file.seek(0,2) file_size = file.tell() ofs... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
preindex = {} | def recover(inp, outp, verbose=0, partial=0, force=0, pack=0): print 'Recovering', inp, 'into', outp if os.path.exists(outp) and not force: die("%s exists" % outp) file = open(inp, "rb") if file.read(4) != ZODB.FileStorage.packed_version: die("input is not a file storage") file.seek(0,2) file_size = file.tell() ofs... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py | |
npos, transaction = read_transaction_header(file, pos, file_size) | npos, txn, tid = read_txn_header(f, pos, file_size, outp, ltid) | def recover(inp, outp, verbose=0, partial=0, force=0, pack=0): print 'Recovering', inp, 'into', outp if os.path.exists(outp) and not force: die("%s exists" % outp) file = open(inp, "rb") if file.read(4) != ZODB.FileStorage.packed_version: die("input is not a file storage") file.seek(0,2) file_size = file.tell() ofs... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
except: print "\n%s: %s\n" % sys.exc_info()[:2] | except (KeyboardInterrupt, SystemExit): raise except Exception, err: print "error reading txn header:", err | def recover(inp, outp, verbose=0, partial=0, force=0, pack=0): print 'Recovering', inp, 'into', outp if os.path.exists(outp) and not force: die("%s exists" % outp) file = open(inp, "rb") if file.read(4) != ZODB.FileStorage.packed_version: die("input is not a file storage") file.seek(0,2) file_size = file.tell() ofs... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
pos = scan(file, pos) | pos = scan(f, pos) if verbose > 1: print "looking for valid txn header at", pos | def recover(inp, outp, verbose=0, partial=0, force=0, pack=0): print 'Recovering', inp, 'into', outp if os.path.exists(outp) and not force: die("%s exists" % outp) file = open(inp, "rb") if file.read(4) != ZODB.FileStorage.packed_version: die("input is not a file storage") file.seek(0,2) file_size = file.tell() ofs... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
if transaction is None: | ltid = tid if txn is None: | def recover(inp, outp, verbose=0, partial=0, force=0, pack=0): print 'Recovering', inp, 'into', outp if os.path.exists(outp) and not force: die("%s exists" % outp) file = open(inp, "rb") if file.read(4) != ZODB.FileStorage.packed_version: die("input is not a file storage") file.seek(0,2) file_size = file.tell() ofs... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
tid = transaction.tid | tid = txn.tid | def recover(inp, outp, verbose=0, partial=0, force=0, pack=0): print 'Recovering', inp, 'into', outp if os.path.exists(outp) and not force: die("%s exists" % outp) file = open(inp, "rb") if file.read(4) != ZODB.FileStorage.packed_version: die("input is not a file storage") file.seek(0,2) file_size = file.tell() ofs... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
print ('Time stamps out of order %s, %s' % (_ts, t)) | print ("Time stamps out of order %s, %s" % (_ts, t)) | def recover(inp, outp, verbose=0, partial=0, force=0, pack=0): print 'Recovering', inp, 'into', outp if os.path.exists(outp) and not force: die("%s exists" % outp) file = open(inp, "rb") if file.read(4) != ZODB.FileStorage.packed_version: die("input is not a file storage") file.seek(0,2) file_size = file.tell() ofs... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
print ('Time stamps back in order %s' % (t)) | print ("Time stamps back in order %s" % (t)) | def recover(inp, outp, verbose=0, partial=0, force=0, pack=0): print 'Recovering', inp, 'into', outp if os.path.exists(outp) and not force: die("%s exists" % outp) file = open(inp, "rb") if file.read(4) != ZODB.FileStorage.packed_version: die("input is not a file storage") file.seek(0,2) file_size = file.tell() ofs... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
print 'begin', | print "begin", pos, _ts, | def recover(inp, outp, verbose=0, partial=0, force=0, pack=0): print 'Recovering', inp, 'into', outp if os.path.exists(outp) and not force: die("%s exists" % outp) file = open(inp, "rb") if file.read(4) != ZODB.FileStorage.packed_version: die("input is not a file storage") file.seek(0,2) file_size = file.tell() ofs... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
ofs.tpc_begin(transaction, tid, transaction.status) if verbose: print 'begin', pos, _ts, if verbose > 1: print sys.stdout.flush() | def recover(inp, outp, verbose=0, partial=0, force=0, pack=0): print 'Recovering', inp, 'into', outp if os.path.exists(outp) and not force: die("%s exists" % outp) file = open(inp, "rb") if file.read(4) != ZODB.FileStorage.packed_version: die("input is not a file storage") file.seek(0,2) file_size = file.tell() ofs... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py | |
for r in transaction: oid = r.oid | for r in txn: | def recover(inp, outp, verbose=0, partial=0, force=0, pack=0): print 'Recovering', inp, 'into', outp if os.path.exists(outp) and not force: die("%s exists" % outp) file = open(inp, "rb") if file.read(4) != ZODB.FileStorage.packed_version: die("input is not a file storage") file.seek(0,2) file_size = file.tell() ofs... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
print u64(oid), r.version, len(r.data) pre = preindex.get(oid) s = ofs.store(oid, pre, r.data, r.version, transaction) preindex[oid] = s | if r.data is None: l = "bp" else: l = len(r.data) print "%7d %s %s" % (u64(r.oid), l, r.version) s = ofs.restore(r.oid, r.serial, r.data, r.version, r.data_txn, txn) | def recover(inp, outp, verbose=0, partial=0, force=0, pack=0): print 'Recovering', inp, 'into', outp if os.path.exists(outp) and not force: die("%s exists" % outp) file = open(inp, "rb") if file.read(4) != ZODB.FileStorage.packed_version: die("input is not a file storage") file.seek(0,2) file_size = file.tell() ofs... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
except: | except (KeyboardInterrupt, SystemExit): raise except Exception, err: | def recover(inp, outp, verbose=0, partial=0, force=0, pack=0): print 'Recovering', inp, 'into', outp if os.path.exists(outp) and not force: die("%s exists" % outp) file = open(inp, "rb") if file.read(4) != ZODB.FileStorage.packed_version: die("input is not a file storage") file.seek(0,2) file_size = file.tell() ofs... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
ofs._status = 'p' ofs.tpc_vote(transaction) ofs.tpc_finish(transaction) | ofs._status = "p" ofs.tpc_vote(txn) ofs.tpc_finish(txn) | def recover(inp, outp, verbose=0, partial=0, force=0, pack=0): print 'Recovering', inp, 'into', outp if os.path.exists(outp) and not force: die("%s exists" % outp) file = open(inp, "rb") if file.read(4) != ZODB.FileStorage.packed_version: die("input is not a file storage") file.seek(0,2) file_size = file.tell() ofs... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
print 'partial' | print "partial" | def recover(inp, outp, verbose=0, partial=0, force=0, pack=0): print 'Recovering', inp, 'into', outp if os.path.exists(outp) and not force: die("%s exists" % outp) file = open(inp, "rb") if file.read(4) != ZODB.FileStorage.packed_version: die("input is not a file storage") file.seek(0,2) file_size = file.tell() ofs... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
ofs.tpc_abort(transaction) print "\n%s: %s\n" % sys.exc_info()[:2] | ofs.tpc_abort(txn) print "error copying transaction:", err | def recover(inp, outp, verbose=0, partial=0, force=0, pack=0): print 'Recovering', inp, 'into', outp if os.path.exists(outp) and not force: die("%s exists" % outp) file = open(inp, "rb") if file.read(4) != ZODB.FileStorage.packed_version: die("input is not a file storage") file.seek(0,2) file_size = file.tell() ofs... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
pos = scan(file, pos) | pos = scan(f, pos) if verbose > 1: print "looking for valid txn header at", pos | def recover(inp, outp, verbose=0, partial=0, force=0, pack=0): print 'Recovering', inp, 'into', outp if os.path.exists(outp) and not force: die("%s exists" % outp) file = open(inp, "rb") if file.read(4) != ZODB.FileStorage.packed_version: die("input is not a file storage") file.seek(0,2) file_size = file.tell() ofs... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
ofs.tpc_vote(transaction) ofs.tpc_finish(transaction) | ofs.tpc_vote(txn) ofs.tpc_finish(txn) | def recover(inp, outp, verbose=0, partial=0, force=0, pack=0): print 'Recovering', inp, 'into', outp if os.path.exists(outp) and not force: die("%s exists" % outp) file = open(inp, "rb") if file.read(4) != ZODB.FileStorage.packed_version: die("input is not a file storage") file.seek(0,2) file_size = file.tell() ofs... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
print 'finish' | print "finish" | def recover(inp, outp, verbose=0, partial=0, force=0, pack=0): print 'Recovering', inp, 'into', outp if os.path.exists(outp) and not force: die("%s exists" % outp) file = open(inp, "rb") if file.read(4) != ZODB.FileStorage.packed_version: die("input is not a file storage") file.seek(0,2) file_size = file.tell() ofs... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
if __name__ == '__main__': | if __name__ == "__main__": | def recover(inp, outp, verbose=0, partial=0, force=0, pack=0): print 'Recovering', inp, 'into', outp if os.path.exists(outp) and not force: die("%s exists" % outp) file = open(inp, "rb") if file.read(4) != ZODB.FileStorage.packed_version: die("input is not a file storage") file.seek(0,2) file_size = file.tell() ofs... | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py |
"""Return the parent of p, n levels up.""" | """Return the ancestor of p from n levels up.""" | def parentdir(p, n=1): """Return the parent of p, n levels up.""" d = p while n: d = os.path.split(d)[0] if not d or d == '.': d = os.getcwd() n -= 1 return d | 136511231afa030a5231a38a766eae7a651aaa7c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/136511231afa030a5231a38a766eae7a651aaa7c/util.py |
d = os.path.split(d)[0] | d = os.path.dirname(d) | def parentdir(p, n=1): """Return the parent of p, n levels up.""" d = p while n: d = os.path.split(d)[0] if not d or d == '.': d = os.getcwd() n -= 1 return d | 136511231afa030a5231a38a766eae7a651aaa7c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/136511231afa030a5231a38a766eae7a651aaa7c/util.py |
address = ('127.9.9.9', 19999) | portoffset = 0 | def handle_read(self): self.recv(8192) self.lock.acquire() try: for thunk in self.thunks: try: thunk() except: nil, t, v, tbinfo = asyncore.compact_traceback() print ('exception in trigger thunk:' ' (%s:%s %s)' % (t, v, tbinfo)) self.thunks = [] finally: self.lock.release() | 4ff0c9ad8086c2bdec7550cb4c139175ca92a708 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/4ff0c9ad8086c2bdec7550cb4c139175ca92a708/trigger.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.