目录上的Windows权限:Mercurial-hg merge-“中止:访问被拒绝" [英] Windows permissions on a directory: Mercurial - hg merge - "abort: access is denied"

查看:109
本文介绍了目录上的Windows权限:Mercurial-hg merge-“中止:访问被拒绝"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景:它正在Windows 2008 Server上运行.

Background: this is running on a Windows 2008 Server.

https://www.mercurial-scm.org/wiki/Workflows#Feature_separation_through_named_branches

我是Mercurial的新手,我正在尝试遵循上面的建议,即尽可能多地将默认值合并到您的功能中".现在,我已经在此之前做过两次了,与其他文件.

I'm a Mercurial newbie, and am trying to follow the advice above where it says to "Merge default into your feature as often as possible" -- and I've done this a couple of times previously today, already, with other files.

但是,最新的更改不会合并.

However, this newest change just won't merge.

当我执行"hg merge default"时,出现错误中止:访问被拒绝".在四处搜寻之后,我发现有人报告说实际上在有关文件上存在权限问题.关于该文件的权限没有什么特别的,至少我看不到.我是经过培训的Linux专家,而不是Windows专家,因此从根本上我并不真正了解Windows文件权限. Cygwin声称相关文件为644(即我可以写入该文件),这与过去通过hg合并过程成功触摸过的每个其他文件具有相同的权限集.

When I do the 'hg merge default' I get the error "abort: Access is denied". After googling around, I see that some people reported actually having permissions problems on the files in question. There's nothing special about the permissions on the file in question, at least not that I can see. I'm a Linux person by training, not a Windows person, so fundamentally I don't really understand Windows file permissions. Cygwin claims that the file in question is 644 (i.e., I can write to the file), which is the same set of permissions as every other file that has previously been successfully touched by the hg merge process in the past.

我看了一下DOS的"attrib"命令,它在有问题的文件旁边也没有显示只读"标志.

I took a look at the DOS 'attrib' command and it doesn't show a 'read-only' flag next the file in question, either.

如果这不是Mercurial问题,而是Windows权限问题,那么我也很乐意进一步修改标签.

If this is less a Mercurial question than it is a Windows permissions question, I'm happy to modify the tags further as well.

我假设此异常终止:访问被拒绝"错误是指变更集中的文件需要合并,而不是.hg/文件之一,但这是一个非常含糊的错误消息-它并没有说哪个文件有访问问题(更改集中只有一个文件被更改了-我故意尝试通过此测试变得非常简单).

I'm assuming that this "abort: Access is denied" error refers to the file in the changeset that needs to be merged, and not to one of the .hg/ files, but it's a very cryptic error message -- it doesn't say which file has an access issue (and there is only one single file in the changeset that was changed -- I purposely tried to be VERY simple with this test).

更新:

进行了"hg回滚",并以相同的顺序尝试了相同的命令测试,仅使用完全不同的文件(lib/blort.html而不是blah/foo.html)打开了文件.

Did an 'hg rollback' and tried the same test of commands in the same order, leaving the files open, only with a completely different file (lib/blort.html instead of blah/foo.html).

汞合并"效果很好.

因此,关于我以(foo.html)开头的特定文件或作为其父目录的权限的问题可能特别棘手.

So there's probably something particularly hinky about the permissions on the specific file I started with (foo.html), or the directory that is its parent.

另一个编辑

肯定有一些关于父目录的问题,因为我在目录中有另一个文件遇到了相同的问题,但该问题仅在该目录中才出现在目录结构的其他地方.

Definitely something off about the parent directory, as I had the same problem w/ another file in the directory, but the problem does not manifest elsewhere in the directory structure, only in this one directory.

只需检查lib/和blah/上的权限,它们在Cygwin中看起来都是一样的,但这只是Windows ACL的含糊近似.通过右键单击每个目录并检查属性"安全性"选项卡来检查这些目录时,两个目录的目录再次相同,但是我认为问题的症结在于我确实不太了解ACL.

Just checked the permissions on lib/ versus blah/ and they both seem the same in Cygwin, but that's only a vague approximation of the Windows ACLs. When examining those by right-clicking each directory and examining the 'Properties' Security tabs, they again seem the same for both directories, but I think the crux of the problem is that I really don't quite grok ACLs.

是否有一些DOS命令行工具,例如"attrib"仅更强大,而像linux中的"ls"一样,比我在属性"中得到的混乱的复选标记更能给我更多信息?

Is there some DOS command-line tool, like 'attrib' only more powerful, that, like 'ls' in linux, would give me more information than the confusing jumble of checkmarks I get in the 'Properties'?

希望最终的修改

如何区分Windows权限

"iCacls"似乎是完成此任务的正确工具,并且似乎已经解决了问题,但是我想在接受/关闭之前重复此操作.

'iCacls' seems to be the correct tool for the job, and seems to have solved the problem, but I'd like to duplicate this before accepting/closing.

摘要

  1. 如有疑问,请在您的Mercurial命令上使用--debug.现在有点呆滞",但是感谢@ lazy-badger指出了这一点.

  1. When in doubt, use --debug on your Mercurial commands. This is a little bit 'duh' now, but thanks to @lazy-badger for pointing it out.

您可以使用诸如icacls path /grant domain\user:(OI)(CI)F之类的命令来修复Server 2008权限(请参见例如 http://www.petri.co.il/forums/showthread.php?t=23207 ),但请确保从升级的CMD窗口(以管理员身份运行")执行此操作').再次对Windows用户是"duh",而对Linux用户则不是那么明显(取而代之的是,我搜寻了一些等同于sudo的DOS).

You can fix your Server 2008 permissions using a command like icacls path /grant domain\user:(OI)(CI)F (see e.g. http://www.petri.co.il/forums/showthread.php?t=23207), but be sure to do this from an escalated CMD window ('Run As Adminstrator'). Again 'duh' to Windows people, not so obvious to a Linux person (instead I went googling around for some DOS equivalent to sudo).

推荐答案

仅需注意合并上的访问被拒绝"可以具有两个不同的根源:@emil提及以及用户错误或不存在的权限,在该凭据下启动hg凭据,以在$ TEMP文件夹中创建临时文件

Just to note "Access denied" on merge can have two different roots: mentioned by @emil and wrong or nonexistent rights for user, under which credentials hg was started, to create temporary files in $TEMP folder

这篇关于目录上的Windows权限:Mercurial-hg merge-“中止:访问被拒绝"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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