windows - 在 Windows 上设置 Mercurial 的执行位

标签 windows mercurial cross-platform filesystems fat32

我在 Mercurial 存储库上工作,该存储库已 check out 到 Unix 文件系统,例如某些机器上的 ext3,以及其他机器上的 FAT32。

在 Subversion 中,我可以设置 svn:executable 属性来控制在支持这种位的平台上 checkout 文件时是否应将文件标记为可执行文件。无论我在哪个平台上运行 SVN 或包含我的工作副本的文件系统,我都可以执行此操作。

在 Mercurial 中,如果克隆在 Unix 文件系统上,我可以 chmod +x 获得相同的效果。但是如何设置(或删除)FAT 文件系统上文件的可执行位?

最佳答案

Mercurial 将执行位作为文件元数据的一部分进行跟踪。无法在 mercurial 中明确设置它,但它会跟踪 unix 上 chmod 所做的更改。添加到 windows 上的文件将默认设置执行位,但 windows attrib 命令不允许您设置它们。

如果您执行 hg log -p --git,您将看到显示执行位更改的补丁格式,如下所示:

$ hg log --git -p
changeset:   1:0d9a70aadc0a
tag:         tip
user:        Ry4an Brase <ry4an-hg@ry4an.org>
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 <ry4an-hg@ry4an.org>
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

如果您无法进入 unix 系统来设置它们,您可能会伪造一个这样的补丁并 hg import 它,但这绝对不是最佳选择。

关于windows - 在 Windows 上设置 Mercurial 的执行位,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2702825/

相关文章:

windows - 每 x 个字符批量添加一个字符

r - Rscript在带有单引号和双引号的窗口上的行为不一致

iphone - 蓝牙跨平台 android, iphone, Blackberry, Symbian, WinMo

Mercurial 和忽略模式

github - 找不到 hg-git 存储库

caching - SCons 缓存如何与不同的操作系统和 CPU 架构配合使用?

c++ - 从 unsigned char* 到 const wchar_t* 的转换

windows - 64 位应用程序的兼容性设置显示为灰色

windows - 如何在没有互联网连接的情况下在本地安装 NodeJS 项目?

mercurial - 自动将构建日期附加到 Eclipse 插件版本号