Moving from One Hg to Another

Greg Ward gerg.ward+hg at gmail.com
Mon Nov 24 20:18:56 UTC 2008


On 24 November 2008, Benjamin Johnson said:
> I'm reviewing mercurial as a repository option for our development
> environment.  I have been trying to find information on moving files and
> history from one Hg repository to another.  (For instance, some Java utility
> package originally in one project might get moved to a common library where
> it can be shared among multiple projects.)

To paraphrase Larry Wall, "CVS has to better for something :-)" [1].
Moving ,v files around is a hack, but there is a delightful simplicity
and transparency to the hack that just cannot be matched by these
newfangled VC systems with their fancy-pants high-performance binary
databases.

But seriously... if you want to carry the entire history of a file
from one hg repository to another, take a look at the bundle and
unbundle commands.  I think that is close to what you want.

Of course, you will probably have to add another revision to move the
file to its correct location in the new repository, but that can be
done after unbundling.

       Greg

[1] the original quote was for awk: Perl doesn't let you use a regex
    as the input record separator, but awk does.



More information about the Mercurial mailing list