【问题标题】:Default permissions when Mercurial creates filesMercurial 创建文件时的默认权限
【发布时间】:2012-01-22 19:03:44
【问题描述】:

如果 Mercurial does not track file permissions 默认情况下,它如何决定它创建的任何文件/目录的权限?

它使用umask吗?如果没有,它有什么用?

我有以下read in the mail list

Mercurial uses the mode of the .hg/store directory to compute a mask

但这似乎有点武断(如果背后有任何解释,我很想听听)。这在文档中有解释吗?

【问题讨论】:

    标签: mercurial


    【解决方案1】:

    似乎没有任何完整的解释,只有在“How To Handle Multiple Committers”页面中提及:

    如果您使用的 Mercurial 版本早于 1.0,请务必将每个用户的 umask 设置为 002 或类似名称。如果设置为022,则会屏蔽用户创建的文件的组写入权限,导致其他用户无法修改。

    您可以通过编辑用户的~/.profile 并添加行来更改用户的默认umask...

    umask 002
    

    或者,您可以编辑 /etc/profile 以更改系统范围的设置。
    如果人们使用hg 命令签入内容,则更改/etc/profile 将不起作用,因为非交互式shell 不读取该文件,/etc/bash.bashrc 是放置系统范围设置的更好位置。

    否则从 Mercurial 1.0 开始,默认权限是从 .hg/store 继承的。

    【讨论】:

      猜你喜欢
      • 2014-06-05
      • 2021-03-02
      • 1970-01-01
      • 2017-09-14
      • 2019-10-25
      • 2010-09-18
      • 1970-01-01
      • 2017-04-04
      • 2012-12-11
      相关资源
      最近更新 更多