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

独自空忆成欢 提交于 2019-12-08 03:50:29

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.

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.

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!