hgcp

Mercurial Cross-Repository copy and move
Download

hgcp Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • Dan Bullok
  • Publisher web site:
  • http://hg.codeviking.com

hgcp Tags


hgcp Description

hgcp is a tool that provides Mercurial cross-reposititory copy and move functions.Developer commentsWhen refactoring packages, I sometimes find the need to copy some files from one Mercurial repository to another while preserving their history. While this isn't difficult to do once you know how, it isn't a trivial operation. So, I created hgcp. Copying files from source-repo to dest-repo becomes very easy. Here are a few examples:- hgcp source-repo/features/oddball-feature.txt dest-repo/ (This copies source-repo/features/oddball-feature.txt to dest-repo/features/oddball-feature.txt)- hgcp -x features source-repo/features/oddball-feature.txt dest-repo/ (This strips off the features subpath, copying source-repo/features/oddball-feature.txt to dest-repo/oddball-feature.txt)- hgcp -x features source-repo/features/oddball-feature.txt dest-repo/plugins (Copies source-repo/features/oddball-feature.txt to dest-repo/plugins/oddball-feature.txt)There is also a hgmv command that moves files, instead of just copying them. It otherwise works exactly like the hgcp command.Installationhgcp can be installed using easy_install: easy_install hgcpNote to Anyone who doesn't like this featureIn short: that's fine with me. Don't use it.You don't need to look hard to find many requests for how to do a history-preserving cross-repository copy. Unfortunately, most replies I've seen are rather unhelpful. Here are some responses I've seen:- That's not a supported workflow.- If you need this, you're not planning your repository layout very well.- You shouldn't need to do this very often- Cross-repository file copying is not a well-defined operation.- Just copy the file without history, and put a note in the changelog.- ad nauseumThe basic problem with all of these responses is this: People need to copy or move files between repositories. Subversion encouraged us to put all of our projects in the same repository, so cross-project file copies were trivial. DVCS like Mercurial encourage us to put each project in a separate repository, but fail to provide an easy way to refactor projects. If you find yourself wondering why anyone would ever need to do this, you're in the same boat with hard-core CVS users that wondered why anyone complained that renaming or moving files was a hassle, and that renaming directories was... well, ridiculous. Moving things around is part of refactoring. Projects are split and merged all the time. As far as I'm concerned, cross-repository copy and move is an essential feature.hgcp doesn't do anything that you couldn't manually do if you wanted. Basically, it uses the Mercurial convert extension. hgcp simply writes a filemap for you, and executes the proper sequence of hg commands. It also allows you to specify paths in a more natural way.Patches and fixesI'm happy to accept patches that enhance hgcp or fix bugs. My goal is to keep hgcp as simple as possible, and focused on cross-repository workflows.Product's homepage


hgcp Related Software