mercurial-on-remote


Namemercurial-on-remote JSON
Version 1.0.6 PyPI version JSON
download
home_pagehttps://foss.heptapod.net/mercurial/mercurial-on_remote
SummaryMercurial OnRemote Extension
upload_time2024-09-25 06:39:00
maintainerNone
docs_urlNone
authorMarcin Kasperski
requires_pythonNone
licenseBSD
keywords mercurial subdirs multi alias
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. -*- mode: rst; compile-command: "rst2html README.rst README.html" -*-

====================================
Mercurial OnRemote extension
====================================

Execute some Mercurial command on remote repository (ssh/local repositories only).

.. contents::
   :local:
   :depth: 2

.. sectnum::

Example
=====================

My two main use cases:

- update remote directory after pushing::

    hg push staging
    hg onremote staging update -r tip 

- check status and possibly commit in remote directory::

    hg onremote rhdevel status
    hg onremote rhdevel commit -m 'Forgotten typo'

In those examples ``staging`` and ``rhdevel`` are remote paths, mapped
to urls like ``ssh://some.machine.net/repos/myrepo`` (local paths work
too). 

Explicit path works too, but is much less handy::

    hg onremote ssh://euler.mydev.net/repos/myrepo   status

Arguments
======================

General command syntax::

    hg onremote «remote» «command» «arguments»

where ``«remote»`` is remote repository alias or path, and remaining arguments
constitute normal mercurial command.

Option ``--ssh`` can be used just like with push or pull::
 
    hg onremote --ssh /custom/ssh staging status


How does it work
=================================================

The extension simply resolves the specified path, and:

- if it maps to local directory, executes ``hg --cwd that/directory «command» «arguments»``

- if it maps to ssh path, executes ``ssh that/machine hg --cwd that/directory «command» «arguments»``

- elsewhere (``http`` or other remote) it refuses to work.

There is nothing particularly magical, the extension is intended to
save some keystrokes and avoid flow interruption (I wrote it mainly
to stop writing various *push and update* shell scripts).

.. caution::

   You need true ssh access to have it working. Remote repositories,
   from ``bitbucket`` to ``mercurial-server`` installations will usually
   reject attempts to run commands (as one could expect).


Configuration
=================================================

There is currently no dedicated configuration. 

Standard mercurial settings are used to decide how to call
``ssh`` and which remote command to call to spawn Mercurial (see
``ssh`` and ``remotecmd`` settings in ``[ui]`` section). 
This way ``onremote`` uses the same ``ssh`` command
which is used by ``hg push`` and ``hg pull``, and the same
mercurial name.


Problems and limitations
=================================================

Interactive commands may fail to work properly due to lack
of fully working console. 
I recommend avoiding commands which trigger interactive prompts
or editor spawns. If you try ``hg onremote commit`` add ``-m "Some message"``.

