]> arthur.barton.de Git - bup.git/commitdiff
Merge branches 'gf/ls', 'gf/tag', 'zz/import-rsnapshot' and 'bl/selfindex' bup-0.21-rc1
authorAvery Pennarun <apenwarr@gmail.com>
Mon, 3 Jan 2011 04:58:35 +0000 (20:58 -0800)
committerAvery Pennarun <apenwarr@gmail.com>
Mon, 3 Jan 2011 04:58:35 +0000 (20:58 -0800)
* 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.

1  2  3  4  5 
cmd/save-cmd.py
lib/bup/git.py
t/test.sh

diff --cc cmd/save-cmd.py
Simple merge
diff --cc lib/bup/git.py
index 6a65c435450233702dea291113c417e423c0419f,6a65c435450233702dea291113c417e423c0419f,e48bfd3ddfe5516b78723e7cb9feff1ce261c549,6a65c435450233702dea291113c417e423c0419f,5f334133fbf68e72d2ecd073aef522136fbb0fcf..49e98019c2927c023de97a8683a6f4992c08c518
@@@@@@ -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
  -      def _write(self, bin, type, content):
++++         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, 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."""
diff --cc t/test.sh
Simple merge