remote-bzr: add support for fecthing special modes

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Felipe Contreras
2012-11-11 15:19:57 +01:00
committed by Junio C Hamano
parent 77b71edfb5
commit bdeeb809d7
2 changed files with 59 additions and 11 deletions

View File

@ -198,23 +198,39 @@ def export_files(tree, files):
final = []
for path, fid in files.iteritems():
kind = tree.kind(fid)
h = tree.get_file_sha1(fid)
mode = '100644'
if kind == 'symlink':
d = tree.get_symlink_target(fid)
mode = '120000'
elif kind == 'file':
if tree.is_executable(fid):
mode = '100755'
else:
mode = '100644'
# is the blog already exported?
if h in filenodes:
mark = filenodes[h]
final.append((mode, mark, path))
continue
# is the blob already exported?
if h in filenodes:
mark = filenodes[h]
else:
d = tree.get_file_text(fid)
elif kind == 'directory':
continue
else:
die("Unhandled kind '%s' for path '%s'" % (kind, path))
mark = marks.next_mark()
filenodes[h] = mark
mark = marks.next_mark()
filenodes[h] = mark
print "blob"
print "mark :%u" % mark
print "data %d" % len(d)
print d
print "blob"
print "mark :%u" % mark
print "data %d" % len(d)
print d
final.append((mode, mark, path))