§
    cÌcR  ã                   óî   — d Z ddlmZmZmZ ddlmZ d„ Z edd¦  «          edd¦  «          ed	d
¦  «          edd¦  «         ej                             dg d¦  «         d„ Z	d„ Z
 e
¦   «          d„ ZdS )a   Upload a working tree, incrementally.

Quickstart
----------

To get started, it's as simple as running::

    brz upload sftp://user@host/location/on/webserver

This will initially upload the whole working tree, and leave a file on the
remote location indicating the last revision that was uploaded
(.bzr-upload.revid), in order to avoid uploading unnecessary information the
next time.

If you would like to upload a specific revision, you just do:

    brz upload -r X  sftp://user@host/location/on/webserver

bzr-upload, just as brz does, will remember the location where you upload the
first time, so you don't need to specify it every time.

If you need to re-upload the whole working tree for some reason, you can:

    brz upload --full sftp://user@host/location/on/webserver

This command only works on the revision beening uploaded is a decendent of the
revision that was previously uploaded, and that they are hence from branches
that have not diverged. Branches are considered diverged if the destination
branch's most recent commit is one that has not been merged (directly or
indirectly) by the source branch.

If branches have diverged, you can use 'brz upload --overwrite' to replace
the other branch completely, discarding its unmerged changes.


Automatically Uploading
-----------------------

bzr-upload comes with a hook that can be used to trigger an upload whenever
the tip of the branch changes, including on commit, push, uncommit etc. This
would allow you to keep the code on the target up to date automatically.

The easiest way to enable this is to run upload with the --auto option.

     brz upload --auto

will enable the hook for this branch. If you were to do a commit in this branch
now you would see it trigger the upload automatically.

If you wish to disable this for a branch again then you can use the --no-auto
option.

     brz upload --no-auto

will disable the feature for that branch.

Since the auto hook is triggered automatically, you can't use the --quiet
option available for the upload command. Instead, you can set the
'upload_auto_quiet' configuration variable to True or False in either
breezy.conf, locations.conf or branch.conf.


Storing the '.bzr-upload.revid' file
------------------------------------

The only bzr-related info uploaded with the working tree is the corresponding
revision id. The uploaded working tree is not linked to any other brz data.

If the layout of your remote server is such that you can't write in the
root directory but only in the directories inside that root, you will need
to use the 'upload_revid_location' configuration variable to specify the
relative path to be used. That configuration variable can be specified in
locations.conf or branch.conf.

For example, given the following layout:

  Project/
    private/
    public/

you may have write access in 'private' and 'public' but in 'Project'
itself. In that case, you can add the following in your locations.conf or
branch.conf file:

  upload_revid_location = private/.bzr-upload.revid


Upload from Remote Location
---------------------------

It is possible to upload to a remote location from another remote location by
specifying it with the --directory option:

    brz upload sftp://public.example.com --directory sftp://private.example.com

This, together with --auto, can be used to upload when you push to your
central branch, rather than when you commit to your local branch.

Note that you will consume more bandwith this way than uploading from a local
branch.

Ignoring certain files
-----------------------

If you want to version a file, but not upload it, you can create a file called
.bzrignore-upload, which works in the same way as the regular .bzrignore file,
but only applies to bzr-upload.


Known Issues
------------

 * Symlinks are not supported (warnings are emitted when they are encountered).


é   )ÚcommandsÚconfigÚhooks)Úversion_infoc                 óH   — t           j                             | d|¦  «         dS )zLazily register an option.úbreezy.plugins.upload.cmdsN)r   Úoption_registryÚregister_lazy)ÚkeyÚmembers     ú@/usr/lib/python3/dist-packages/breezy/plugins/upload/__init__.pyÚregister_optionr   œ   s/   € å
Ô×(Ò(ØÐ)¨6ñ3ô 3ð 3ð 3ð 3ó    Úupload_autoÚauto_optionÚupload_auto_quietÚauto_quiet_optionÚupload_locationÚlocation_optionÚupload_revid_locationÚrevid_location_optionÚ
cmd_uploadr   c                 óP  — ddl m}m}m}m} ddlm} dd l}| j        }| 	                    ¦   «         }| 
                    d¦  «        }	|	€d S | 
                    d¦  «        }
