#!/usr/bin/env python
import sys, math, struct, glob, resource
import tempfile
-from bup import options, git, midx, _helpers
+from bup import options, git, midx, _helpers, xstat
from bup.helpers import *
PAGE_SIZE=4096
if not _first: _first = outdir
dirprefix = (_first != outdir) and git.repo_rel(outdir)+': ' or ''
- log('midx: %s%screating from %d files (%d objects).\n'
- % (dirprefix, prefixstr, len(infilenames), total))
+ debug1('midx: %s%screating from %d files (%d objects).\n'
+ % (dirprefix, prefixstr, len(infilenames), total))
if (opt.auto and (total < 1024 and len(infilenames) < 3)) \
or ((opt.auto or opt.force) and len(infilenames) < 2) \
or (opt.force and not total):
count = merge_into(fmap, bits, total, inp)
del fmap
- f.seek(0, git.SEEK_END)
+ f.seek(0, os.SEEK_END)
f.write('\0'.join(allfilenames))
f.close()
os.rename(outfilename + '.tmp', outfilename)
# sort the biggest+newest midxes first, so that we can eliminate
# smaller (or older) redundant ones that come later in the list
- midxs.sort(key=lambda ix: (-sizes[ix], -os.stat(ix).st_mtime))
+ midxs.sort(key=lambda ix: (-sizes[ix], -xstat.stat(ix).st_mtime))
for mname in midxs:
any = 0