Get started using mercurial without cloning

Steve Borho steve at borho.org
Mon Apr 5 22:53:03 CDT 2010


On Mon, Apr 5, 2010 at 10:37 PM, Harry Putnam <reader at newsguy.com> wrote:
> After reading through (part) of the book (Mercurial The Definitive
> Guide), I didn't see, during the discussion of getting started,
> anything but cloning offered as a way to get started.
>
> I might have missed it of course, but is there not something available
> like cvs import command?  For people wanting to get started but have
> nothing to clone?
>
> Specifically, I want to use my  cvs repo, and just put that bodily
> into a mercurial repo (without any of the cvs related files or meta
> data)
>
> My projects are so small on only on a single user home lan that just
> ditching any cvs related info would not be a problem, no need to bring
> over revision histories or whatever.
>
> So not really talking about converting the cvs repo so much as just
> wanting to get all the files and directory structure that now make up
> my cvs repo turned into a mercurial repo.  I'll probably want to
> rearrange the actual file hierarchy somewhat.
>
> My current cvs repo is a series of hosts as top level directories,
> with a directory hierarchy at least partially mirroring the separate
> hosts.
>
> Not all hierarchies are the same from one host to another but there is
> a lot of similarity throughout.
>
> Something along this line:
>
>  host1/common/<files and directories>
>  host1/etc/<files and directories>
>  host1/etc/mail/<files and directories>
>  host1/usr/local/<files and directories>
>  host1/home/reader/scripts/<files and directories>
>  -------        ---------       ---=---       ---------      --------
>  host2/common/<files and directories>
>  host2/etc/<files and directories>
>  host2/etc/mail/<files and directories>
>  host2/usr/local/<files and directories>
>  host1/home/reader/scripts/<files and directories>
>  host2/projects/<file and directores>
>
>  [...]
>
> So that is roughly how the cvs repo is structured.  I'd like to just
> copy all of a checked out module of the host1 structure (minus the CVS
> related stuff) and create a mercurial repo from it.
>
> Then if I'm following along with the book, clone from that first repo
> to the other hosts, and make whatever changes to the separate hosts as
> time goes on.
>
> But I didn't see much about how to start up in this way?

If you want all of that structure in one repository, simply cd to the
root folder, then run:

hg init
hg add
hg commit -m "initial commit"

If there are files you do not want to be revisioned, you'll want to
create an .hgignore file before running hg add.

--
Steve Borho


More information about the Mercurial mailing list