2013-12-09 15 views
1

我有一個目錄結構的多項目解決方案如下配置善變.hgingore忽略目錄中的所有文件和文件夾,除了「repositories.config」

我想是忽略所有文件和文件夾的路徑給出library-management-system\packages。但packages文件夾有一個名爲repositories.config的文件,我不想被Mercurial忽略。

我該怎麼做?

Folder PATH listing for volume PARIMAL 
Volume serial number is 00650067 DD35:25E5 
R:\LIBRARY-MANAGEMENT-SYSTEM 
| LibraryManagementSystem.sln 
| LibraryManagementSystem.sln.DotSettings.user 
| .hgignore 
| 
+---CybotechDomain 
| | App.config 
| | CybotechDomain.csproj 
| | CybotechDomain.csproj.user 
| | 
| +---Entity 
| |  Batch.cs 
| |  Book.cs 
| |  BookIssue.cs 
| |  Course.cs 
| |  Faculty.cs 
| |  Manager.cs 
| |  Person.cs 
| |  Semester.cs 
| |  Student.cs 
| |  
| +---Properties 
| |  AssemblyInfo.cs 
| |  
| +---bin 
| | \---Debug 
| |   CybotechDomain.dll.config 
| |   CybotechDomain.dll 
| |   CybotechDomain.pdb 
| |   
| \---obj 
|  \---Debug 
|   | DesignTimeResolveAssemblyReferencesInput.cache 
|   | CybotechDomain.pdb 
|   | CybotechDomain.dll 
|   | CybotechDomain.csproj.FileListAbsolute.txt 
|   | 
|   \---TempPE 
+---LibraryData 
| | App.config 
| | LibraryData.csproj 
| | packages.config 
| | 
| +---Data 
| |  BookRepository.cs 
| |  CourseRepository.cs 
| |  FacultyRepository.cs 
| |  IRepository.cs 
| |  IUnitOfWork.cs 
| |  LibraryContext.cs 
| |  LibraryInitializer.cs 
| |  LibraryUnitOfWork.cs 
| |  StudentRepository.cs 
| |  
| +---Properties 
| |  AssemblyInfo.cs 
| |  
| +---bin 
| | \---Debug 
| |   CybotechDomain.dll 
| |   EntityFramework.dll 
| |   CybotechDomain.pdb 
| |   EntityFramework.xml 
| |   LibraryData.dll.config 
| |   LibraryData.dll 
| |   LibraryData.pdb 
| |   
| \---obj 
|  \---Debug 
|   | DesignTimeResolveAssemblyReferencesInput.cache 
|   | LibraryData.csprojResolveAssemblyReference.cache 
|   | LibraryData.pdb 
|   | LibraryData.dll 
|   | LibraryData.csproj.FileListAbsolute.txt 
|   | 
|   \---TempPE 
+---LibraryManager 
| | LibraryManager.csproj 
| | LibraryManager.csproj.DotSettings 
| | Program.cs 
| | app.config 
| | packages.config 
| | 
| +---Application 
| |  ApplicationModule.cs 
| |  Composition.cs 
| |  
| +---Icons 
| |  books.ico 
| |  course.ico 
| |  
| +---Images 
| |  add-16.png 
| |  add-24.png 
| |  book-32.png 
| |  book-48.png 
| |  book-issue.png 
| |  book-read.png 
| |  books.png 
| |  course.png 
| |  delete-16.png 
| |  delete-24.png 
| |  header.jpg 
| |  issue_book.png 
| |  lock-32.png 
| |  logo.PNG 
| |  orb.jpg 
| |  student-32.png 
| |  teacher-32.png 
| |  
| +---Properties 
| |  AssemblyInfo.cs 
| |  Resources.Designer.cs 
| |  Resources.resx 
| |  Settings.Designer.cs 
| |  Settings.settings 
| |  
| +---View 
| |  BookForm.Designer.cs 
| |  BookForm.cs 
| |  BookForm.resx 
| |  BookIssueForm.Designer.cs 
| |  BookIssueForm.cs 
| |  BookIssueForm.resx 
| |  BookListForm.Designer.cs 
| |  BookListForm.cs 
| |  BookListForm.resx 
| |  CourseForm.Designer.cs 
| |  CourseForm.cs 
| |  CourseForm.resx 
| |  Extensions.cs 
| |  FacultyAddForm.Designer.cs 
| |  FacultyAddForm.cs 
| |  FacultyAddForm.resx 
| |  InputBox.cs 
| |  InputForm.Designer.cs 
| |  InputForm.cs 
| |  InputForm.resx 
| |  LoginForm.Designer.cs 
| |  LoginForm.cs 
| |  LoginForm.resx 
| |  MainForm.Designer.cs 
| |  MainForm.cs 
| |  MainForm.resx 
| |  OfficeFormWithStatus.cs 
| |  StudentAddForm.Designer.cs 
| |  StudentAddForm.cs 
| |  StudentAddForm.resx 
| |  
| +---bin 
| | \---Debug 
| |  | LibraryManager.vshost.exe.config 
| |  | LibraryManager.vshost.exe.manifest 
| |  | LibraryManager.vshost.exe 
| |  | CybotechDomain.dll 
| |  | EntityFramework.dll 
| |  | Equin.ApplicationFramework.BindingListView.dll 
| |  | LibraryData.dll 
| |  | Ninject.dll 
| |  | System.Data.SqlServerCe.dll 
| |  | CybotechDomain.pdb 
| |  | LibraryData.pdb 
| |  | EntityFramework.xml 
| |  | Equin.ApplicationFramework.BindingListView.pdb 
| |  | Ninject.pdb 
| |  | Ninject.xml 
| |  | LibraryManager.exe.config 
| |  | LibraryManager.exe 
| |  | LibraryManager.pdb 
| |  | 
| |  +---x86 
| |  | | sqlceca40.dll 
| |  | | sqlcecompact40.dll 
| |  | | sqlceer40EN.dll 
| |  | | sqlceme40.dll 
| |  | | sqlceqp40.dll 
| |  | | sqlcese40.dll 
| |  | | 
| |  | \---Microsoft.VC90.CRT 
| |  |   Microsoft.VC90.CRT.manifest 
| |  |   msvcr90.dll 
| |  |   README_ENU.txt 
| |  |   
| |  \---amd64 
| |   | sqlceca40.dll 
| |   | sqlcecompact40.dll 
| |   | sqlceer40EN.dll 
| |   | sqlceme40.dll 
| |   | sqlceqp40.dll 
| |   | sqlcese40.dll 
| |   | 
| |   \---Microsoft.VC90.CRT 
| |     Microsoft.VC90.CRT.manifest 
| |     msvcr90.dll 
| |     README_ENU.txt 
| |     
| \---obj 
|  \---x86 
|   \---Debug 
|    | DesignTimeResolveAssemblyReferencesInput.cache 
|    | LibraryManager.csproj.FileListAbsolute.txt 
|    | DesignTimeResolveAssemblyReferences.cache 
|    | LibraryManager.csprojResolveAssemblyReference.cache 
|    | Cybotech.Properties.Resources.resources 
|    | Cybotech.View.BookForm.resources 
|    | Cybotech.View.BookIssueForm.resources 
|    | Cybotech.View.BookListForm.resources 
|    | Cybotech.View.CourseForm.resources 
|    | Cybotech.View.FacultyAddForm.resources 
|    | Cybotech.View.InputForm.resources 
|    | Cybotech.View.LoginForm.resources 
|    | Cybotech.View.MainForm.resources 
|    | Cybotech.View.StudentAddForm.resources 
|    | LibraryManager.csproj.GenerateResource.Cache 
|    | LibraryManager.pdb 
|    | LibraryManager.exe 
|    | 
|    \---TempPE 
|      Properties.Resources.Designer.cs.dll 
|      
+---LibraryTest 
| | App.config 
| | LibraryTest.csproj 
| | LibraryTester.cs 
| | packages.config 
| | 
| +---Properties 
| |  AssemblyInfo.cs 
| |  
| +---bin 
| | \---Debug 
| |   CybotechDomain.dll 
| |   EntityFramework.dll 
| |   LibraryData.dll 
| |   CybotechDomain.pdb 
| |   LibraryData.pdb 
| |   EntityFramework.xml 
| |   LibraryTest.dll.config 
| |   LibraryTest.dll 
| |   LibraryTest.pdb 
| |   
| \---obj 
|  \---Debug 
|   | DesignTimeResolveAssemblyReferencesInput.cache 
|   | LibraryTest.csprojResolveAssemblyReference.cache 
|   | LibraryTest.pdb 
|   | LibraryTest.dll 
|   | LibraryTest.csproj.FileListAbsolute.txt 
|   | 
|   \---TempPE 
+---packages 
| | repositories.config 
| | 
| +---EntityFramework.4.3.1 
| | | EntityFramework.4.3.1.nuspec 
| | | EntityFramework.4.3.1.nupkg 
| | | 
| | +---Content 
| | |  App.config.transform 
| | |  Web.config.transform 
| | |  
| | +---lib 
| | | \---net40 
| | |   EntityFramework.dll 
| | |   EntityFramework.xml 
| | |   
| | \---tools 
| |   EF4.3on.NET4.5Readme.txt 
| |   EntityFramework.PowerShell.dll 
| |   EntityFramework.psd1 
| |   EntityFramework.psm1 
| |   init.ps1 
| |   install.ps1 
| |   migrate.exe 
| |   
| +---Ninject.3.0.1.10 
| | | Ninject.3.0.1.10.nuspec 
| | | Ninject.3.0.1.10.nupkg 
| | | 
| | \---lib 
| |  +---net35 
| |  |  Ninject.dll 
| |  |  Ninject.pdb 
| |  |  Ninject.xml 
| |  |  
| |  +---net40 
| |  |  Ninject.dll 
| |  |  Ninject.pdb 
| |  |  Ninject.xml 
| |  |  
| |  +---net45-full 
| |  |  Ninject.dll 
| |  |  Ninject.pdb 
| |  |  Ninject.xml 
| |  |  
| |  +---sl2 
| |  |  Ninject.dll 
| |  |  Ninject.pdb 
| |  |  Ninject.xml 
| |  |  
| |  +---sl3-wp 
| |  |  Ninject.dll 
| |  |  Ninject.pdb 
| |  |  Ninject.xml 
| |  |  
| |  +---sl3 
| |  |  Ninject.dll 
| |  |  Ninject.pdb 
| |  |  Ninject.xml 
| |  |  
| |  +---sl4-windowsphone71 
| |  |  Ninject.dll 
| |  |  Ninject.pdb 
| |  |  Ninject.xml 
| |  |  
| |  +---sl4 
| |  |  Ninject.dll 
| |  |  Ninject.pdb 
| |  |  Ninject.xml 
| |  |  
| |  \---sl5 
| |    Ninject.dll 
| |    Ninject.pdb 
| |    Ninject.xml 
| |    
| +---Microsoft.SqlServer.Compact.4.0.8876.1 
| | | SQLCE_EULA_ENU.rtf 
| | | Microsoft.SqlServer.Compact.4.0.8876.1.nuspec 
| | | Microsoft.SqlServer.Compact.4.0.8876.1.nupkg 
| | | 
| | +---Content 
| | |  web.config.transform 
| | |  
| | +---lib 
| | | \---net40 
| | |   System.Data.SqlServerCe.dll 
| | |   
| | +---NativeBinaries 
| | | +---amd64 
| | | | | sqlceca40.dll 
| | | | | sqlcecompact40.dll 
| | | | | sqlceer40EN.dll 
| | | | | sqlceme40.dll 
| | | | | sqlceqp40.dll 
| | | | | sqlcese40.dll 
| | | | | 
| | | | \---Microsoft.VC90.CRT 
| | | |   Microsoft.VC90.CRT.manifest 
| | | |   msvcr90.dll 
| | | |   README_ENU.txt 
| | | |   
| | | \---x86 
| | |  | sqlceca40.dll 
| | |  | sqlcecompact40.dll 
| | |  | sqlceer40EN.dll 
| | |  | sqlceme40.dll 
| | |  | sqlceqp40.dll 
| | |  | sqlcese40.dll 
| | |  | 
| | |  \---Microsoft.VC90.CRT 
| | |    Microsoft.VC90.CRT.manifest 
| | |    msvcr90.dll 
| | |    README_ENU.txt 
| | |    
| | \---tools 
| |   Install.ps1 
| |   Uninstall.ps1 
| |   VS.psd1 
| |   VS.psm1 
| |   
| \---Unofficial.BindingListView.1.2.0.0 
|  | Unofficial.BindingListView.1.2.0.0.nuspec 
|  | Unofficial.BindingListView.1.2.0.0.nupkg 
|  | 
|  \---lib 
|   \---net20 
|     Equin.ApplicationFramework.BindingListView.dll 
|     Equin.ApplicationFramework.BindingListView.pdb 
|     
+---.hg 
| | 00changelog.i 
| | requires 
| | hgrc 
| | cur-message.txt 
| | 
| \---store 
\---.nuget 
     NuGet.targets 
     NuGet.exe 
     NuGet.Config 

回答

4

.hgignore不影響已添加到存儲庫文件,所以最簡單的方法做你想做的是忽略文件夾,並手動添加包\ repositories.config文件。

+0

thnx先生,工作就像魅力! –

1

用前瞻的正則表達式條目.hgignore

syntax: regexp 
^library-management-system/packages/(?!repositories\.config).+$ 
相關問題