Fuel
Check-in [7d22e48d7b]
Not logged in
Overview
Comment:Improved parsing of fossil queries when filenames contain query-like characters
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7d22e48d7b032510e627999857fcd9f08a910855
User & Date: kostas 2012-05-04 08:29:09.608
Context
2012-05-04
09:46
Changed alignment of status column in the FileView check-in: 9362f078cb user: kostas tags: trunk
08:29
Improved parsing of fossil queries when filenames contain query-like characters check-in: 7d22e48d7b user: kostas tags: trunk
2012-05-03
09:03
Cleanups check-in: 18f5bc2700 user: kostas tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to MainWindow.cpp.
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
	return exit_code == EXIT_SUCCESS;
}

//------------------------------------------------------------------------------
static QString ParseFossilQuery(QString line)
{
	// Extract question
	int qend = line.indexOf('(');
	if(qend == -1)
		qend = line.indexOf('[');
	Q_ASSERT(qend!=-1);
	line = line.left(qend);
	line = line.trimmed();
	line += "?";
	line[0]=QString(line[0]).toUpper()[0];
	return line;
}







|

|







997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
	return exit_code == EXIT_SUCCESS;
}

//------------------------------------------------------------------------------
static QString ParseFossilQuery(QString line)
{
	// Extract question
	int qend = line.lastIndexOf('(');
	if(qend == -1)
		qend = line.lastIndexOf('[');
	Q_ASSERT(qend!=-1);
	line = line.left(qend);
	line = line.trimmed();
	line += "?";
	line[0]=QString(line[0]).toUpper()[0];
	return line;
}
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
			last_line = buffer;

		last_line = last_line.trimmed();

		// Check if we have a query
		bool ends_qmark = !last_line.isEmpty() && last_line[last_line.length()-1]=='?';
		bool have_yn_query = last_line.toLower().indexOf("y/n")!=-1;
		int have_yna_query = last_line.toLower().indexOf("a=always/y/n")!=-1 || last_line.toLower().indexOf("yes/no/all")!=-1;
		int have_an_query = last_line.toLower().indexOf("a=always/n")!=-1;

		bool have_query = ends_qmark && (have_yn_query || have_yna_query || have_an_query);

		// Flush only the unnecessary part of the buffer to the log
		QStringList log_lines = buffer.left(last_line_start).split(EOL_MARK);
		foreach(QString line, log_lines)
		{







|
|







1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
			last_line = buffer;

		last_line = last_line.trimmed();

		// Check if we have a query
		bool ends_qmark = !last_line.isEmpty() && last_line[last_line.length()-1]=='?';
		bool have_yn_query = last_line.toLower().indexOf("y/n")!=-1;
		bool have_yna_query = last_line.toLower().indexOf("a=always/y/n")!=-1 || last_line.toLower().indexOf("yes/no/all")!=-1;
		bool have_an_query = last_line.toLower().indexOf("a=always/n")!=-1;

		bool have_query = ends_qmark && (have_yn_query || have_yna_query || have_an_query);

		// Flush only the unnecessary part of the buffer to the log
		QStringList log_lines = buffer.left(last_line_start).split(EOL_MARK);
		foreach(QString line, log_lines)
		{