开发者

Mercurial - How do you export your repo's source to a production site?

I've tried using archive in Tortoise HG by opening my repo change log. This doesn't seem to be anything like SVN's export command, where I can simply export a remote repository to the current directory. I use this to get a clean copy of my source for production (without notes and repository dat开发者_运维百科a). How can I do something like this in HG? Or, should I just use clone and deal with the repo related data manually?

BTW, I need to do this all via command line since I'm not going to be using Tortoise HG on my Linux server.

Any help is much appreciated.


You want the archive option I think...

Try:

hg help archive

You can export the archive as just files, or as tar/zip/etc.

The key is that with archive you start in the repo and specify the destination, vs. in subversion where you start in the destination and specify the location of the repo.

Mercurial doesn't seem to have many options for operating on remote repositories, other than clone and related commands.


As other responses have pointed out hg archive can do what you want -- it will do archive files or just a file layout, but if you can run mercurial on the server might I suggest making the server a clone, with a hook that updates whenever new changesets are received? So long as you're not editing on the live server there won't be merge conflicts, so it's a safe action.

On the server:

hg clone ssh://host//path/to/dev/repo

and in the server's .hg/hgrc file add these lines

[hooks]
changegroup = hg update

Then as you update on the dev repo to deploy you just do:

hg push ssh://server/path/to/deployrepo

and then you can push from your repo to your server and it'll automatically update.


If you want an output directory free of all repository data, simply delete the .hg directory after you clone.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