3187
Comment: Mercurial Remote Sync (hg-rsync) extension
|
3217
Fix order of wording.
|
Deletions are marked like this. | Additions are marked like this. |
Line 11: | Line 11: |
Mercurial Remote Sync (hg-rsync) provides some methods to keep remote files, that exist outside of the repository, in sync with your working directory. |
Mercurial Remote Sync (hg-rsync) provides some methods to your working directory in sync with remote files, that exist outside of the repository. |
Line 122: | Line 122: |
---- CategoryExtensionsByOthers |
Remote Sync
This extension is not distributed with Mercurial.
Author: Ryan Seto
Mercurial Extension: http://bitbucket.org/MrWerewolf/hg-rsync
Overview
Mercurial Remote Sync (hg-rsync) provides some methods to your working directory in sync with remote files, that exist outside of the repository.
Currently only supports WinSCP.
Configuration
Configure your .hgrc or mercurial.ini to enable the extension by adding the following lines:
[extensions] rsync = /path/to/hg-rsync
All of hg-rsync's configuration are set under [rsync].
Here is an example:
[rsync] script = sync/winscp.txt path = ssh://your.login@remote.host:22/remote/path/to/sync #Optional cmd = /path/to/winscp.exe #Optional
script
The script file that will be used by WinSCP.
This can be the relative path from the base directory of your local repository or an absolute path.
See WinSCP's scripting documentation for details on how to write this script.
hg-rsync makes two parameters available from within the script.
The connection portion of the path configuration.
(your.login@remote.host:22 from the example.)
The path portion of the path configuration.
(remote/path/to/sync from the example.)
Here is an example:
option batch on option confirm off option transfer automatic option exclude "readme.txt" open %1% cd %2% synchronize local www/images/upload www/images/upload synchronize local www/files/upload www/files/upload close exit
This will tell WinSCP to do the following:
Open a connection using the login, host, and port specified in the path.
Change to the directory specified in the path.
- Synchronize your several local directories with the remote directories.
- Exit.
path
This is the remote path to the base directory you want to sync from. By default this will be the default path found under the [paths] portion of your hgrc. You can either specify a full ssh:// path or an alias for a path defined under [paths].
cmd
By default, hg-rsync will search for WinSCP in the default install directories. If you have WinSCP elsewhere, then specify where the the executible is with this option.
Usage
hg rsync [-s SCRIPT] [PATH]
To use hg-rsync, simply run the following command. This will requires that you at least set the script option and have a default path.
hg rsync
Options
-s SCRIPT, --script SCRIPT
- The path to the WinSCP sync script.
PATH
Remote path to sync from. If unspecified this will be the default path. This can be an alias or a full ssh:// path.
Hook
You can add a hook to keep your working directory in sync while you work. If you decide to use a hook, make sure you are configured to sync without having to specify a password.
Here is an example that will sync after you Pull changes.
[hooks] postincoming.rsync = python:/path/to/hg-rsync.py:hook