Can .hg be moved?

Benoit Boissinot bboissin at gmail.com
Mon Sep 29 15:44:15 CDT 2008


On Mon, Sep 29, 2008 at 10:33 PM, Peter <p-santoro at sbcglobal.net> wrote:
> I have a repository structure as follows:
>
> rootdir (contains .hg directory)
>    |____ subdir
>            |____ files tracked by hg
>
> I would like to move the .hg directory to the subdir, like so:
>
> rootdir
>    |____ subdir (contains .hg directory)
>            |____ files tracked by hg
>
> Can this be done safely?  If so, how?

do you track other thing or just subdir?
if it's just subdir you could do the following:
in rootdir:
hg mv subdir/* .
and commit, it should do the trick.

If there are more stuff than the subdir, it depends if you want to
keep all the history.
(but the same hg mv trick can be used, or you could use hg convert)

regards,

Benoit

(maybe the hg mv trick should be documented in
http://www.selenic.com/mercurial/wiki/index.cgi/TipsAndTricks#head-8f3d9818cde9d119b4f6d5ccfe592dae5b8015ad
)


More information about the Mercurial mailing list