|Mac OS X||Yes|
Upload a working tree, incrementally.
To get started, it’s as simple as running:
bzr 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:
bzr upload -r X sftp://user@host/location/on/webserver
bzr-upload, just as bzr 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:
bzr 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 ‘bzr upload –overwrite’ to replace the other branch completely, discarding its unmerged changes.
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.
bzr 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.
bzr 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 bazaar.conf, locations.conf or branch.conf.
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 bzr 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:
- 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
It is possible to upload to a remote location from another remote location by specifying it with the –directory option:
bzr upload ftp://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.
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.
While we don’t have any platform setup, you can branch from trunk:
bzr branch lp:bzr-upload
And change anything you’d like, and file a merge proposal on Launchpad.
- Symlinks are not supported (warnings are emitted when they are encountered).
Upload a working tree, as a whole or incrementally.
bzr upload [LOCATION]
|--full||Upload the full working tree.|
|-v, --verbose||Display more information.|
|--remember||Remember the specified location as a default.|
|--auto||Trigger an upload from this branch whenever the tip revision changes.|
|-h, --help||Show help message.|
|-q, --quiet||Do not output what is being done.|
|-d ARG, --directory=ARG|
|Branch to upload from, rather than the one containing the working directory.|
|--usage||Show usage message and options.|
|--overwrite||Ignore differences between branches and overwrite unconditionally.|
|-r ARG, --revision=ARG|
|See “help revisionspec” for details.|
If no destination is specified use the last one used. If no revision is specified upload the changes since the last upload.
Changes include files added, renamed, modified or removed.