changeset 418:93cb9005bb6f ignore

Minor adjustments to glob syntaxes
author Chris Cannam
date Thu, 16 Jun 2011 16:46:35 +0100
parents 4593555915cf
children 69b2338c06e1
files src/mainwindow.cpp
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/mainwindow.cpp	Thu Jun 16 15:33:28 2011 +0100
+++ b/src/mainwindow.cpp	Thu Jun 16 16:46:35 2011 +0100
@@ -662,17 +662,25 @@
         out << "syntax: glob" << endl;
     }
 
+    //!!! should we be warning the user which files this will mean
+    //!!! they ignore? -- probably
+
     if (itype == HgIgnoreDialog::IgnoreAllFilesOfGivenSuffixes) {
         foreach (QString s, suffixes) {
             out << "*." << s << endl;
         }
     } else if (itype == HgIgnoreDialog::IgnoreGivenFilesOnly) {
+        // The default for glob seems to be to ignore the file
+        // anywhere -- anchor the path to / to make it specific to
+        // this file only
+        //!!! check this!
+        foreach (QString f, files) {
+            out << "/" + f << endl;
+        }
+    } else {
         foreach (QString f, files) {
             out << f << endl;
         }
-    } else {
-
-        //!!! uh, can we do this in glob mode??
     }
 
     //!!! report, and offer to edit .hgignore now