Speed Up Large Mercurial Repo Deploys with Rsync
The server never sleeps, but your repo just doubled in size and the sync time is killing deploy speed. Mercurial rsync is the answer when you need fast, reliable replication of large repositories across machines without choking on network or disk bottlenecks. It cuts through wasted transfers by sending only changed data over SSH, keeping both ends in lockstep without the overhead of full clones.
Mercurial, built for distributed version control, already handles branching and history with precision. But pushing updates to remote build servers or staging environments using traditional hg push can grind when repo size grows past gigabytes or when latency mounts. Rsync steps in at the transport layer, diffing files on both ends and moving only the deltas. This is not just faster—on big repos, it can be orders of magnitude faster.
To wire up Mercurial rsync, install rsync on both source and target machines. Use a post-commit hook or a simple shell script to trigger rsync calls. The typical syntax:
rsync -az --delete path/to/repo user@target:/path/to/repo
The -a flag preserves permissions and symlinks, -z compresses transfer, and --delete removes obsolete files. Secure it with SSH keys for passwordless automation. This eliminates redundant transfers and makes syncing binaries, vendor directories, or cache assets seamless alongside your .hg folder.
For hybrid workflows, you can push changesets with Mercurial to ensure integrity, then run rsync for large binary blobs outside version control. This approach keeps commits clean and syncs assets without slowing CI/CD. It also lets you mirror repositories to failover servers with minimal extra load.
Mercurial rsync works well for teams with mixed environments, remote build farms, or rapid iteration cycles. It scales without special server extensions and plays well with existing scripts. Monitor transfer logs to spot bottlenecks, and schedule syncs to avoid peak network hours if needed.
Stop waiting for full pushes to crawl across the wire. Set up rsync with Mercurial and move only what matters. See how it all comes together and ship from zero to live in minutes at hoop.dev.