使用Windows网络共享目录时,汞存储库损坏 [英] Hg repository corruption when using Windows network shared directory

查看:106
本文介绍了使用Windows网络共享目录时,汞存储库损坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我能在这里得到一些帮助,因为SO UX比Mercurial邮件列表更好.

I hope I can get some help here as SO UX is better than Mercurial mail list.

多年来,我一直在家里快乐地使用Mercurial.我还在Bitbucket Cloud中使用了它,进行了一些更严重(但仍然很有趣)的项目.

I've been happily using Mercurial at home for years. I am also using it with Bitbucket Cloud for a couple of more serious (but still hobby) projects.

去年,我将工作团队从SVN(托管公司)转移到Hg(自行托管,并在网络位置建立了中央仓库).我们都在Windows中.从那时起,我们一直在遇到严重的中央存储库损坏的问题,这些问题只能通过备份来解决,例如:

Last year I switched my team at work from SVN (company hosted) to Hg (self-hosted, with the central repo on a network location). We are all in Windows. Since then, we're continuously having problems with severe central repository corruption, which can only be resolved using backup, e.g.:

% hg verify --verbose
repository uses revlog format 1
checking changesets
checking manifests
manifest@92: unknown parent 1 ef0f96d78ab6 of ef0f96d78ab6
manifest@92: reading delta ef0f96d78ab6: integrity check failed on 
 00manifest.i:88
manifest@93: unknown parent 1 e336adb3580b of e336adb3580b
manifest@93: reading delta e336adb3580b: integrity check failed on 00manifest.i:89
manifest@94: reading delta 7243aebd542b: unknown compression type '\x08'
manifest@95: reading delta 899e4507ca01: unpack requires a string argument of length 12
manifest@96: reading delta 12d4d930da4f: Manifest had an entry with a zero-length filename.
...

有人说由于锁定问题,我们不应该将网络共享用于中央存储库. 其他解释说Mercurial不使用除非文件系统出现问题,否则这些锁定和网络共享应该可以正常工作.

Some people say we shouldn't use a network share for the central repository, due to problems with locking. Others explain that Mercurial doesn't use those locks, and network shares should work fine, unless there are problems with the file system.

考虑到后者,我想知道我是否可以在不要求公司为hg提供服务器的情况下以某种方式调试安装.我对我们使用的配置了解不多,但这就是我所看到的.可通过Windows网络路径\\domain.com\path\path\our-directory访问该目录.在内部,我们创建了一个名为root的目录,其中.hg驻留在其中.在.hgrc中,路径相应为

Considering the latter, I wonder if I could somehow debug our installation without asking the company to provide a server for hg. I don't know much about the configuration we are using, but here is what I see. The directory is accessible via a Windows network path: \\domain.com\path\path\our-directory. Inside, we created a directory called root where .hg resides. In .hgrc, the path is accordingly

[路径]
默认= \\ domain.com \ path \ path \我们的目录\ root

[paths]
default = \\domain.com\path\path\our-directory\root

我们的网络目录已备份(由公司备份).汞的版本是4.9.

Our network directory is backed up (by the company). Hg version is 4.9.

推荐答案

我在类似的设置上也有类似的经验.

I have had a similar experience with a similar setup.

首先要注意的是,我认为较旧的HG版本在Windows网络文件共享上运行时确实确实存在一些问题,因此请确保您的版本是最新的. (那是几年前的IIRC,所以这不太可能成为您当前问题的根本原因).

First thing to note is that I thought older HG versions definitely did have some problems when run over Windows network file shares, so make sure your version is current. (That was years ago, IIRC, so this may be unlikely to be the root cause of your present issue).

第二,在我的情况下,这些问题似乎是由于在虚拟机中从运行HG造成的.相反,我现在在未虚拟化的PC上运行[hg serve][1]实例,并使用各种HG客户端运行该实例.没问题了.

Secondly, in my case these problems seemed to be compounded from running HG from within a virtual machine. Instead I now run an [hg serve][1] instance on a PC which is not virtualized, and hit that with the various HG clients. No more problems.

看来,如果运行hg serve的PC和文件服务器之间的连接比我作为客户端运行hg的位置更可靠,则可以避免此问题.显然,hg serve与客户端使用的HTTP连接本身更加可靠.

It appeared that if the connection between the PC running hg serve and the file server was more reliable than from where I ran hg as a client, this avoided the problem. Apparently the HTTP connection hg serve uses to the client is itself more reliable.

我不能说这是一个确定的解决方案,因为我从未找到根本原因.但这似乎在相当长的一段时间内避免了更多的腐败.

I can't say that is a definitive solution because I never found a root cause. But this seems to have avoided any more corruption for quite some time.

请注意,hg serve直接内置在标准hg命令行工具中,您可以在任何地方轻松运行它,而不必在存储物理存储库的同一服务器上运行.因此,就我而言,我很随便地使用它. (显然)如果您需要更强大的功能,则可能需要与IT人员进行协调.

Note that hg serve is built right into the standard hg command line tool, you can run it from anywhere easily, and it doesn't have to run on the same server where the physical repository is stored. So in my case I use it quite casually; (obviously) you might need to coordinate with your IT people if you need something more robust.

这篇关于使用Windows网络共享目录时,汞存储库损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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