.. note::

   At the moment OnRemote doesn't initialize full terminal support
   (technically, doesn't add ``ssh -t`` or similar). It may
   change in the future.

Installation
=================================================

Mercurial ≥ 3.4 is required (attempts to run on older version will
result in crashes) and Mercurial ≥ 4.5 is strongly recommended
(versions 3.4-4.4 involve some hacks which may fail for more
complicated arguments).

Linux/Unix (from PyPI)
~~~~~~~~~~~~~~~~~~~~~~

If you have working ``pip`` or ``easy_install``::

    pip install --user mercurial_on_remote

or maybe::

    sudo pip install mercurial_on_remote

(or use ``easy_install`` instead of ``pip``). Then activate by::

    [extensions]
    mercurial_on_remote =

To upgrade, repeat the same command with ``--upgrade`` option, for
example::

    pip install --user --upgrade mercurial_on_remote

Linux/Unix (from source)
~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you don't have ``pip``, or wish to follow development more closely:

- clone both this repository and `mercurial_extension_utils`_ and put
  them in the same directory, for example::

    cd ~/sources
    hg clone https://foss.heptapod.net/mercurial/mercurial-extension_utils/
    hg clone https://foss.heptapod.net/mercurial/mercurial-on_remote/

- update to newest tags,

- activate by::

    [extensions]
    mercurial_on_remote = ~/sources/mercurial-on_remote/mercurial_on_remote.py

To upgrade, pull and update.

See `mercurial_extension_utils`_ for longer description of this kind
of installation.

Windows
~~~~~~~~~~~~~~~~~~~~~~~

If you have any Python installed, you may install with ``pip``::

    pip install mercurial_on_remote

Still, as Mercurial (whether taken from TortoiseHg_, or own package)
uses it's own bundled Python, you must activate by specifying the path::

    [extensions]
    mercurial_on_remote = C:/Python27/Lib/site-packages/mercurial_on_remote.py
    ;; Or wherever pip installed it

To upgrade to new version::

    pip --upgrade mercurial_on_remote

If you don't have any Python, clone repositories::

    cd c:\hgplugins
    hg clone https://foss.heptapod.net/mercurial/mercurial-extension_utils/
    hg clone https://foss.heptapod.net/mercurial/mercurial-on_remote/

update to tagged versions and activate by path::

    [extensions]
    mercurial_on_remote = C:/hgplugins/mercurial-on_remote/mercurial_on_remote.py
    ;; Or wherever you cloned

See `mercurial_extension_utils`_ documentation for more details on
Windows installation. 

History
==================================================

See `HISTORY.rst`_

Repository, bug reports, enhancement suggestions
===================================================

Development is tracked on HeptaPod, see 
https://foss.heptapod.net/mercurial/mercurial-on_remote/

Use issue tracker there for bug reports and enhancement
suggestions.

Thanks to Octobus_ and `Clever Cloud`_ for hosting this service.

Additional notes
================

Information about this extension is also available
on Mercurial Wiki: http://mercurial.selenic.com/wiki/OnRemoteExtension

Check also `other Mercurial extensions I wrote`_.

.. _Octobus: https://octobus.net/
.. _Clever Cloud: https://www.clever-cloud.com/

.. _other Mercurial extensions I wrote: http://code.mekk.waw.pl/mercurial.html

.. _Mercurial: http://mercurial.selenic.com
.. _HISTORY.rst: https://foss.heptapod.net/mercurial/mercurial-on_remote/src/tip/HISTORY.rst
.. _mercurial_extension_utils: https://pypi.org/project/mercurial-extension_utils/

.. _TortoiseHg: http://tortoisehg.bitbucket.org/


            

Raw data

            {
    "_id": null,
    "home_page": "https://foss.heptapod.net/mercurial/mercurial-on_remote",
    "name": "mercurial-on-remote",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "mercurial subdirs multi alias",
    "author": "Marcin Kasperski",
    "author_email": "Marcin.Kasperski@mekk.waw.pl",
    "download_url": "https://files.pythonhosted.org/packages/29/64/72176663815f137a5a8426fc7a4bf7c8348ca4534b095a041bb8af8fee1e/mercurial_on_remote-1.0.6.tar.gz",
    "platform": null,
    "description": ".. -*- mode: rst; compile-command: \"rst2html README.rst README.html\" -*-\n\n====================================\nMercurial OnRemote extension\n====================================\n\nExecute some Mercurial command on remote repository (ssh/local repositories only).\n\n.. contents::\n   :local:\n   :depth: 2\n\n.. sectnum::\n\nExample\n=====================\n\nMy two main use cases:\n\n- update remote directory after pushing::\n\n    hg push staging\n    hg onremote staging update -r tip \n\n- check status and possibly commit in remote directory::\n\n    hg onremote rhdevel status\n    hg onremote rhdevel commit -m 'Forgotten typo'\n\nIn those examples ``staging`` and ``rhdevel`` are remote paths, mapped\nto urls like ``ssh://some.machine.net/repos/myrepo`` (local paths work\ntoo). \n\nExplicit path works too, but is much less handy::\n\n    hg onremote ssh://euler.mydev.net/repos/myrepo   status\n\nArguments\n======================\n\nGeneral command syntax::\n\n    hg onremote \u00abremote\u00bb \u00abcommand\u00bb \u00abarguments\u00bb\n\nwhere ``\u00abremote\u00bb`` is remote repository alias or path, and remaining arguments\nconstitute normal mercurial command.\n\nOption ``--ssh`` can be used just like with push or pull::\n \n    hg onremote --ssh /custom/ssh staging status\n\n\nHow does it work\n=================================================\n\nThe extension simply resolves the specified path, and:\n\n- if it maps to local directory, executes ``hg --cwd that/directory \u00abcommand\u00bb \u00abarguments\u00bb``\n\n- if it maps to ssh path, executes ``ssh that/machine hg --cwd that/directory \u00abcommand\u00bb \u00abarguments\u00bb``\n\n- elsewhere (``http`` or other remote) it refuses to work.\n\nThere is nothing particularly magical, the extension is intended to\nsave some keystrokes and avoid flow interruption (I wrote it mainly\nto stop writing various *push and update* shell scripts).\n\n.. caution::\n\n   You need true ssh access to have it working. Remote repositories,\n   from ``bitbucket`` to ``mercurial-server`` installations will usually\n   reject attempts to run commands (as one could expect).\n\n\nConfiguration\n=================================================\n\nThere is currently no dedicated configuration. \n\nStandard mercurial settings are used to decide how to call\n``ssh`` and which remote command to call to spawn Mercurial (see\n``ssh`` and ``remotecmd`` settings in ``[ui]`` section). \nThis way ``onremote`` uses the same ``ssh`` command\nwhich is used by ``hg push`` and ``hg pull``, and the same\nmercurial name.\n\n\nProblems and limitations\n=================================================\n\nInteractive commands may fail to work properly due to lack\nof fully working console. \nI recommend avoiding commands which trigger interactive prompts\nor editor spawns. If you try ``hg onremote commit`` add ``-m \"Some message\"``.\n\n.. note::\n\n   At the moment OnRemote doesn't initialize full terminal support\n   (technically, doesn't add ``ssh -t`` or similar). It may\n   change in the future.\n\nInstallation\n=================================================\n\nMercurial \u2265 3.4 is required (attempts to run on older version will\nresult in crashes) and Mercurial \u2265 4.5 is strongly recommended\n(versions 3.4-4.4 involve some hacks which may fail for more\ncomplicated arguments).\n\nLinux/Unix (from PyPI)\n~~~~~~~~~~~~~~~~~~~~~~\n\nIf you have working ``pip`` or ``easy_install``::\n\n    pip install --user mercurial_on_remote\n\nor maybe::\n\n    sudo pip install mercurial_on_remote\n\n(or use ``easy_install`` instead of ``pip``). Then activate by::\n\n    [extensions]\n    mercurial_on_remote =\n\nTo upgrade, repeat the same command with ``--upgrade`` option, for\nexample::\n\n    pip install --user --upgrade mercurial_on_remote\n\nLinux/Unix (from source)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nIf you don't have ``pip``, or wish to follow development more closely:\n\n- clone both this repository and `mercurial_extension_utils`_ and put\n  them in the same directory, for example::\n\n    cd ~/sources\n    hg clone https://foss.heptapod.net/mercurial/mercurial-extension_utils/\n    hg clone https://foss.heptapod.net/mercurial/mercurial-on_remote/\n\n- update to newest tags,\n\n- activate by::\n\n    [extensions]\n    mercurial_on_remote = ~/sources/mercurial-on_remote/mercurial_on_remote.py\n\nTo upgrade, pull and update.\n\nSee `mercurial_extension_utils`_ for longer description of this kind\nof installation.\n\nWindows\n~~~~~~~~~~~~~~~~~~~~~~~\n\nIf you have any Python installed, you may install with ``pip``::\n\n    pip install mercurial_on_remote\n\nStill, as Mercurial (whether taken from TortoiseHg_, or own package)\nuses it's own bundled Python, you must activate by specifying the path::\n\n    [extensions]\n    mercurial_on_remote = C:/Python27/Lib/site-packages/mercurial_on_remote.py\n    ;; Or wherever pip installed it\n\nTo upgrade to new version::\n\n    pip --upgrade mercurial_on_remote\n\nIf you don't have any Python, clone repositories::\n\n    cd c:\\hgplugins\n    hg clone https://foss.heptapod.net/mercurial/mercurial-extension_utils/\n    hg clone https://foss.heptapod.net/mercurial/mercurial-on_remote/\n\nupdate to tagged versions and activate by path::\n\n    [extensions]\n    mercurial_on_remote = C:/hgplugins/mercurial-on_remote/mercurial_on_remote.py\n    ;; Or wherever you cloned\n\nSee `mercurial_extension_utils`_ documentation for more details on\nWindows installation. \n\nHistory\n==================================================\n\nSee `HISTORY.rst`_\n\nRepository, bug reports, enhancement suggestions\n===================================================\n\nDevelopment is tracked on HeptaPod, see \nhttps://foss.heptapod.net/mercurial/mercurial-on_remote/\n\nUse issue tracker there for bug reports and enhancement\nsuggestions.\n\nThanks to Octobus_ and `Clever Cloud`_ for hosting this service.\n\nAdditional notes\n================\n\nInformation about this extension is also available\non Mercurial Wiki: http://mercurial.selenic.com/wiki/OnRemoteExtension\n\nCheck also `other Mercurial extensions I wrote`_.\n\n.. _Octobus: https://octobus.net/\n.. _Clever Cloud: https://www.clever-cloud.com/\n\n.. _other Mercurial extensions I wrote: http://code.mekk.waw.pl/mercurial.html\n\n.. _Mercurial: http://mercurial.selenic.com\n.. _HISTORY.rst: https://foss.heptapod.net/mercurial/mercurial-on_remote/src/tip/HISTORY.rst\n.. _mercurial_extension_utils: https://pypi.org/project/mercurial-extension_utils/\n\n.. _TortoiseHg: http://tortoisehg.bitbucket.org/\n\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "Mercurial OnRemote Extension",
    "version": "1.0.6",
    "project_urls": {
        "Homepage": "https://foss.heptapod.net/mercurial/mercurial-on_remote"
    },
    "split_keywords": [
        "mercurial",
        "subdirs",
        "multi",
        "alias"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "296472176663815f137a5a8426fc7a4bf7c8348ca4534b095a041bb8af8fee1e",
                "md5": "0735a039ffe8b3b488478e234b27be0e",
                "sha256": "365c35bf7855f7110d0380d5f65a83f29bd59c7440ddda82f6b40047a6535ca8"
            },
            "downloads": -1,
            "filename": "mercurial_on_remote-1.0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "0735a039ffe8b3b488478e234b27be0e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 16563,
            "upload_time": "2024-09-25T06:39:00",
            "upload_time_iso_8601": "2024-09-25T06:39:00.200437Z",
            "url": "https://files.pythonhosted.org/packages/29/64/72176663815f137a5a8426fc7a4bf7c8348ca4534b095a041bb8af8fee1e/mercurial_on_remote-1.0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-25 06:39:00",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "mercurial-on-remote"
}
        
Elapsed time: 0.36710s