98
98
except ApplyDeltaError, e:
99
99
print "\t%s: Unable to apply delta: %r" % (name, e)
102
def cmd_dump_index(args):
103
from dulwich.index import Index
105
opts, args = getopt(args, "", [])
108
print "Usage: dulwich dump-pack FILENAME"
112
idx = Index(filename)
119
from dulwich.repo import Repo
122
opts, args = getopt(args, "", ["--bare"])
130
if not os.path.exists(path):
140
from dulwich.client import TCPGitClient, SimpleFetchGraphWalker
141
from dulwich.repo import Repo
144
opts, args = getopt(args, "", [])
148
print "usage: dulwich clone host:path [PATH]"
151
if not ":" in args[0]:
152
print "Usage: dulwich clone host:path [PATH]"
154
(host, host_path) = args.pop(0).split(":", 1)
155
client = TCPGitClient(host)
160
path = host_path.split("/")[-1]
162
if not os.path.exists(path):
166
determine_wants = lambda x: [y for y in x.values() if not y in r.object_store]
167
graphwalker = SimpleFetchGraphWalker(r.heads().values(), r.get_parents)
168
f, commit = r.object_store.add_pack()
170
client.fetch_pack(host_path, determine_wants, graphwalker, f.write,
102
180
"fetch-pack": cmd_fetch_pack,
103
181
"dump-pack": cmd_dump_pack,
182
"dump-index": cmd_dump_index,
107
188
if len(sys.argv) < 2: