original_docstring: 
      releaser.middle hook to monkey-patch zest.releaser to support signed
      tagging--currently this is the only way to do this.  Also monkey-patches to
      disable an annoyance where zest.releaser only creates .zip source
      distributions.  This is supposedly a workaround for a bug in Python 2.4,
      but we don't care about Python 2.4.
      
docstring: releaser.middle hook to monkey-patch zest.releaser to support signed
  tagging--currently this is the only way to do this.  Also monkey-patches to
  disable an annoyance where zest.releaser only creates .zip source
  distributions.  This is supposedly a workaround for a bug in Python 2.4,
  but we don't care about Python 2.4.
docstring_tokens: releaser . middle hook to monkey - patch zest . releaser to support signed tagging -- currently this is the only way to do this . Also monkey - patches to disable an annoyance where zest . releaser only creates . zip source distributions . This is supposedly a workaround for a bug in Python 2 . 4 but we don ' t care about Python 2 . 4 .
code: def releaser_middle(data):
      """
      releaser.middle hook to monkey-patch zest.releaser to support signed
      tagging--currently this is the only way to do this.  Also monkey-patches to
      disable an annoyance where zest.releaser only creates .zip source
      distributions.  This is supposedly a workaround for a bug in Python 2.4,
      but we don't care about Python 2.4.
      """
  
      if data['name'] != 'asv':
          return
  
      from zest.releaser.git import Git
      from zest.releaser.release import Releaser
  
      # Copied verbatim from zest.releaser, but with the cmd string modified to
      # use the -s option to create a signed tag and add the 'v' in front of the
      # version number
      def _my_create_tag(self, version):
          version = 'v' + version
          msg = "Tagging %s" % (version,)
          cmd = 'git tag -s %s -m "%s"' % (version, msg)
          if os.path.isdir('.git/svn'):
              print("\nEXPERIMENTAL support for git-svn tagging!\n")
              cur_branch = open('.git/HEAD').read().strip().split('/')[-1]
              print("You are on branch %s." % (cur_branch,))
              if cur_branch != 'master':
                  print("Only the master branch is supported for git-svn tagging.")
                  print("Please tag yourself.")
                  print("'git tag' needs to list tag named %s." % (version,))
                  sys.exit()
              cmd = [cmd]
              local_head = open('.git/refs/heads/master').read()
              trunk = open('.git/refs/remotes/trunk').read()
              if local_head != trunk:
                  print("Your local master diverges from trunk.\n")
                  # dcommit before local tagging
                  cmd.insert(0, 'git svn dcommit')
              # create tag in svn
              cmd.append('git svn tag -m "%s" %s' % (msg, version))
          return cmd
  
      # Similarly copied from zest.releaser to support use of 'v' in front
      # of the version number
      def _my_make_tag(self):
          from zest.releaser import utils
  
          if self.data['tag_already_exists']:
              return
          cmds = self.vcs.cmd_create_tag(self.data['version'])
          if not isinstance(cmds, list):
              cmds = [cmds]
          if len(cmds) == 1:
              print("Tag needed to proceed, you can use the following command:")
          for cmd in cmds:
              print(cmd)
              if utils.ask("Run this command"):
                  print(os.system(cmd))
              else:
                  # all commands are needed in order to proceed normally
                  print("Please create a tag for %s yourself and rerun." % \
                          (self.data['version'],))
                  sys.exit()
          if not self.vcs.tag_exists('v' + self.data['version']):
              print("\nFailed to create tag %s!" % (self.data['version'],))
              sys.exit()
  
      # Normally all this does is to return '--formats=zip', which is currently
      # hard-coded as an option to always add to the sdist command; they ought to
      # make this actually optional
      def _my_sdist_options(self):
          return ''
  
      Git.cmd_create_tag = _my_create_tag
      Releaser._make_tag = _my_make_tag
      Releaser._sdist_options = _my_sdist_options
code_tokens: def releaser_middle ( data ) : if data [ 'name' ] != 'asv' : return from zest . releaser . git import Git from zest . releaser . release import Releaser def _my_create_tag ( self , version ) : version = 'v' + version msg = "Tagging %s" % ( version , ) cmd = 'git tag -s %s -m "%s"' % ( version , msg ) if os . path . isdir ( '.git/svn' ) : print ( "\nEXPERIMENTAL support for git-svn tagging!\n" ) cur_branch = open ( '.git/HEAD' ) . read ( ) . strip ( ) . split ( '/' ) [ - 1 ] print ( "You are on branch %s." % ( cur_branch , ) ) if cur_branch != 'master' : print ( "Only the master branch is supported for git-svn tagging." ) print ( "Please tag yourself." ) print ( "'git tag' needs to list tag named %s." % ( version , ) ) sys . exit ( ) cmd = [ cmd ] local_head = open ( '.git/refs/heads/master' ) . read ( ) trunk = open ( '.git/refs/remotes/trunk' ) . read ( ) if local_head != trunk : print ( "Your local master diverges from trunk.\n" ) cmd . insert ( 0 , 'git svn dcommit' ) cmd . append ( 'git svn tag -m "%s" %s' % ( msg , version ) ) return cmd def _my_make_tag ( self ) : from zest . releaser import utils if self . data [ 'tag_already_exists' ] : return cmds = self . vcs . cmd_create_tag ( self . data [ 'version' ] ) if not isinstance ( cmds , list ) : cmds = [ cmds ] if len ( cmds ) == 1 : print ( "Tag needed to proceed, you can use the following command:" ) for cmd in cmds : print ( cmd ) if utils . ask ( "Run this command" ) : print ( os . system ( cmd ) ) else : print ( "Please create a tag for %s yourself and rerun." % ( self . data [ 'version' ] , ) ) sys . exit ( ) if not self . vcs . tag_exists ( 'v' + self . data [ 'version' ] ) : print ( "\nFailed to create tag %s!" % ( self . data [ 'version' ] , ) ) sys . exit ( ) def _my_sdist_options ( self ) : return '' Git . cmd_create_tag = _my_create_tag Releaser . _make_tag = _my_make_tag Releaser . _sdist_options = _my_sdist_options
short_docstring: releaser.middle hook to monkey-patch zest.releaser to support signed
  tagging--currently this is the only way to do this.
short_docstring_tokens: releaser . middle hook to monkey - patch zest . releaser to support signed tagging -- currently this is the only way to do this .
comment: """
      releaser.middle hook to monkey-patch zest.releaser to support signed
      tagging--currently this is the only way to do this.  Also monkey-patches to
      disable an annoyance where zest.releaser only creates .zip source
      distributions.  This is supposedly a workaround for a bug in Python 2.4,
      but we don't care about Python 2.4.
      """$SEP$# Copied verbatim from zest.releaser, but with the cmd string modified to$SEP$# use the -s option to create a signed tag and add the 'v' in front of the$SEP$# version number$SEP$# dcommit before local tagging$SEP$# create tag in svn$SEP$# Similarly copied from zest.releaser to support use of 'v' in front$SEP$# of the version number$SEP$# all commands are needed in order to proceed normally$SEP$# Normally all this does is to return '--formats=zip', which is currently$SEP$# hard-coded as an option to always add to the sdist command; they ought to$SEP$# make this actually optional