#NEWLINE# def iterate_revisions( self , upper , lower ) : #NEWLINE# #INDENT# "Iterate through script revisions, starting at the given\n        upper revision identifier and ending at the lower.\n\n        The traversal uses strictly the `down_revision`\n        marker inside each migration script, so\n        it is a requirement that upper >= lower,\n        else you'll get nothing back.\n\n        The iterator yields :class:`.Script` objects.\n\n        " #NEWLINE# if ( ( upper is not None ) and _relative_destination . match ( upper ) ) : #NEWLINE# #INDENT# relative = int ( upper ) #NEWLINE# revs = list ( self . _iterate_revisions ( 'head' , lower ) ) #NEWLINE# revs = revs [ ( - relative ) : ] #NEWLINE# if ( len ( revs ) != abs ( relative ) ) : #NEWLINE# #INDENT# raise util . CommandError ( ( "Relative revision %s didn't produce %d migrations" % ( upper , abs ( relative ) ) ) ) #NEWLINE# #UNINDENT# return iter ( revs ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( lower is not None ) and _relative_destination . match ( lower ) ) : #NEWLINE# #INDENT# relative = int ( lower ) #NEWLINE# revs = list ( self . _iterate_revisions ( upper , 'base' ) ) #NEWLINE# revs = revs [ 0 : ( - relative ) ] #NEWLINE# if ( len ( revs ) != abs ( relative ) ) : #NEWLINE# #INDENT# raise util . CommandError ( ( "Relative revision %s didn't produce %d migrations" % ( lower , abs ( relative ) ) ) ) #NEWLINE# #UNINDENT# return iter ( revs ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return self . _iterate_revisions ( upper , lower )