@ -36,9 +36,10 @@ changes = [FileChanges('M', 'world', world.id, mode="100644"),
when = datetime ( year = 2005 , month = 4 , day = 7 ,
hour = 15 , minute = 16 , second = 10 ,
tzinfo = FixedTimeZone ( " -0700 " ) )
when_string = repo_filter . date_to_string ( when )
commit1 = Commit ( " refs/heads/master " ,
" A U Thor " , " au@thor.email " , when ,
" Com M. Iter " , " comm@iter.email " , when ,
" A U Thor " , " au@thor.email " , when _string ,
" Com M. Iter " , " comm@iter.email " , when _string ,
" My first commit! Wooot! \n \n Longer description " ,
changes ,
from_commit = None ,
@ -53,9 +54,10 @@ world_link.dump(output)
changes = [ FileChanges ( ' M ' , ' world ' , world . id , mode = " 100644 " ) ,
FileChanges ( ' M ' , ' planet ' , world_link . id , mode = " 120000 " ) ]
when + = timedelta ( days = 3 , hours = 4 , minutes = 6 )
when_string = repo_filter . date_to_string ( when )
commit2 = Commit ( " refs/heads/master " ,
" A U Thor " , " au@thor.email " , when ,
" Com M. Iter " , " comm@iter.email " , when ,
" A U Thor " , " au@thor.email " , when _string ,
" Com M. Iter " , " comm@iter.email " , when _string ,
" Make a symlink to world called planet, modify world " ,
changes ,
from_commit = commit1 . id ,
@ -66,10 +68,10 @@ script = Blob("#!/bin/sh\n\necho Hello")
script . dump ( output )
changes = [ FileChanges ( ' M ' , ' runme ' , script . id , mode = " 100755 " ) ,
FileChanges ( ' D ' , ' bar ' ) ]
when = datetime . fromtimestamp ( timestamp = 1234567890 , tz = FixedTimeZone ( " -0700 " ) )
when _string = " 1234567890 -0700 "
commit3 = Commit ( " refs/heads/master " ,
" A U Thor " , " au@thor.email " , when ,
" Com M. Iter " , " comm@iter.email " , when ,
" A U Thor " , " au@thor.email " , when _string ,
" Com M. Iter " , " comm@iter.email " , when _string ,
" Add runme script, remove bar " ,
changes ,
from_commit = commit2 . id ,
@ -89,9 +91,10 @@ world.dump(output)
changes = [ FileChanges ( ' M ' , ' world ' , world . id , mode = " 100644 " ) ]
when = datetime ( 2006 , 8 , 17 , tzinfo = FixedTimeZone ( " +0200 " ) )
when_string = repo_filter . date_to_string ( when )
commit4 = Commit ( " refs/heads/devel " ,
" A U Thor " , " au@thor.email " , when ,
" Com M. Iter " , " comm@iter.email " , when ,
" A U Thor " , " au@thor.email " , when _string ,
" Com M. Iter " , " comm@iter.email " , when _string ,
" Modify world " ,
changes ,
from_commit = commit1 . id ,
@ -100,7 +103,8 @@ commit4.dump(output)
world = Blob ( " Hello \n Hi \n Goodbye " )
world . dump ( output )
when = commit3 . author_date + timedelta ( days = 47 )
when = repo_filter . string_to_date ( commit3 . author_date ) + timedelta ( days = 47 )
when_string = repo_filter . date_to_string ( when )
# git fast-import requires file changes to be listed in terms of differences
# to the first parent. Thus, despite the fact that runme and planet have
# not changed and bar was not modified in the devel side, we have to list them
@ -111,8 +115,8 @@ changes = [FileChanges('M', 'world', world.id, mode="100644"),
FileChanges ( ' M ' , ' planet ' , world_link . id , mode = " 120000 " ) ]
commit5 = Commit ( " refs/heads/devel " ,
" A U Thor " , " au@thor.email " , when ,
" Com M. Iter " , " comm@iter.email " , when ,
" A U Thor " , " au@thor.email " , when _string ,
" Com M. Iter " , " comm@iter.email " , when _string ,
" Merge branch ' master ' \n " ,
changes ,
from_commit = commit4 . id ,
@ -121,7 +125,7 @@ commit5.dump(output)
mytag = Tag ( " refs/tags/v1.0 " , commit5 . id ,
" His R. Highness " , " royalty@my.kingdom " , when ,
" His R. Highness " , " royalty@my.kingdom " , when _string ,
" I bequeath to my peons this royal software " )
mytag . dump ( output )
out . finish ( )