Fixed bug where a fossil output line would not be output under certain conditions

FossilOrigin-Name: 2744a0db324c05cb0f4e2e73128d8c3837d66479
This commit is contained in:
kostas 2015-05-03 17:57:33 +00:00
parent 8afb6c280c
commit 3b15999117
4 changed files with 47 additions and 16 deletions

View File

@ -1,5 +1,5 @@
C Merged\sUpdateRevision\sinto\sUpdate\nDisabled\sunimplemented\sRemotes\sand\sSettings\sworkspace\sitems
D 2015-05-03T15:37:36.581
C Fixed\sbug\swhere\sa\sfossil\soutput\sline\swould\snot\sbe\soutput\sunder\scertain\sconditions
D 2015-05-03T17:57:33.003
F .travis.yml 77966888a81c4ceee1fcc79bce842c9667ad8a35
F debian/changelog eb4304dfcb6bb66850ec740838090eb50ce1249b
F debian/compat b6abd567fa79cbe0196d093a067271361dc6ca8b
@ -196,8 +196,8 @@ F src/FileActionDialog.cpp fcaebf9986f789b3440d5390b3458ad5f86fe0c8
F src/FileActionDialog.h 15db1650b3a13d70bc338371e4c033c66e3b79ce
F src/FileTableView.cpp 5ddf8c391c9a3ac449ec61fb1db837b577afeec2
F src/FileTableView.h 03e56d87c2d46411b9762b87f4d301619aaf18df
F src/Fossil.cpp f27b97eaf068275a0e8558dd2b739f9c7b61774a
F src/Fossil.h f9b49ed930af2159f97a86ce0f6da821a0b0819e
F src/Fossil.cpp ca7ad24622e1fc1a03c92d7ae9b51afc17f7c09c
F src/Fossil.h d65a7461d213bcc30f08724d3306c6ee00843217
F src/LoggedProcess.cpp 2a1e5c94bc1e57c8984563e66c210e43a14dc60c
F src/LoggedProcess.h 85df7c635c807a5a0e8c4763f17a0752aaff7261
F src/MainWindow.cpp 0a5183c05ff08b635cd9517182b2357240ea52be
@ -220,7 +220,7 @@ F ui/FileActionDialog.ui 89bb4dc2d0b8adcd41adcb11ec65f2028a09a12d
F ui/MainWindow.ui 9dd0f9ef3f486413c9af912ac557c0e7bf9c6f50
F ui/RevisionDialog.ui 27c3b98c665fec014a50cbf3352c0627f75e68cd
F ui/SettingsDialog.ui 2b7c2870e0054b0f4106f495d85d02c0b814df8b
P 07f3a4f2e0f2a67172434d4336bec1dea1fc5856
R 99002beae8d92d0dad7136d0a700f184
P a297f70942e3dccf9904c054fb9e633edb9c59cb
R e0fe347c0fa4907206bddff7538284f8
U kostas
Z 062c1bdf7b6c35cfdeda74b3f8d3385e
Z 101db116ff5c22dbcc32decf8bc34dd6

View File

@ -1 +1 @@
a297f70942e3dccf9904c054fb9e633edb9c59cb
2744a0db324c05cb0f4e2e73128d8c3837d66479

View File

@ -725,14 +725,34 @@ bool Fossil::runFossilRaw(const QStringList &args, QStringList *output, int *exi
process.getLogAndClear(input);
#ifdef QT_DEBUG // Log fossil output in debug builds
if(!input.isEmpty())
if(!input.isEmpty() && (runFlags & RUNFLAGS_DEBUG) )
qDebug() << "[" << ++input_index << "] '" << input.data() << "'\n";
#endif
buffer += decoder->toUnicode(input);
#ifdef QT_DEBUG // breakpint
#if 0 // Keep this for now to simulate bad parses
if(runFlags & RUNFLAGS_DEBUG)
{
static int debug=1;
if(debug==1)
{
buffer = " 4: [df2233aabe09ef] on 2013-02-03 02:51:33\n"
" History\n"
" 5: [df2233aabe09ef] on 2013-02-15 03:55:37\n"
" ";
debug++;
}
else if(debug==2)
{
buffer = " Diff\n"
" ";
debug++;
}
else
buffer="";
}
#endif
#ifdef QT_DEBUG // breakpoint
//if(buffer.indexOf("SQLITE_CANTOPEN")!=-1)
// qDebug() << "Breakpoint\n";
#endif
@ -759,9 +779,12 @@ bool Fossil::runFossilRaw(const QStringList &args, QStringList *output, int *exi
if(last_line_start>0)
{
int before_last_line_start = buffer.lastIndexOf(EOL_MARK, last_line_start-1);
// No line before ?
// No new-line before ?
if(before_last_line_start==-1)
before_last_line_start = 0; // Use entire line
else
++before_last_line_start; // Skip new-line
// Extract previous line
before_last_line = buffer.mid(before_last_line_start, last_line_start-before_last_line_start);
@ -785,12 +808,19 @@ bool Fossil::runFossilRaw(const QStringList &args, QStringList *output, int *exi
QStringList log_lines = buffer.left(last_line_start).split(EOL_MARK);
for(int l=0; l<log_lines.length(); ++l)
{
// Do not output the last line if it not complete. The first one should be ok though
if(l>0 && l==log_lines.length()-1 && buffer[buffer.length()-1] != EOL_MARK )
// Skip last line if we have a query. This will be handled manually further down
if(have_query && l==log_lines.length()-1)
continue;
QString line = log_lines[l].trimmed();
#ifdef QT_DEBUG
if(runFlags & RUNFLAGS_DEBUG)
{
qDebug() << "LINE: " << line << "\n";
}
#endif
if(line.isEmpty())
continue;

View File

@ -18,7 +18,8 @@ enum RunFlags
RUNFLAGS_SILENT_INPUT = 1<<0,
RUNFLAGS_SILENT_OUTPUT = 1<<1,
RUNFLAGS_SILENT_ALL = RUNFLAGS_SILENT_INPUT | RUNFLAGS_SILENT_OUTPUT,
RUNFLAGS_DETACHED = 1<<2
RUNFLAGS_DETACHED = 1<<2,
RUNFLAGS_DEBUG = 1<<3,
};
enum RepoStatus