mirror of
https://github.com/frej/fast-export.git
synced 2026-01-14 10:12:05 +01:00
hg-fast-export.py: Use appropriate file mode for symlinks.
This commit is contained in:
committed by
Rocco Rutte
parent
8be4e6b3d0
commit
e8ba36aa3f
@@ -18,8 +18,8 @@ cfg_checkpoint_count=0
|
||||
# write some progress message every this many file contents written
|
||||
cfg_export_boundary=1000
|
||||
|
||||
def gitmode(x):
|
||||
return x and '100755' or '100644'
|
||||
def gitmode(flags):
|
||||
return 'l' in flags and '120000' or 'x' in flags and '100755' or '100644'
|
||||
|
||||
def wr(msg=''):
|
||||
if msg == None:
|
||||
@@ -117,7 +117,7 @@ def export_file_contents(ctx,manifest,files):
|
||||
max=len(files)
|
||||
for file in files:
|
||||
d=ctx.filectx(file).data()
|
||||
wr('M %s inline %s' % (gitmode(manifest.execf(file)),file))
|
||||
wr('M %s inline %s' % (gitmode(manifest.flags(file)),file))
|
||||
wr('data %d' % len(d)) # had some trouble with size()
|
||||
wr(d)
|
||||
count+=1
|
||||
|
||||
Reference in New Issue
Block a user