comparison src/mainwindow.cpp @ 520:a17c06f773cd

idiot -- we don't need to query bookmarks separately, we can just add them to the log template
author Chris Cannam
date Wed, 09 Nov 2011 13:04:00 +0000
parents 000f13faa089
children b5a342a71218
comparison
equal deleted inserted replaced
519:000f13faa089 520:a17c06f773cd
319 319
320 QStringList params; 320 QStringList params;
321 params << "branch"; 321 params << "branch";
322 m_runner->requestAction(HgAction(ACT_QUERY_BRANCH, m_workFolderPath, params)); 322 m_runner->requestAction(HgAction(ACT_QUERY_BRANCH, m_workFolderPath, params));
323 */ 323 */
324 }
325
326 void MainWindow::hgQueryBookmarks()
327 {
328 QStringList params;
329 params << "bookmarks";
330 m_runner->requestAction(HgAction(ACT_QUERY_BOOKMARKS, m_workFolderPath, params));
331 } 324 }
332 325
333 void MainWindow::hgQueryHeadsActive() 326 void MainWindow::hgQueryHeadsActive()
334 { 327 {
335 QStringList params; 328 QStringList params;
2200 case ACT_CHGSETDIFF: 2193 case ACT_CHGSETDIFF:
2201 // external program, unlikely to be anything useful in stderr 2194 // external program, unlikely to be anything useful in stderr
2202 // and some return with failure codes when something as basic 2195 // and some return with failure codes when something as basic
2203 // as the user closing the window via the wm happens 2196 // as the user closing the window via the wm happens
2204 return; 2197 return;
2205 case ACT_QUERY_BOOKMARKS:
2206 // probably just means we have an old Hg version: simply don't
2207 // display bookmarks
2208 return;
2209 case ACT_MERGE: 2198 case ACT_MERGE:
2210 case ACT_RETRY_MERGE: 2199 case ACT_RETRY_MERGE:
2211 MoreInformationDialog::information 2200 MoreInformationDialog::information
2212 (this, tr("Merge"), tr("Merge failed"), 2201 (this, tr("Merge"), tr("Merge failed"),
2213 tr("Some files were not merged successfully.<p>You can Merge again to repeat the interactive merge; use Revert to abandon the merge entirely; or edit the files that are in conflict in an editor and, when you are happy with them, choose Mark Resolved in each file's right-button menu."), 2202 tr("Some files were not merged successfully.<p>You can Merge again to repeat the interactive merge; use Revert to abandon the merge entirely; or edit the files that are in conflict in an editor and, when you are happy with them, choose Mark Resolved in each file's right-button menu."),
2294 } 2283 }
2295 2284
2296 case ACT_QUERY_BRANCH: 2285 case ACT_QUERY_BRANCH:
2297 m_currentBranch = output.trimmed(); 2286 m_currentBranch = output.trimmed();
2298 break; 2287 break;
2299
2300 case ACT_QUERY_BOOKMARKS:
2301 {
2302 m_bookmarks.clear();
2303 QStringList outList = output.split('\n', QString::SkipEmptyParts);
2304 foreach (QString line, outList) {
2305 QStringList items = line.split(' ', QString::SkipEmptyParts);
2306 if (items[0] == "*") {
2307 if (items.size() == 3) {
2308 m_bookmarks[items[2]].push_back(items[1]);
2309 }
2310 } else {
2311 if (items.size() == 2) {
2312 m_bookmarks[items[1]].push_back(items[0]);
2313 }
2314 }
2315 }
2316 m_hgTabs->setBookmarks(m_bookmarks);
2317 break;
2318 }
2319 2288
2320 case ACT_STAT: 2289 case ACT_STAT:
2321 m_lastStatOutput = output; 2290 m_lastStatOutput = output;
2322 updateFileSystemWatcher(); 2291 updateFileSystemWatcher();
2323 break; 2292 break;
2527 default: 2496 default:
2528 break; 2497 break;
2529 } 2498 }
2530 2499
2531 // Sequence when no full log required: 2500 // Sequence when no full log required:
2532 // paths -> branch -> stat -> bookmarks -> resolve-list -> heads -> 2501 // paths -> branch -> stat -> resolve-list -> heads ->
2533 // incremental-log (only if heads changed) -> parents 2502 // incremental-log (only if heads changed) -> parents
2534 // 2503 //
2535 // Sequence when full log required: 2504 // Sequence when full log required:
2536 // paths -> branch -> stat -> bookmarks -> resolve-list -> heads -> 2505 // paths -> branch -> stat -> resolve-list -> heads ->
2537 // parents -> log 2506 // parents -> log
2538 // 2507 //
2539 // Note we want to call enableDisableActions only once, at the end 2508 // Note we want to call enableDisableActions only once, at the end
2540 // of whichever sequence is in use. 2509 // of whichever sequence is in use.
2541 2510
2573 // NB this call is duplicated in hgQueryBranch 2542 // NB this call is duplicated in hgQueryBranch
2574 hgStat(); 2543 hgStat();
2575 break; 2544 break;
2576 2545
2577 case ACT_STAT: 2546 case ACT_STAT:
2578 hgQueryBookmarks();
2579 break;
2580
2581 case ACT_QUERY_BOOKMARKS:
2582 hgResolveList(); 2547 hgResolveList();
2583 break; 2548 break;
2584 2549
2585 case ACT_RESOLVE_LIST: 2550 case ACT_RESOLVE_LIST:
2586 hgQueryHeadsActive(); 2551 hgQueryHeadsActive();