11 print('data %d' % len(s
))
23 def write_commit(branch
, files
, msg
, parent
=None):
24 print('commit %s' % branch
)
27 auth
= 'X Ample <xa@example.com> %d +0000' % (1000000000 + m
)
28 print('author %s' % auth
)
29 print('committer %s' % auth
)
31 if parent
is not None:
32 print('from :%d' % parent
)
33 for fn
, fm
in sorted(files
.items()):
34 print('M 100644 :%d %s' % (fm
, fn
))
38 def set_ref(ref
, mark
):
39 print('reset %s' % ref
)
40 print('from :%d' % mark
)
44 return ''.join('%d %s\n' % (x
, fn
) for x
in range(10))
51 yield '%02d/%02d/%02d' % (i
, j
, k
)
56 return 'refs/tags/%s' % name
58 files
= {fn
: write_blob(stdblob(fn
)) for fn
in iter_paths()}
59 initial
= write_commit(t('bomb-base'), files
, 'Initial commit')
60 set_ref(t('bomb-top'), initial
)
61 for fn
in iter_paths():
64 {fn
: write_blob(stdblob(fn
) + 'Last line\n')},
65 'Add last line to %s' % fn
,
69 {'woo-hoo.txt': write_blob('woo-hoo\n')},
73 files
= dict((fn
, write_blob('First line\n' + stdblob(fn
))) for fn
in iter_paths())
74 write_commit(t('modify-all'), files
, 'Add first line to all files', parent
=initial
)