Skip to main content

A simple script & library to handle syncing remote mercuial repositories

Project description

Ever had to keep two mercurial repositories on different machines in sync? Mercurials push & pull help to make this fairly easy, but if you make use of mercurial queues or the histedit extension then it can quickly become tedious. That’s where synchg comes in.

Synchg intends to make syncing two mercurial repositories as simple as possible. Simply run a command, and synchg will take care of the rest.

Requirements

Python 2.7 & Mercurial 2.3 are recommended, though others will probably work.

Synchg depends on these python packages:

It also requires:

  • An ssh client on the path (putty on windows, openssh compatible on other platforms)

  • Access to an SSH server on the remote machine(s)

  • An ssh private key loaded in an ssh agent (pagaent on windows, ssh-agent on other platforms)

  • That the mq extension is enabled on the remote machine(s)

Installation

Synchg and it’s python dependencies can be installed via pip:

$ pip install synchg

Using SyncHg

Before using synchg on a repository you should ensure that your environment is set up correctly. If you intend to use mq patches with synchg, then you should run hg init --mq on each local repository before you attempt to use it with synchg.

It’s recommended that you use synchg to make the initial clone to your remote machine. This way it can take steps to add necessary settings to the local repository. However, if you wish to use synchg with an existing clone of your repository, then read the section below entitled Using With Existing Clones.

Running The Script

The synchg script should be run from the command line:

$ synchg remote_host [local_path=None]

Where remote_host is the host you wish to sync with and local_path is the optional path to the local mercurial repository (if missing, the current directory will be assumed)

Information on more options can be found by running:

$ synchg --help

Configuration

On first run of synchg you will be prompted with some configuration options:

Remote source directory

This is the path on the remote under which all your repositories should be found. For example, if you have repositories at /repo/one/ and /repo/two/ then you would set this to /repo/

If you want to change the configuration of synchg, then simply run synchg -c to run the config process again.

Using With Existing Clones

Though it’s recommended that you allow synchg to perform the initial clone of a repository, it is possible to use it with existing clones. You simply need to make sure that the remote repository is listed as a remote in the .hgrc for your local repository. The remote should be named using the hostname of the remote machine.

If you intend to use mq patches, this will also need to be done with the mq repository.

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

SyncHg-0.9.6.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

SyncHg-0.9.6-py2.7.egg (19.5 kB view details)

Uploaded Source

File details

Details for the file SyncHg-0.9.6.tar.gz.

File metadata

  • Download URL: SyncHg-0.9.6.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for SyncHg-0.9.6.tar.gz
Algorithm Hash digest
SHA256 d95c28e78a57d9640bd141e51fdfe119d7a5ffdda9dbf56bb477e3c717e35dd3
MD5 93ef0fea34365af2ca21ca0fec9c57ab
BLAKE2b-256 130bb9d3222fd4ad1e11b66caaf17c970eeeaf6741d44eb3467aa3e833ded578

See more details on using hashes here.

File details

Details for the file SyncHg-0.9.6-py2.7.egg.

File metadata

  • Download URL: SyncHg-0.9.6-py2.7.egg
  • Upload date:
  • Size: 19.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for SyncHg-0.9.6-py2.7.egg
Algorithm Hash digest
SHA256 877768d80932071262c181e3e7d5cceb63b2870d422f9961c1ae3057c53d8ec6
MD5 b124000276ae57193760df1db5a378e9
BLAKE2b-256 77394b0d7573fbc21bd2e15bbcbbd5fe3a300d1ae540e28f0faffc9415351747

See more details on using hashes here.

Supported by

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