|
sd S | 
                    d¦  «        }|s>|                     |	|                     ¦   «         ¦  «        }|                     d	|¦  «         |                     |	¦  «        }|                     ¦   «         }|j                             |¦  «        } ||||j        |||¬
¦  «        }|                     ¦   «          d S )Nr   )ÚosutilsÚtraceÚ	transportÚurlutilsé   )ÚBzrUploaderé    r   r   r   zAutomatically uploading to %s)Úquiet)Ú r   r   r   r   Úcmdsr   ÚsysÚbranchÚget_config_stackÚgetÚunescape_for_displayÚget_terminal_encodingÚnoteÚget_transportÚlast_revisionÚ
repositoryÚrevision_treeÚstdoutÚupload_tree)Úparamsr   r   r   r   r   r$   Úsource_branchÚconfÚdestinationÚauto_uploadr!   Údisplay_urlÚto_transportr,   Ú	last_treeÚuploaders                    r   Úauto_upload_hookr:   ¬   sŠ  € ð
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð
ð 
ð 
ð 
ð 
ð 
ð €J€J€JØ”M€MØ×)Ò)Ñ+Ô+€DØ—(’(Ð,Ñ-Ô-€KØÐØˆØ—(’(˜=Ñ)Ô)€KØð ØˆØ�HŠHÐ(Ñ)Ô)€EØð AØ×3Ò3Ø˜×6Ò6Ñ8Ô8ñ:ô :ˆà�
Š
Ð2°KÑ@Ô@Ð@Ø×*Ò*¨;Ñ7Ô7€LØ!×/Ò/Ñ1Ô1€MØÔ(×6Ò6°}ÑEÔE€IØˆ{˜=¨,¸¼
Ø$ m¸5ðBñ Bô B€Hà×ÒÑÔÐÐÐr   c                  ó@   — t          j        dddt          d¦  «         d S )Nzbreezy.branchzBranch.hooksÚpost_change_branch_tipz2Auto upload code from a branch when it is changed.)r   Úinstall_lazy_named_hookr:   © r   r   Úinstall_auto_upload_hookr?   Ì   s/   € Ý	Ô!Ø˜Ø Õ"2Ø<ñ>ô >ð >ð >ð >r   c                 óp   — dg}|                      |                      d„ |D ¦   «         ¦  «        ¦  «         |S )NÚtestsc                 óD   — g | ]}d                       t          |¦  «        ‘ŒS )z{}.{})ÚformatÚ__name__)Ú.0Útmns     r   ú
<listcomp>zload_tests.<locals>.<listcomp>ß   s&   € Ð@Ð@Ð@¨3ˆ�Š� #Ñ	&Ô	&Ð@Ð@Ð@r   )ÚaddTestÚloadTestsFromModuleNames)ÚloaderÚbasic_testsÚpatternÚtestmod_namess       r   Ú
load_testsrN   Ö   sV   € ð 	ð
€Mð ×Ò˜×7Ò7Ø@Ð@°-Ð@Ñ@Ô@ñBô Bñ Cô Cð CàÐr   N)Ú__doc__r"   r   r   r   r   r   Úplugin_cmdsr
   r:   r?   rN   r>   r   r   ú<module>rQ      s%  ðð"sð sðBð ð ð ð ð ð ð ð ð ð Ð Ð Ð Ð Ð ð3ð 3ð 3ð €�˜}Ñ -Ô -Ð -Ø €Ð#Ð%8Ñ 9Ô 9Ð 9Ø €Ð!Ð#4Ñ 5Ô 5Ð 5Ø €Ð'Ð)@Ñ AÔ AÐ Að 	Ô × "Ò "Ø�"Ð2ñ4ô 4ð 4ðð ð ð@>ð >ð >ð Ð Ñ Ô Ð ð
ð 
ð 
ð 
ð 
r   