original_docstring: Archive a git repo snapshot in the given archive file.
docstring: Archive a git repo snapshot in the given archive file.
docstring_tokens: Archive a git repo snapshot in the given archive file .
code: def git_archive_repo(archivename, archivepath, repopath, repo_sha):
      """Archive a git repo snapshot in the given archive file."""
  
      try:
          with open(archivename, 'r') as _archivefile:
              LOGGER.info(archivename + ' already exists. Skipping ...')
      except IOError as exc:
          if exc.errno == errno.ENOENT:
              os.chdir(archivepath)
              LOGGER.info('Archiving ' + archivename)
              os.chdir(repopath)
              # git archive --format=tar.gz --output=arch.tar.gz \
              # --remote=./openFrameworks/ sha
              outpath = os.path.abspath(os.path.join(archivepath, archivename))
              prefixpath = os.path.basename(repopath) + os.sep
              subprocess.call(['git', 'archive', '--format=tar.gz',
                               '--output=' + outpath,
                               '--prefix=' + prefixpath, repo_sha])
              # This doesn't work with the remote option, since git repos don't
              # allow clients access to arbitrary sha's, only named ones.
              # Solution: go to repo directory, use -o to put resulting file into
              # right path
              # cf. http://git.661346.n2.nabble.com/Passing-
              # commit-IDs-to-git-archive-td7359753.html
              # TODO: error catching
              os.chdir(archivepath)
          else:  # pragma: no cover
              raise
code_tokens: def git_archive_repo ( archivename , archivepath , repopath , repo_sha ) : try : with open ( archivename , 'r' ) as _archivefile : LOGGER . info ( archivename + ' already exists. Skipping ...' ) except IOError as exc : if exc . errno == errno . ENOENT : os . chdir ( archivepath ) LOGGER . info ( 'Archiving ' + archivename ) os . chdir ( repopath ) outpath = os . path . abspath ( os . path . join ( archivepath , archivename ) ) prefixpath = os . path . basename ( repopath ) + os . sep subprocess . call ( [ 'git' , 'archive' , '--format=tar.gz' , '--output=' + outpath , '--prefix=' + prefixpath , repo_sha ] ) os . chdir ( archivepath ) else : raise
short_docstring: Archive a git repo snapshot in the given archive file.
short_docstring_tokens: Archive a git repo snapshot in the given archive file .
comment: """Archive a git repo snapshot in the given archive file."""$SEP$# git archive --format=tar.gz --output=arch.tar.gz \$SEP$# --remote=./openFrameworks/ sha$SEP$# This doesn't work with the remote option, since git repos don't$SEP$# allow clients access to arbitrary sha's, only named ones.$SEP$# Solution: go to repo directory, use -o to put resulting file into$SEP$# right path$SEP$# cf. http://git.661346.n2.nabble.com/Passing-$SEP$# commit-IDs-to-git-archive-td7359753.html$SEP$# TODO: error catching$SEP$# pragma: no cover