]> arthur.barton.de Git - bup.git/blobdiff - cmd/midx-cmd.py
Add vfs2 and rewrite restore to use it
[bup.git] / cmd / midx-cmd.py
index eb558f88ca8c0defc932bc2c5ddd8531a600e172..0224ab40238f3239c937d5b53f67e85a4802fa02 100755 (executable)
@@ -4,10 +4,14 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
-import sys, math, struct, glob, resource
-import tempfile
+
+import glob, math, os, resource, struct, sys, tempfile
+
 from bup import options, git, midx, _helpers, xstat
-from bup.helpers import *
+from bup.helpers import (Sha1, add_error, atomically_replaced_file, debug1, fdatasync,
+                         handle_ctrl_c, log, mmap_readwrite, qprogress,
+                         saved_errors, unlink)
+
 
 PAGE_SIZE=4096
 SHA_PER_PAGE=PAGE_SIZE/20.
@@ -46,7 +50,7 @@ def check_midx(name):
     log('Checking %s.\n' % nicename)
     try:
         ix = git.open_idx(name)
-    except git.GitError, e:
+    except git.GitError as e:
         add_error('%s: %s' % (name, e))
         return
     for count,subname in enumerate(ix.idxnames):
@@ -149,7 +153,7 @@ def _do_midx(outdir, outfilename, infilenames, prefixstr):
         print p.idxnames
         assert(len(p) == total)
         for pe, e in p, git.idxmerge(inp, final_progress=False):
-            pin = pi.next()
+            pin = next(pi)
             assert(i == pin)
             assert(p.exists(i))