# HG changeset patch # User Martin Geisler # Date 1277372330 -7200 # Node ID 94bbc4b30b2af22e45b0cda1826e0fa9d18e1001 # Parent 42f3cb49373b89426ec83ab94eb8b8002b22f371 Handle filenames starting with "-" Such filenames are mistaken for command line options, unless we tell Mercurial to stop processing command line options with the special "--" option. diff -r 42f3cb49373b -r 94bbc4b30b2a mainwindow.cpp --- a/mainwindow.cpp Wed Jun 23 21:12:46 2010 +0300 +++ b/mainwindow.cpp Thu Jun 24 11:38:50 2010 +0200 @@ -153,7 +153,7 @@ if (QMessageBox::Ok == QMessageBox::warning(this, "Remove file", "Really remove file " + currentFile.mid(2) + "?", QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Cancel)) { - params << "remove" << "--after" << "--force" << currentFile.mid(2); //Jump over status marker characters (e.g "M ") + params << "remove" << "--after" << "--force" << "--" << currentFile.mid(2); //Jump over status marker characters (e.g "M ") runner -> startProc(getHgBinaryName(), workFolderPath, params); runningAction = ACT_REMOVE; @@ -171,7 +171,7 @@ if (!currentFile.isEmpty()) { - params << "annotate" << currentFile.mid(2); //Jump over status marker characters (e.g "M ") + params << "annotate" << "--" << currentFile.mid(2); //Jump over status marker characters (e.g "M ") runner -> startProc(getHgBinaryName(), workFolderPath, params); runningAction = ACT_ANNOTATE; @@ -189,7 +189,7 @@ if (!currentFile.isEmpty()) { - params << "resolve" << "--mark" << currentFile.mid(2); //Jump over status marker characters (e.g "M ") + params << "resolve" << "--mark" << "--" << currentFile.mid(2); //Jump over status marker characters (e.g "M ") runner -> startProc(getHgBinaryName(), workFolderPath, params); runningAction = ACT_RESOLVE_MARK; @@ -394,7 +394,7 @@ if (!currentFile.isEmpty()) { //Diff parent file against working folder file - params << "kdiff3" << currentFile.mid(2); + params << "kdiff3" << "--" << currentFile.mid(2); runner -> startProc(getHgBinaryName(), workFolderPath, params, false); runningAction = ACT_FILEDIFF; } @@ -487,7 +487,7 @@ QStringList params; QString currentFile = hgExp -> getCurrentFileListLine(); - params << "revert" << "--no-backup" << currentFile.mid(2); + params << "revert" << "--no-backup" << "--" << currentFile.mid(2); runner -> startProc(getHgBinaryName(), workFolderPath, params); runningAction = ACT_REVERT;