From: Avery Pennarun Date: Mon, 3 Jan 2011 04:38:44 +0000 (-0800) Subject: Rename receive-objects command to receive-objects-v2. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=e0d4038840359291c5e313a94a7e5dacaa8cb7f6;p=packages%2Fb%2Fbup.git Rename receive-objects command to receive-objects-v2. ...since it's incompatible with the old one. That will make it die more spectacularly when talking to an old-style server, rather than failing in more confusing ways. Theoretically we could do fancy things like making our server support both variants of receive-objects, but hey, bup is a pre-release, it shouldn't be acquiring backwards compatibility cruft *already* :) Signed-off-by: Avery Pennarun --- diff --git a/cmd/server-cmd.py b/cmd/server-cmd.py index 03667a2..e44f302 100755 --- a/cmd/server-cmd.py +++ b/cmd/server-cmd.py @@ -36,7 +36,7 @@ def send_index(conn, name): conn.ok() -def receive_objects(conn, junk): +def receive_objects_v2(conn, junk): global suspended_w git.check_repo_or_die() suggested = {} @@ -165,7 +165,7 @@ commands = { 'set-dir': set_dir, 'list-indexes': list_indexes, 'send-index': send_index, - 'receive-objects': receive_objects, + 'receive-objects-v2': receive_objects_v2, 'read-ref': read_ref, 'update-ref': update_ref, 'cat': cat, diff --git a/lib/bup/client.py b/lib/bup/client.py index aa9978b..c65ec0c 100644 --- a/lib/bup/client.py +++ b/lib/bup/client.py @@ -169,20 +169,20 @@ class Client: debug1('client: received index suggestion: %s\n' % indexname) ob = self._busy if ob: - assert(ob == 'receive-objects') + assert(ob == 'receive-objects-v2') self.conn.write('\xff\xff\xff\xff') # suspend receive-objects self._busy = None self.conn.drain_and_check_ok() self.sync_index(indexname) if ob: self._busy = ob - self.conn.write('receive-objects\n') + self.conn.write('receive-objects-v2\n') def new_packwriter(self): self.check_busy() def _set_busy(): - self._busy = 'receive-objects' - self.conn.write('receive-objects\n') + self._busy = 'receive-objects-v2' + self.conn.write('receive-objects-v2\n') return PackWriter_Remote(self.conn, objcache_maker = self._make_objcache, suggest_pack = self._suggest_pack,