diff --git a/MainWindow.cpp b/MainWindow.cpp index fdd165f..d0e2cb0 100644 --- a/MainWindow.cpp +++ b/MainWindow.cpp @@ -568,6 +568,9 @@ void MainWindow::scanWorkspace() QFileInfoList all_files; QString wkdir = getCurrentWorkspace(); + if(wkdir.isEmpty()) + return; + // Retrieve the status of files tracked by fossil QStringList res; if(!runFossil(QStringList() << "ls" << "-l", &res, RUNGLAGS_SILENT_ALL)) @@ -692,26 +695,32 @@ void MainWindow::scanWorkspace() if(!runFossil(QStringList() << "stash" << "ls", &res, RUNGLAGS_SILENT_ALL)) return; - for(QStringList::iterator line_it=res.begin(); line_it!=res.end(); ++line_it) - { - QString l = (*line_it).trimmed(); - int colon = l.indexOf(':'); + // 19: [5c46757d4b9765] on 2012-04-22 04:41:15 + QRegExp stash_rx("\\s*(\\d+):\\s+\\[(.*)\\] on (\\d+)-(\\d+)-(\\d+) (\\d+):(\\d+):(\\d+)", Qt::CaseInsensitive); - // When no colon we have no stash to process - if(colon==-1) + for(QStringList::iterator line_it=res.begin(); line_it!=res.end(); ) + { + QString line = *line_it; + + int index = stash_rx.indexIn(line); + if(index==-1) break; - QString id = l.left(colon); - - // Parse stash name + QString id = stash_rx.cap(1); ++line_it; - // Invalid stash, exit - if(line_it==res.end()) - break; + QString name; + // Finish at an anonymous stash or start of a new stash ? + if(line_it==res.end() || stash_rx.indexIn(*line_it)!=-1) + name = line.trimmed(); + else // Named stash + { + // Parse stash name + name = (*line_it); + name = name.trimmed(); + ++line_it; + } - QString name = (*line_it); - name = name.trimmed(); stashMap.insert(name, id); } diff --git a/manifest b/manifest index ff1f566..03ebd25 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Added\ssupport\sfor\susing\sa\suser\sspecified\sfolder\sfor\sworkpaces\sinstead\sthe\sfossil\srepository\sfolder\n -D 2012-04-22T09:08:38.880 +C Merged\swith\sHead +D 2012-04-22T09:16:18.102 F CommitDialog.cpp a46020a9361151d8d286a2670257d01d8967bf69 F CommitDialog.h f1ee8db92103164e7db55a8407ccdcff24571b72 F CommitDialog.ui 813d7cba316e226de1a22b7e480bb969fbe9b0c4 @@ -8,7 +8,7 @@ F FileActionDialog.h 15db1650b3a13d70bc338371e4c033c66e3b79ce F FileActionDialog.ui c63644428579741aeb5fa052e237ba799ced9ad7 F FileTableView.cpp 5ddf8c391c9a3ac449ec61fb1db837b577afeec2 F FileTableView.h 03e56d87c2d46411b9762b87f4d301619aaf18df -F MainWindow.cpp daacedbfdbe8d4160f4f0edcea40a89dc49788a3 +F MainWindow.cpp 4d34103a080446b2cae976cff458fbefc0f35db1 F MainWindow.h 1f6d8db9cf25a89fbbb1e0b33cc63a0e43cfe7ff F MainWindow.ui 6c12a0b141b86c6994d5835618acba19a9ff1976 F SettingsDialog.cpp e1fad18cc020d08b82c6d35dc94f6624deec9a3b @@ -176,7 +176,7 @@ F installer/fuel.iss 13b6a938bcdf273cbd3649d2549887baa1577214 F installer/license.txt 4cc77b90af91e615a64ae04893fdffa7939db84c F main.cpp 69c1f9e873c016ef466d20298a67c3bc4c2b2f3a F resources.qrc e98383ed205f4e37100c60057e0129c3b86dea53 -P 03c02e59f350369dd0a66f24fda209f4ab50137d -R 42b9b12104a524ef4b427fe73065af06 +P 5cd50b0577298e1b73d16c1f74a086911f870839 c346118e744ae9d9c397194a7aa29f42256d76db +R 8d0020cd16d9c6db1969571811de5b0d U kostas -Z 9796c88ed9d1107c3536f179fdb2c4ca +Z 72c3cf43944122c9e74c60b95d0f848d diff --git a/manifest.uuid b/manifest.uuid index 7fd8e0a..ea130ae 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -5cd50b0577298e1b73d16c1f74a086911f870839 \ No newline at end of file +5c0c785ed246b1bed2acd0a6b6f31e7d35c7d5b1 \ No newline at end of file