~ubuntu-branches/debian/jessie/bzr-git/jessie

« back to all changes in this revision

Viewing changes to bzr-receive-pack

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2011-01-21 22:15:09 UTC
  • mfrom: (1.1.13 upstream) (8.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20110121221509-f132fmma13dpxcw1
* New upstream release.
* Run testsuite as part of build.
* Mark as only supporting Python >= 2.4.
* Add Enhances: bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/env python
 
2
 
2
3
import bzrlib
3
4
from bzrlib.plugin import load_plugins
4
5
load_plugins()
5
6
from bzrlib.plugins.git.server import BzrBackend
6
 
from dulwich.server import ReceivePackHandler
 
7
from dulwich.server import ReceivePackHandler, serve_command
7
8
import sys, os
8
9
 
9
 
if len(sys.argv) != 2 or not os.path.isdir(sys.argv[1]):
10
 
    print "usage: git-receive-pack <git-dir>"
 
10
if len(sys.argv) < 2:
 
11
    print >>sys.stderr, "usage: %s <git-dir>" % os.path.basename(sys.argv[0])
11
12
    sys.exit(1)
12
 
 
13
 
backend = BzrBackend(bzrlib.transport.get_transport(sys.argv[1]))
14
 
 
15
 
def write_fn(data):
16
 
    sys.stdout.write(data)
17
 
    sys.stdout.flush()
18
 
 
19
 
server = ReceivePackHandler(backend, sys.stdin.read, write_fn)
20
 
server.handle()
 
13
 
 
14
backend = BzrBackend(bzrlib.transport.get_transport("/"))
 
15
sys.exit(serve_command(ReceivePackHandler, backend=backend))