]> arthur.barton.de Git - bup.git/blob - cmd-margin.py
test.sh: don't try non-quick fsck on damaged repositories.
[bup.git] / cmd-margin.py
1 #!/usr/bin/env python
2 import sys
3 import options, git, _hashsplit
4 from helpers import *
5
6
7 optspec = """
8 bup margin
9 """
10 o = options.Options('bup margin', optspec)
11 (opt, flags, extra) = o.parse(sys.argv[1:])
12
13 if extra:
14     log("bup margin: no arguments expected\n")
15     o.usage()
16
17 git.check_repo_or_die()
18 #git.ignore_midx = 1
19
20 mi = git.MultiPackIndex(git.repo('objects/pack'))
21 last = '\0'*20
22 longmatch = 0
23 for i in mi:
24     if i == last:
25         continue
26     #assert(str(i) >= last)
27     pm = _hashsplit.bitmatch(last, i)
28     longmatch = max(longmatch, pm)
29     last = i
30 print longmatch