def upload_pack(path='.', inf=None, outf=None):
 if (outf is None):
  outf = getattr(sys.stdout, 'buffer', sys.stdout)
 if (inf is None):
  inf = getattr(sys.stdin, 'buffer', sys.stdin)
 backend = FileSystemBackend(path)
 def send_fn(data):
  outf.write(data)
  outf.flush()
 proto = Protocol(inf.read, send_fn)
 handler = UploadPackHandler(backend, [path], proto)
 handler.handle()
 return 0

def upload_pack ( path = '.' , inf = None , outf = None ) : if ( outf is None ) : outf = getattr ( sys . stdout , 'buffer' , sys . stdout ) if ( inf is None ) : inf = getattr ( sys . stdin , 'buffer' , sys . stdin ) backend = FileSystemBackend ( path ) def send_fn ( data ) : outf . write ( data ) outf . flush ( ) proto = Protocol ( inf . read , send_fn ) handler = UploadPackHandler ( backend , [ path ] , proto ) handler . handle ( ) return 0
upload a pack file after negotiating its contents using smart protocol .