我有mercurial存储库。存在.hgnore文件:
λ ~/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$
。没有结果。
有什么想法吗?
嗯,它在这里工作:
$ 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页面上提到的,它仍然被认为是实验性的,因为它仍然有缺陷。使用检查是否不一致
$ hg showconfig extensions.inotify
并在必要时禁用它。如果扩展名是从您自己的配置文件加载的(请使用hg showconfig --debug
进行检查),则您可以删除加载它的行。如果它加载在系统范围的配置文件中,但您无法更改,则添加
[extensions]
inotify = !
到您自己的配置文件以禁用它。
我在Windows上,但通常是
CMakeFiles/*
会对我有用…