]> arthur.barton.de Git - bup.git/commitdiff
Rename PackIndex->PackIdx and MultiPackIndex->PackIdxList. bup-0.12
authorAvery Pennarun <apenwarr@gmail.com>
Mon, 1 Mar 2010 00:07:00 +0000 (19:07 -0500)
committerAvery Pennarun <apenwarr@gmail.com>
Mon, 1 Mar 2010 00:07:00 +0000 (19:07 -0500)
This corresponds to the PackMidx renaming I did earlier, and helps avoid
confusion between index.py (which talks to the 'bupindex' file and has
nothing to do with packs) and git.py (which talks to packs and has nothing
to do with the bupindex).  Now pack indexes are always called Idx, and the
bupindex is always Index.

Furthermore, MultiPackIndex could easily be assumed to be the same thing as
a Midx, which it isn't.  PackIdxList is a more accurate description of what
it is: a list of pack indexes.  A Midx is an index of a list of packs.

cmd/margin-cmd.py
cmd/memtest-cmd.py
cmd/midx-cmd.py
cmd/server-cmd.py
lib/bup/client.py
lib/bup/git.py
t/tgit.py

index 85b32890b493ea4df2ea4cd8b0f661d8f2253c4e..2564027c1d6363c0fab9adabf568a2ed38c212df 100755 (executable)
@@ -16,7 +16,7 @@ if extra:
 git.check_repo_or_die()
 #git.ignore_midx = 1
 
-mi = git.MultiPackIndex(git.repo('objects/pack'))
+mi = git.PackIdxList(git.repo('objects/pack'))
 last = '\0'*20
 longmatch = 0
 for i in mi:
index cf106e42afa82c2c0927b8dad54e25393d11729f..7ad09e558176eceeeafdb2b93a5562a3058daea8 100755 (executable)
@@ -40,7 +40,7 @@ if extra:
 git.ignore_midx = opt.ignore_midx
 
 git.check_repo_or_die()
-m = git.MultiPackIndex(git.repo('objects/pack'))
+m = git.PackIdxList(git.repo('objects/pack'))
 
 cycles = opt.cycles or 100
 number = opt.number or 10000
index 871111196c9ecabba994106da2e76a705c8749e9..490a34d5f2556415e0c99b5675bd755c44759878 100755 (executable)
@@ -25,7 +25,7 @@ def do_midx(outdir, outfilename, infilenames):
     inp = []
     total = 0
     for name in infilenames:
-        ix = git.PackIndex(name)
+        ix = git.PackIdx(name)
         inp.append(ix)
         total += len(ix)
 
@@ -100,7 +100,7 @@ elif opt.auto or opt.force:
         if opt.force:
             do_midx(path, opt.output, glob.glob('%s/*.idx' % path))
         elif opt.auto:
-            m = git.MultiPackIndex(path)
+            m = git.PackIdxList(path)
             needed = {}
             for pack in m.packs:  # only .idx files without a .midx are open
                 if pack.name.endswith('.idx'):
index 59459d1fa3f2215b45ba520996659191fe662f6a..3fea0a9346f8c3b992c51aec3ccb749456fa11ff 100755 (executable)
@@ -30,7 +30,7 @@ def send_index(conn, name):
     git.check_repo_or_die()
     assert(name.find('/') < 0)
     assert(name.endswith('.idx'))
-    idx = git.PackIndex(git.repo('objects/pack/%s' % name))
+    idx = git.PackIdx(git.repo('objects/pack/%s' % name))
     conn.write(struct.pack('!I', len(idx.map)))
     conn.write(idx.map)
     conn.ok()
index 6df1358a4311076d2b96fced693c45cb81721dc2..cbd007a275dca2532eacdee608c34a3153407d55 100644 (file)
@@ -142,7 +142,7 @@ class Client:
         self._busy = None
         #self.sync_indexes()
         self._busy = ob
-        return git.MultiPackIndex(self.cachedir)
+        return git.PackIdxList(self.cachedir)
 
     def _suggest_pack(self, indexname):
         log('received index suggestion: %s\n' % indexname)
index c755dc5c0f6fac88d4af5c198953505ce282a739..4c5a6acb6f58639d091eb542e1799729e817393f 100644 (file)
@@ -81,7 +81,7 @@ def _decode_packobj(buf):
     return (type, zlib.decompress(buf[i+1:]))
 
 
-class PackIndex:
+class PackIdx:
     def __init__(self, filename):
         self.name = filename
         self.map = mmap_read(open(filename))
@@ -201,7 +201,7 @@ class PackMidx:
 
 
 _mpi_count = 0
-class MultiPackIndex:
+class PackIdxList:
     def __init__(self, dir):
         global _mpi_count
         assert(_mpi_count == 0) # these things suck tons of VM; don't waste it
@@ -269,9 +269,9 @@ class MultiPackIndex:
             for f in os.listdir(self.dir):
                 full = os.path.join(self.dir, f)
                 if f.endswith('.idx') and not d.get(full):
-                    self.packs.append(PackIndex(full))
+                    self.packs.append(PackIdx(full))
                     d[full] = 1
-        log('MultiPackIndex: using %d index%s.\n' 
+        log('PackIdxList: using %d index%s.\n' 
             % (len(self.packs), len(self.packs)!=1 and 'es' or ''))
 
     def add(self, hash):
@@ -337,7 +337,7 @@ class PackWriter:
             if self.objcache_maker:
                 self.objcache = self.objcache_maker()
             else:
-                self.objcache = MultiPackIndex(repo('objects/pack'))
+                self.objcache = PackIdxList(repo('objects/pack'))
 
     def _open(self):
         if not self.file:
index f43ab53551ae5e083cf43b1cbc42f1b97a3e3139..2ff71ba385d0c20f8f0b88008d91f2b1757df0ae 100644 (file)
--- a/t/tgit.py
+++ b/t/tgit.py
@@ -42,7 +42,7 @@ def testpacks():
     WVPASS(os.path.exists(nameprefix + '.pack'))
     WVPASS(os.path.exists(nameprefix + '.idx'))
 
-    r = git.PackIndex(nameprefix + '.idx')
+    r = git.PackIdx(nameprefix + '.idx')
     print repr(r.fanout)
 
     for i in range(nobj):
@@ -56,7 +56,7 @@ def testpacks():
 
     WVFAIL(r.find_offset('\0'*20))
 
-    r = git.MultiPackIndex('pybuptest.tmp/objects/pack')
+    r = git.PackIdxList('pybuptest.tmp/objects/pack')
     WVPASS(r.exists(hashes[5]))
     WVPASS(r.exists(hashes[6]))
     WVFAIL(r.exists('\0'*20))