linux - Mercurial 忽略 LInux 上的创建/修改日期更改

标签 linux mercurial

在 Windows 上,只要文件本身没有更改,Mercurial 就会忽略文件的创建/修改时间。 Linux 显然无法做到这一点。在我的工作中,有些人在 Windows 机器上工作,有些人在 Linux 机器上工作,我们在 Mercurial 中有很多误报的变化。

很好的例子是我们从 YML 文件重新生成 Doctrine 模型。它们中的大多数保持不变,只有一两个更改,但所有更改都会重新生成,我必须仔细检查所有更改并确保忽略它们的更改(恢复)是安全的,这样它们就不会弄乱 Mercurial提交。

有没有办法让 Linux 像 Windows 一样看到这些文件?

顺便说一句:我已经检查过,它与 EOL 问题或 UTF-8 BOM 或其他隐藏字符无关。仅时间戳发生变化。

提前致谢!

最佳答案

如果 mtime 是唯一的更改,Linux 上的 Mercurial 不会提交文件:

~ $ mkdir test
~ $ cd test/
~/test $ hg init
~/test $ echo a > a
~/test $ ls -l 
total 4
-rw------- 1 user users 2 Jul 23 13:21 a
~/test $ hg add a
adding a
~/test $ hg commit -m "Adding a"
a
committed changeset 0:e7d3dddff169
~/test $ ls -l 
total 4
-rw------- 1 user users 2 Jul 23 13:21 a
~/test $ touch a
~/test $ ls -l 
total 4
-rw------- 1 user users 2 Jul 23 13:22 a
~/test $ hg status
~/test $ hg commit -m "Mtime changed on a" a
nothing changed
~/test $

如果 ctime 发生更改,它也不会检测到更改:

~/test $ ls -l
total 4
-rw------- 1 user users 2 Jul 23 13:22 a
~/test $ rm a
rm: remove regular file ‘a’? y
~/test $ echo a > a
~/test $ ls -l
total 4
-rw------- 1 user users 2 Jul 23 14:27 a
~/test $ hg status
~/test $ hg commit -m "Ctime changed on a" a
nothing changed
~/test $

关于linux - Mercurial 忽略 LInux 上的创建/修改日期更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17806265/

相关文章:

xcode - 错误: 175002 (RA layer request failed)

windows - 在 Windows 上使用 Mercurial 跟踪硬链接(hard link)或符号链接(symbolic link)

ubuntu - Mercurial:是否可以避免任何代理设置?

linux - 用于 beagle bone 的实时 Linux (RTOS)

linux - AWK 字段包含数字范围

python - 如何手动清理主目录中的 conda?

linux - 如何加入两个不相似的文件?

mercurial - 我可以使用 mercurial 恢复文件中的一系列行吗?

Mercurial 和 TortoiseHG - 推送更改后更新远程存储库

linux - 脚本与 ./file_name 一起工作,但是当我使用 sh file_name 启动它时出现错误