2012-01-12 104 views
1

我有mercurial存儲庫。有.hgignore文件:Mercurial不會忽略目錄中的文件我指定

λ ~/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$。沒有結果。

任何想法有什麼不對?

回答

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 statusinotify extension。正如其wiki頁面中提到的,它仍然被認爲是實驗性的,因爲它是still buggy。檢查是否與

$ hg showconfig extensions.inotify 

並在必要時禁用它。如果擴展是從您自己的配置文件中加載的(請檢查hg showconfig --debug),那麼您可以刪除加載該擴展的行。如果在你不能改變一個全系統的配置文件的加載,然後加入

[extensions] 
inotify = ! 

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

+0

我做了'rm -rf CMakeFiles'並使(再次創建該目錄)。然後運行'hg status',目錄從列表中消失。某種緩存錯誤? – 2012-01-12 12:48:02

+0

不,不應該 - 我們不會緩存關於'.hgignore'文件的信息。 'hg showconfig extensions'偶然提到'inotify'嗎?這是一個文件系統監視器擴展,它可能會混淆視圖以創建剛纔看到的情況。 – 2012-01-12 12:53:15

+0

是的。似乎刪除該擴展解決了問題。 – 2012-01-12 13:08:12

0

我在Windows,但通常

CMakeFiles/*

會爲我做的伎倆......

+0

'語法:glob CMakeFiles/*'不起作用。 – 2012-01-12 12:42:54

+0

'CMAkeFiles /'怎麼樣? – 2012-01-12 13:58:59