Skip to main content

Upload snapshots of a revision to one or more FTP server

Project description

====
Info
====

Upload snapshots of a revision to one or more FTP server.

It will upload all files of a revision and set a (local) tag like
``uploaded@host``. If it will find an existing tag for that host it
will remove vanished files and upload only the difference between
that revision and the new one.

-----
Notes
-----

If an error happens on server-side on deleting or CHMODing a file
it will only print a warning about that but it will abort if it can't
upload a files or create a directory.
Since Mercurial doesn't track directories it won't delete existing
directories on server even there is no file anymore.

---------
Important
---------

This is **not** a command for push/pull over ftp!


====
hgrc
====

-----------
``[paths]``
-----------

You can add multiple destinations to ``[paths]`` like in push/pull::

[paths]
ftp = ftp://[user[:pass]@]host[:port]/[path]
myhost = ftp://andre@incubo.de/htdocs

* You can select it like: ``hg ftp myhost``
* Or you can provide a complete URL: ``hg ftp ftp://user:psw@host/basedir``

If you don't provide a ``destination`` commandline argument, hgftp will use ``ftp`` in ``[paths]`` by default.

If your username contains an ``@`` character, encode it as ``%40`` to avoid confusing Python's ``urlsplit()`` function.

---------
``[ftp]``
---------

If you add ``chmod_file`` or ``chmod_dir`` it will ``CHMOD`` it on upload. If there is no option for chmod the extension won't call ``SITE CHMOD`` on ftp server.

::

[ftp]
chmod_file = 644
chmod_dir = 755
global_tags = False
prefix_tags = uploaded@


=======
Options
=======

There are some options that can overwrite settings in your hgrc::

-a --all upload all files of a changeset; do not use the difference
-d --dir CHMOD new directories to given mode
-f --file CHMOD new/changed files to given mode
-g --global make the tag global
-o --only only upload or remove files; do not set a tag
-r --rev revision that will be uploaded
-s --show show files that will be uploaded or deleted
-t --tag use another tag name
-u --upload start uploading or removing changed files

The extension will only start uploading / removing your files if you provide ``--upload`` as an option. A tag will only be set if upload was successful.

If ``--rev`` is not provided it will use the current revision of your working dir. But it won't use uncommitted changes of that working dir. There will be no prefix if you use ``--tag``!


========
Use Case
========

My use case for this plugin is to manage uploads of websites. If you have your website (.html, .php, etc.) under mercurial control you can easily upload snapshots to your provider. If you change something on your site you only need to upload the difference of the last uploaded snapshot and the current/selected revision without to do it yourself.

1. Add your website files to mercurial
2. Upload initial snapshot to ftp server (set ``uploaded@host`` tag)
3. Do many commits to your website files
4. Upload only new/changed files to your last uploaded snapshot (and remove vanished files)

Really useful if you use a modified version of existing open source wikis/forums/cms and wants to be in sync with upstream changes.

Just commit upstream changes to branch ``vanilla`` and your modified version will be in ``default``. So you can merge it on new upstream versions and use this extension to upload your synced snapshot.

=======
CHANGES
=======

-------------------
v0.1.1 (2014-08-23)
-------------------

* Added this CHANGES file and a description for PyPI (devurandom)


-----------------
v0.1 (2014-08-23)
-----------------

First packaged version. Changes compared to the original 2012 version by André Klitzing (misery):

* automatic backups of remote files (jaltek)
* documentation and metadata updates, confirming to current Mercurial extension guidelines (devurandom)
* setuptools packaging (devurandom)
* bugfixes (devurandom)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hgftp-0.1.1.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hgftp-0.1.1-py2.py3-none-any.whl (9.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file hgftp-0.1.1.tar.gz.

File metadata

  • Download URL: hgftp-0.1.1.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for hgftp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1ef84392c508a4c179849ca55799465e8cfd711ab5cd467c559faa303160d000
MD5 3d53325f7fdee8598b4101195b94a420
BLAKE2b-256 ea68779cd520029fe3e87d084e443e4835459eae39dd69519ca8248c96452d28

See more details on using hashes here.

File details

Details for the file hgftp-0.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for hgftp-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d76ba90adeadb3a518f939e0f02893580ca35a7fe3e061df3de31b83f7d5786a
MD5 1c42a276433c19a282d6ac90ec927002
BLAKE2b-256 48746e79a33bc8ccd6757f4f78decb01672a6c5ea1adecf7fe88581313f5d775

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page