Windows permissions in the directory: Mercurial - hg merge - "abort: access denied"

Background: This runs on Windows 2008 Server.

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

I am new to Mercurial, and I try to follow the advice above, where it says โ€œCombine default into your function as often as possibleโ€ - and I did this several times earlier today, already, with other files.

However, this new change simply will not merge.

When I do "hg merge default", I get the error "abort: Access is denied". After searching on Google, I see that some people have reported problems with the rights to the files in question. There is nothing special about the permissions on the file in question, at least not what I see. I am a Linux person, training, and not a Windows person, so I basically do not understand the permission of Windows files. Cygwin claims that this file has 644 (i.e. I can write to a file), which is the same set of permissions as every other file that has previously been successfully affected by the hg merge process in the past.

I looked at the DOS "attrib" command and it does not display the read-only flag next to this file.

If this is not a Mercurial question, but a Windows permission question, I am also glad to change the tags as well.

I assume that this "abort: Access denied" error refers to the file in the changeset that needs to be merged, and not to one of the .hg / files, but this is a very cryptic error message - it does not say which file has the access problem (and in the modified set of changes there is only one file - I intentionally tried to be VERY simple with this test).

UPDATE:

I made "hg rollback" and tried the same command test in the same order, leaving the files open, only with a completely different file (lib / blort.html instead of blah / foo.html).

"hg merge" worked just fine.

So, perhaps something is particularly strange in terms of access rights to a specific file I started with (foo.html), or to the directory that is its parent.

Other Editing

Certainly, something is different than in the parent directory, since I had the same problem with another file in the directory, but the problem does not appear anywhere in the directory structure only in this directory.

I just checked permissions on lib / versus blah /, and both of them seem to be the same in Cygwin, but this is only a vague approximation of the Windows ACL. Studying them, right-clicking on each directory and looking at the Properties tabs, they again appear the same for both directories, but I think the essence of the problem is that I really do not quite understand the ACL.

Is there any DOS command-line tool, for example, the "attribute" is only more powerful, which, like the "ls" in linux, would give me more information than the confusing mess that I got into the "Properties"?

Hope final editing

How to set Windows permissions

"iCacls" seems to be the right tool for the job and seems to have solved the problem, but I would like to duplicate this before accepting / closing.

ESSENCE

  • If in doubt, use --debug for your Mercurial commands. It's a bit of a "duh" now, but thanks to @ lazy-badger for pointing this out.

  • You can fix your Server 2008 permissions with a command like icacls path /grant domain\user:(OI)(CI)F (see, for example, http://www.petri.co.il/forums/showthread.php? t = 23207 ), but be sure to do it from the escalation of the CMD window ("Run As Adminstrator"). Again, "duh" for the Windows people, not so obvious to the Linux person (instead, I went looking for Google for the DOS equivalent for sudo ).

+4
source share
2 answers

Just marking "Access is denied" when merging can have two different roots: the mentioned @emil and incorrect or nonexistent rights for the user under which the hg credentials were run, to create temporary files in $ TEMP folder

+2
source

You may be denied access to Windows if any other program opened the file. You can try to close programs in which any files in this tree can be opened, or restart the computer (which, of course, will close all programs).

+3
source

All Articles