Setting Mercurial's execute bit on Windows

后端 未结 3 1921
野性不改
野性不改 2021-02-19 20:39

I work on a Mercurial repository that is checked out onto an Unix filesystem such as ext3 on some machines, and FAT32 on others.

In Subversion, I can set the svn:executa

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-19 20:58

    Mercurial tracks the execute bit as part of the file metdata. There's no way to explictly set it in mercurial, but it tracks changes made by chmod on unix. Files added on windows will have the execute bit set by default, but the windows attrib command doesn't let you set them.

    If you do a hg log -p --git you'll see the patch format that shows the altering of the execute bit, which looks like this:

    $ hg log --git -p
    changeset:   1:0d9a70aadc0a
    tag:         tip
    user:        Ry4an Brase 
    date:        Sat Apr 24 10:05:23 2010 -0500
    summary:     added execute
    
    diff --git a/that b/that
    old mode 100644
    new mode 100755
    
    changeset:   0:06e25cb66089
    user:        Ry4an Brase 
    date:        Sat Apr 24 10:05:09 2010 -0500
    summary:     added no execute
    
    diff --git a/that b/that
    new file mode 100644
    --- /dev/null
    +++ b/that
    @@ -0,0 +1,1 @@
    +this
    

    If you're not able to get on to a unix system to set them, you could probably fake up a patch like that and hg import it, but that's definitely sub optimal.

提交回复
热议问题