1

我有水银存储库。有 .hgignore 文件:

λ ~/workspace/kompgrafika/nurbs/ cat .hgignore 
syntax: regexp
^Makefile
^bin/.*$
CMakeFiles/.*$
^CMakeCache\.txt
^cmake_install\.cmake

我想忽略一个名为 CMakeFiles 的目录:

λ ~/workspace/kompgrafika/nurbs/ tree CMakeFiles 
CMakeFiles
├── 3dfractals.dir
│   ├── build.make
│   ├── cmake_clean.cmake
│   ├── CXX.includecache
│   ├── DependInfo.cmake
│   ├── depend.internal
│   ├── depend.make
│   ├── flags.make
│   ├── link.txt
│       ├── progress.make
│   └── src
│       ├── DisplayControl.cpp.o
│       ├── Drawer.cpp.o
│       ├── main.cpp.o
│       ├── PointFileReader.cpp.o
│       ├── PointGenerator.cpp.o
│       └── Program.cpp.o
├── CMakeCCompiler.cmake
├── cmake.check_cache
├── CMakeCXXCompiler.cmake
├── CMakeDetermineCompilerABI_C.bin
├── CMakeDetermineCompilerABI_CXX.bin
├── CMakeDirectoryInformation.cmake
├── CMakeOutput.log
├── CMakeSystem.cmake
├── CMakeTmp
│   └── CMakeFiles
│       └── cmTryCompileExec.dir
├── CompilerIdC
│   ├── a.out
│   └── CMakeCCompilerId.c
├── CompilerIdCXX
│   ├── a.out
│   └── CMakeCXXCompilerId.cpp
├── Makefile2
├── Makefile.cmake
├── progress.marks
└── TargetDirectories.txt

7个目录,31个文件

但由于某种原因,运行hg status它并不会忽略 3dfractals.dir。

λ ~/workspace/kompgrafika/nurbs/ hg st
A .hgignore
A docs/pol_10.wings
? CMakeFiles/3dfractals.dir/src/DisplayControl.cpp.o
? CMakeFiles/3dfractals.dir/src/Drawer.cpp.o
? CMakeFiles/3dfractals.dir/src/PointFileReader.cpp.o
? CMakeFiles/3dfractals.dir/src/PointGenerator.cpp.o
? CMakeFiles/3dfractals.dir/src/Program.cpp.o
? CMakeFiles/3dfractals.dir/src/main.cpp.o

我在用:

λ ~/workspace/kompgrafika/nurbs/ hg --version
Mercurial Distributed SCM (version 2.0.2+5-1f9f9b4c2923)
(see http://mercurial.selenic.com for more information)

Copyright (C) 2005-2011 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

我也尝试更改CMakeFiles/.*$^CMakeFiles$. 没结果。

有什么想法有什么问题吗?

4

2 回答 2

1

嗯,它在这里工作:

$ cat .hgignore
syntax:regexp
^Makefile
^bin/.*$
CMakeFiles/.*$
^CMakeCache\.txt
^cmake_install\.cmake
$ hg init
$ mkdir -p $(dirname CMakeFiles/3dfractals.dir/src/DisplayControl.cpp.o)
$ touch CMakeFiles/3dfractals.dir/src/DisplayControl.cpp.o
$ touch CMakeFiles/cmake.check_cache
$ hg status
? .hgignore
$ hg status -A
? .hgignore
I CMakeFiles/3dfractals.dir/src/DisplayControl.cpp.o
I CMakeFiles/cmake.check_cache

这是 Mercurial 2.0.2+59,所以它应该和你的版本一样工作。

hg status你看到的一件事是inotify扩展。正如其 wiki 页面上所提到的,它仍然被认为是实验性的,因为它仍然是错误的。检查 inotify

$ hg showconfig extensions.inotify

并在必要时禁用它。如果扩展是从您自己的配置文件中加载的(检查hg showconfig --debug),那么您可以删除加载它的行。如果它加载在您无法更改的系统范围的配置文件中,则添加

[extensions]
inotify = !

到您自己的配置文件以禁用它。

于 2012-01-12T12:42:46.617 回答
0

我在 Windows 上,但通常

CMakeFiles/*

会为我做的伎俩...

于 2012-01-12T12:40:26.283 回答