"""
# end of bup preamble
+from __future__ import absolute_import, print_function
import sys, stat, time, os, errno, re
from bup import metadata, options, git, index, drecurse, hlinkdb
self.next()
def next(self):
- try:
- self.cur = self.i.next()
- except StopIteration:
- self.cur = None
+ self.cur = next(self.i, None)
return self.cur
log('%08x+%-4d %r\n' % (e.children_ofs, e.children_n,
e.name))
assert(e.children_ofs)
- assert(e.name.endswith('/'))
+ assert e.name[-1] == b'/'
assert(not d.get(e.children_ofs))
d[e.children_ofs] = 1
if e.flags & index.IX_HASHVALID:
assert(e.sha != index.EMPTY_SHA)
assert(e.gitmode)
- assert(not e or e.name == '/') # last entry is *always* /
+ assert not e or bytes(e.name) == b'/' # last entry is *always* /
log('check: checking normal iteration...\n')
last = None
for e in reader:
line += ent.sha.encode('hex') + ' '
if opt.long:
line += "%7s %7s " % (oct(ent.mode), oct(ent.gitmode))
- print line + (name or './')
+ print(line + (name or './'))
if opt.check and (opt['print'] or opt.status or opt.modified or opt.update):
log('check: starting final check.\n')