Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用mercurial server创建新存储库_Mercurial_Mercurial Server - Fatal编程技术网

使用mercurial server创建新存储库

使用mercurial server创建新存储库,mercurial,mercurial-server,Mercurial,Mercurial Server,根据“创建存储库”的说法,我们创建新存储库所需要做的就是克隆不存在的存储库 但在1.1中,我不工作。如果我们看一下代码: if cmd is None: fail("direct logins on the hg account prohibited") elif cmd.startswith('hg -R ') and cmd.endswith(' serve --stdio'): repo = getrepo("read", cmd[6:-14]) if not os

根据“创建存储库”的说法,我们创建新存储库所需要做的就是克隆不存在的存储库

但在1.1中,我不工作。如果我们看一下代码:

if cmd is None:
    fail("direct logins on the hg account prohibited")
elif cmd.startswith('hg -R ') and cmd.endswith(' serve --stdio'):
    repo = getrepo("read", cmd[6:-14])
    if not os.path.isdir(repo + "/.hg"):
        fail("no such repository %s" % repo)
    dispatch.dispatch(['-R', repo, 'serve', '--stdio'])
elif cmd.startswith('hg init '):
    repo = getrepo("init", cmd[8:])
    if os.path.exists(repo):
        fail("%s exists" % repo)
    d = os.path.dirname(repo)
    if d != "" and not os.path.isdir(d):
        os.makedirs(d)
    dispatch.dispatch(['init', repo])
else:
    fail("illegal command %r" % cmd)
我们可以看到,要创建,我们需要专门传递
init
命令

此命令按预期工作:

"TortoisePlink.exe" -ssh -2 hg@mercurial "hg init tst"
但我希望这是一个更优雅的命令

那么,这是文档中的“bug”还是我做错了什么

更新

我的问题只是关于使用
mercurial server
远程创建存储库

更新2


这是我的误解,因为我不清楚是否应该创建本地存储库,该存储库将被远程克隆。

您引用的页面是用于共享现有存储库,而不是专门用于创建新的空存储库。您给出的
hgint tst
命令对于初始化新的空存储库是正确的。我认为它唯一“不雅”的地方是,您正在远程执行它,因此需要提供额外的ssh命令。存储库创建命令本身
hgint
非常简单

我发现使用Mercurial server创建新的回购协议非常简单。假设您拥有权限并且服务器上已经存在路径“/dir1/dir2/”,只需(使用命令行):

干杯,

Christophe。

请阅读该文档链接中的“创建存储库”部分。它特别是关于创建远程存储库;-)mercurial服务器不是mercurial。它不是Mercurial的一部分,也不是Mercurial的产品。这不是《水星》的作者写的。@Ry4an:谢谢,船长。那又怎样和
2+2=4
。这个帖子里还有其他明显的句子吗?@zerkms拿着电话<代码>2+2=4?只需说“就是一切”。mercurial频道是mercurial最受支持的地方,它有大量的mercurial服务器问题,没有人能回答,因为没有人使用mercurial服务器,而且不知何故它被打包到了ubuntu上。罗德代码或hgweb就是它的所在。当下面的三个答案(包括删除的一个)都误解了你的问题时,可能会给澄清部门留下一些需要改进的地方。我不认为有什么贡献会受到惩罚,但如果我创建了一个新项目并将其命名为“Paul Crowley的漂亮软件”很多人问你如何让它工作,你最终会有点恼火确切地不明显(至少对我来说)它应该已经在本地存储库中创建,我们可以远程克隆。我认为我们需要做的就是克隆到本地空目录新的远程repo。“假设路径…已经存在”实际上,当前版本的Mercurial server允许您克隆到服务器,即使之前没有创建路径。Mercurial server的一个非常有用的功能是。。。我仍在使用Git:)@Kangkan搜索,以便在我的服务器上克隆ssh和http,但要创建repo,只有ssh对我有效。尝试使用http时给出:
中止:无法创建新的http存储库
mkdir new
cd new
hg init
hg clone . ssh://hg@server/dir1/dir2/new