
                         D   S r SSKJr  SSKJr  SSKJr  SSKrSSKrSSKJr  SSK	J
r
  SSKJr  SS	KJr  SS
KJr  SSKr\
R$                  \
R&                  " \
R(                  R*                  \
R(                  R,                  5       " S S\
R.                  5      5       5       rg)zThe gen_repo_info_file command.    )absolute_import)division)unicode_literalsN)context_util)base)
exceptions)log)filesc                   f    \ rS rSrSrSR                  \R                  S9SS.r\	S 5       r
S rS	rg
)GenRepoInfoFile!   a(  [DEPRECATED] Saves repository information in a file.

DEPRECATED, use `gcloud beta debug source gen-repo-info-file` instead.  The
generated file is an opaque blob representing which source revision the
application was built at, and which Google-hosted repository this revision
will be pushed to.
a            DEPRECATED, use `gcloud beta debug source gen-repo-info-file`
          instead.

          This command generates a {name} file, containing information on the
          source revision and remote repository associated with the given
          source directory.

          {name} contains information on the remote repository: the associated
          Cloud Repository if there is one, or the remote Git repository if
          there is no Cloud Repository.
          namez          To generate repository information file for your app,
          from your source directory run:

            $ {command}
          )DESCRIPTIONEXAMPLESc                     U R                  SSSS9  U R                  SSR                  [        R                  S9S9  U R                  S	S
SS9  g )Nz--source-directory.z?The path to directory containing the source code for the build.)defaulthelpz--output-filez(Deprecated; use --output-directory instead.) Specifies the full name of the output file to contain a single source context.  The file name must be "{name}" in order to work with cloud diagnostic tools.r   )r   z--output-directory zThe directory in which to create the source context file. Defaults to the current directory, or the directory containing --output-file if that option is provided with a file name that includes a directory path.)add_argumentformatr   CONTEXT_FILENAME)parsers    %lib/surface/app/gen_repo_info_file.pyArgsGenRepoInfoFile.ArgsA   sx    
N  P
 9 ;A&!22 ;A ;4  5 )	  +    c           	         [         R                  (       a  [        R                  " S5      e[        R
                  " S5        [        R                  " UR                  5      nUR                  (       aL  [        R
                  " S5        [        R                  R                  UR                  5      nUR                  nOSn[        R                  nU(       d?  UR                  (       a,  UR                  n[        R                  R                  X45      nOSn[        R                   " U5      n["        R$                  " U5        ["        R&                  " U[(        R*                  " USSS95        g )	Nz&This command does not support python3.z]This command is deprecated. Please use `gcloud beta source debug gen-repo-info-file` instead.z@The --output-file option is deprecated and will soon be removed.r   r      T)indent	sort_keys)sixPY3r   NotSupportedPy3Exceptionr	   warningr   CalculateExtendedSourceContextssource_directoryoutput_fileospathdirnamer   output_directoryjoinBestSourceContextr
   MakeDirWriteFileContentsjsondumps)selfargscontextsr-   r)   best_contexts         r   RunGenRepoInfoFile.RunY   s   
ww//
24 4 KK I J;;H 	kk
LN)9)9:$$k 11k			00ggll#3A11(;L	MM"#	TZZQ$GIr    N)__name__
__module____qualname____firstlineno____doc__r   r   r   detailed_helpstaticmethodr   r8   __static_attributes__r:   r   r   r   r   !   sF     f,77f8-* + +.Ir   r   )r?   
__future__r   r   r   r2   r*   googlecloudsdk.appengine.toolsr   googlecloudsdk.callioper   googlecloudsdk.command_lib.appr   googlecloudsdk.corer	   googlecloudsdk.core.utilr
   r#   HiddenReleaseTracksReleaseTrackGABETACommandr   r:   r   r   <module>rO      s     & &  '  	 7 ( 5 # * 
 D%%(($*;*;*@*@ATIdll TI B TIr   