# HG changeset patch # User Chris Cannam # Date 1294768582 0 # Node ID 123e06d5d9af5d51b3b6721cac02738a1f0e0f60 # Parent 011312e59e442526263021fb6352fae71ca58681 * If the hgignore file doesn't exist when the user asks to edit it, create it with a "syntax: glob" line diff -r 011312e59e44 -r 123e06d5d9af mainwindow.cpp --- a/mainwindow.cpp Tue Jan 11 13:56:48 2011 +0000 +++ b/mainwindow.cpp Tue Jan 11 17:56:22 2011 +0000 @@ -491,6 +491,16 @@ hgIgnorePath = workFolderPath; hgIgnorePath += "/.hgignore"; + + if (!QDir(workFolderPath).exists()) return; + QFile f(hgIgnorePath); + if (!f.exists()) { + f.open(QFile::WriteOnly); + QTextStream *ts = new QTextStream(&f); + *ts << "syntax: glob\n"; + delete ts; + f.close(); + } params << hgIgnorePath;