如何将Mercurial存储库克隆到已经存在的目录中? [英] How do clone a Mercurial repository into a directory that already exists?

查看:97
本文介绍了如何将Mercurial存储库克隆到已经存在的目录中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个正在本地开发的客户端Django项目,使用Mercurial进行版本控制.我将本地存储库推送到我的个人远程服务器(保留所有项目),然后(在任何Web服务器上)部署它时,从我的个人服务器克隆该存储库.

I have a client's Django project that I'm developing locally, using Mercurial for version control. I push my local repository to my personal remote server (where I keep all my projects) and then when I come to deploy it (on whichever web server) I clone that respository there from my personal server.

这在大多数服务器(我可以完全控制)上工作正常,但是我有几个项目要部署到WebFaction上. WebFaction很棒,但是它的设置有点不寻常,因为我需要首先通过其控制面板将Django项目声明为应用程序".这会自动创建一些东西,例如"apache2","myproject"等文件夹.尽管我要从我的个人远程服务器克隆存储库,但它是同一文件夹.尽管执行常规的hg clone命令只是行不通,因为它说目标文件夹已经存在.实际上,我对此文件夹的内容无能为力,所以我需要解决此问题.

This works fine on most servers (where I have total control) but I have a few projects where I'm deploying on to WebFaction. WebFaction is great, but a little unusual with it's setup, as I need to first declare the Django project as an 'application' through their control panel. This creates a few things automatically, such as an 'apache2', 'myproject', etc folder. It's this same folder though where I want to clone the repository from my personal remote server. Doing the usual hg clone command just doesn't work though as it says the destination folder already exists. There isn't much I can do about the contents of this folder really, so I need to work around this.

我不是Mercurial的专家,我似乎无法解决的唯一方法是将其克隆到另一个文件夹,然后将所有内容(包括.hg)移动到我想要的实际文件夹中.虽然这似乎很愚蠢...

I'm not an expert at Mercurial and the only way I could seem to work it out is clone it to another folder and then moving all the contents (including the .hg) into the actual folder I want. This seems silly though...

我正在使用Mercurial v1.6.2(通过easy_install安装).谁能对此发表一些看法?

I'm using Mercurial v1.6.2 (installed through easy_install). Could anyone share some light on this?

非常感谢.

推荐答案

从总体上看,您似乎可能正在尝试将Mercurial用作安装管理器,但这当然不是其设计目标.

In the main, it looks like you might be trying to use Mercurial as an installation manager which is certainly not its design goal.

如果我正确地阅读了文档,则源存储库的一部分应该类似于make deploy,它将文件放置在正确的位置.换句话说,在您的部署目录中有一个存储库克隆(在.hg中)似乎很奇怪且容易出错.

If I am reading you correctly, part of your source repository should be something like make deploy which puts the files into their proper places. Put another way, having a repository clone (in .hg) in your deployment directory seems odd and trouble-prone.

这篇关于如何将Mercurial存储库克隆到已经存在的目录中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