Package: mercurial_on_remote
Execute some Mercurial command on remote repository (ssh/local repositories only).1Example2Arguments3How does it work4Configuration5Problems and limitations6Installation6.1Linux/Unix (from PyPI)6.2Linux/Unix (from source)6.3Windows7History8Repository, bug reports, enhancement suggestions9Additional notes1ExampleMy two main use cases:update remote directory after pushing:hg push staging
hg onremote staging update -r tipcheck status and possibly commit in remote directory:hg onremote rhdevel status
hg onremote rhdevel commit -m 'Forgotten typo'In those examplesstagingandrhdevelare remote paths, mapped
to urls likessh://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   status2ArgumentsGeneral command syntax:hg onremote «remote» «command» «arguments»where«remote»is remote repository alias or path, and remaining arguments
constitute normal mercurial command.Option--sshcan be used just like with push or pull:hg onremote --ssh /custom/ssh staging status3How does it workThe extension simply resolves the specified path, and:if it maps to local directory, executeshg--cwdthat/directory «command» «arguments»if it maps to ssh path, executesssh that/machine hg--cwdthat/directory «command» «arguments»elsewhere (httpor 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 variouspush and updateshell scripts).Caution!You need true ssh access to have it working. Remote repositories,
frombitbuckettomercurial-serverinstallations will usually
reject attempts to run commands (as one could expect).4ConfigurationThere is currently no dedicated configuration.Standard mercurial settings are used to decide how to callsshand which remote command to call to spawn Mercurial (seesshandremotecmdsettings in[ui]section).
This wayonremoteuses the samesshcommand
which is used byhg pushandhg pull, and the same
mercurial name.5Problems and limitationsInteractive 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 tryhg onremote commitadd-m"Some message".NoteAt the moment OnRemote doesn’t initialize full terminal support
(technically, doesn’t addssh-tor similar). It may
change in the future.6InstallationMercurial ≥ 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).6.1Linux/Unix (from PyPI)If you have workingpiporeasy_install:pip install --user mercurial_on_remoteor maybe:sudo pip install mercurial_on_remote(or useeasy_installinstead ofpip). Then activate by:[extensions]
mercurial_on_remote =To upgrade, repeat the same command with--upgradeoption, for
example:pip install --user --upgrade mercurial_on_remote6.2Linux/Unix (from source)If you don’t havepip, or wish to follow development more closely:clone both this repository andmercurial_extension_utilsand 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.pyTo upgrade, pull and update.Seemercurial_extension_utilsfor longer description of this kind
of installation.6.3WindowsIf you have any Python installed, you may install withpip:pip install mercurial_on_remoteStill, as Mercurial (whether taken fromTortoiseHg, 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 itTo upgrade to new version:pip --upgrade mercurial_on_remoteIf 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 clonedSeemercurial_extension_utilsdocumentation for more details on
Windows installation.7HistorySeeHISTORY.rst8Repository, bug reports, enhancement suggestionsDevelopment is tracked on HeptaPod, seehttps://foss.heptapod.net/mercurial/mercurial-on_remote/Use issue tracker there for bug reports and enhancement
suggestions.Thanks toOctobusandClever Cloudfor hosting this service.9Additional notesInformation about this extension is also available
on Mercurial Wiki:http://mercurial.selenic.com/wiki/OnRemoteExtensionCheck alsoother Mercurial extensions I wrote.