/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzr-receive-pack

  • Committer: Martin Pool
  • Date: 2005-06-06 04:17:53 UTC
  • Revision ID: mbp@sourcefrog.net-20050606041753-abe590daf0d7f959
Updated merge patch from Aaron

This patch contains all the changes to merge that I'd like to get into
0.5, namely
* common ancestor BASE selection
* merge reports conflicts when they are encountered
* merge refuses to operate in working trees with changes
* introduces revert command to revert the working tree to the
last-committed state
* Adds some reasonable help text

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python
2
 
import bzrlib
3
 
from bzrlib.plugin import load_plugins
4
 
load_plugins()
5
 
from bzrlib.plugins.git.server import BzrBackend
6
 
from dulwich.server import ReceivePackHandler
7
 
import sys, os
8
 
 
9
 
if len(sys.argv) != 2 or not os.path.isdir(sys.argv[1]):
10
 
    print "usage: git-receive-pack <git-dir>"
11
 
    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()