From: Avery Pennarun Date: Mon, 3 Jan 2011 04:58:35 +0000 (-0800) Subject: Merge branches 'gf/ls', 'gf/tag', 'zz/import-rsnapshot' and 'bl/selfindex' X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=2c955a0a4296e7f23a7d2ba01154f6eb46c9962a;p=packages%2Fb%2Fbup.git Merge branches 'gf/ls', 'gf/tag', 'zz/import-rsnapshot' and 'bl/selfindex' * gf/ls: ls-cmd: hide files with a leading dot by default * gf/tag: Refuse branch/tag names that start with a dot tag-cmd: Some fixups * zz/import-rsnapshot: Adds a testcase for import-rsnapshot. Makes import-rsnapshot use save's -f option. Adds -f option to save to use a given indexfile. Makefile: handle shell commands (cmd/*-cmd.sh) Adds documentation for bup-import-rsnapshot Adds import-rsnapshot command. Adds documentation for save's strip option. Adds testcases for --strip and --strip-path. Adds a strip and strip-path option to bup save. * bl/selfindex: Rename receive-objects command to receive-objects-v2. Write idxs directly rather than using git-index-pack. Send SHAs from the client to reduce server load Use chunkyreader() instead of manually reading multiple blocks. --- 2c955a0a4296e7f23a7d2ba01154f6eb46c9962a diff --cc lib/bup/git.py index 6a65c43,6a65c43,e48bfd3,6a65c43,5f33413..49e9801 --- a/lib/bup/git.py +++ b/lib/bup/git.py @@@@@@ -560,14 -560,14 -560,14 -560,14 -563,25 +563,25 @@@@@@ class PackWriter # but that's okay because we'll flush it in _end(). oneblob = ''.join(datalist) f.write(oneblob) ---- self.outbytes += len(oneblob) ++++ nw = len(oneblob) ++++ crc = zlib.crc32(oneblob) & 0xffffffff ++++ self._update_idx(sha, crc, nw) ++++ self.outbytes += nw self.count += 1 ++++ return nw, crc ++ + - def _write(self, bin, type, content): ++++ def _update_idx(self, sha, crc, size): ++++ assert(sha) ++++ if self.idx: ++++ self.idx[ord(sha[0])].append((sha, crc, self.file.tell() - size)) + -- - def _write(self, bin, type, content): ++++ def _write(self, sha, type, content): if verbose: log('>') ---- self._raw_write(_encode_packobj(type, content)) ---- return bin ++++ if not sha: ++++ sha = calc_hash(type, content) ++++ size, crc = self._raw_write(_encode_packobj(type, content), sha=sha) ++++ return sha def breakpoint(self): """Clear byte and object counts and return the last processed id."""