]> arthur.barton.de Git - bup.git/blobdiff - cmd/server-cmd.py
vint: remove unnecessary condition
[bup.git] / cmd / server-cmd.py
index c55c46e3942cd2cafe239363a6d3ff5739d3fe89..b1b77297e4977ca21b7c1e2e36adf7c31af621be 100755 (executable)
@@ -9,6 +9,7 @@ from __future__ import absolute_import
 import os, sys, struct, subprocess
 
 from bup import options, git, vfs, vint
+from bup.compat import hexstr
 from bup.git import MissingObject
 from bup.helpers import (Conn, debug1, debug2, linereader, lines_until_sentinel,
                          log)
@@ -131,7 +132,7 @@ def receive_objects_v2(conn, junk):
                     debug1("bup server: suggesting index %s\n"
                            % git.shorten_hash(name))
                     debug1("bup server:   because of object %s\n"
-                           % shar.encode('hex'))
+                           % hexstr(shar))
                     conn.write('index %s\n' % name)
                     suggested.add(name)
                 continue
@@ -219,13 +220,14 @@ def rev_list(conn, _):
     refs = tuple(x[:-1] for x in lines_until_sentinel(conn, '\n', Exception))
     args = git.rev_list_invocation(refs, count=count, format=fmt)
     p = subprocess.Popen(git.rev_list_invocation(refs, count=count, format=fmt),
-                         preexec_fn=git._gitenv(git.repodir),
+                         env=git._gitenv(git.repodir),
                          stdout=subprocess.PIPE)
     while True:
         out = p.stdout.read(64 * 1024)
         if not out:
             break
         conn.write(out)
+    conn.write('\n')
     rv = p.wait()  # not fatal
     if rv:
         msg = 'git rev-list returned error %d' % rv