comparison mainwindow.cpp @ 164:de39da2f9f4d

* (Re)implement tagging
author Chris Cannam
date Fri, 03 Dec 2010 20:37:40 +0000
parents 5c262ac73948
children 4bad3c5c053a
comparison
equal deleted inserted replaced
163:5c262ac73948 164:de39da2f9f4d
339 } 339 }
340 return tag; 340 return tag;
341 } 341 }
342 342
343 343
344 void MainWindow::hgTag() 344 void MainWindow::hgTag(QString id)
345 { 345 {
346 QStringList params; 346 QStringList params;
347 QString tag; 347 QString tag;
348 348
349 if (ConfirmCommentDialog::confirmAndGetShortComment 349 if (ConfirmCommentDialog::confirmAndGetShortComment
350 (this, 350 (this,
351 tr("Tag"), 351 tr("Tag"),
352 tr("Enter tag:"), 352 tr("Enter tag:"),
353 tag)) { 353 tag)) {
354 if (!tag.isEmpty()) //!!! do something better if it is empty 354 if (!tag.isEmpty()) {//!!! do something better if it is empty
355 { 355
356 params << "tag" << "--user" << getUserInfo() << filterTag(tag); 356 params << "tag" << "--user" << getUserInfo();
357 params << "--rev" << Changeset::hashOf(id) << filterTag(tag);
357 358
358 runner->requestAction(HgAction(ACT_TAG, workFolderPath, params)); 359 runner->requestAction(HgAction(ACT_TAG, workFolderPath, params));
359 } 360 }
360 } 361 }
361 } 362 }
417 { 418 {
418 QSettings settings; 419 QSettings settings;
419 QString merge = settings.value("mergebinary", "").toString(); 420 QString merge = settings.value("mergebinary", "").toString();
420 if (merge == "") { 421 if (merge == "") {
421 QStringList bases; 422 QStringList bases;
422 bases << "fmdiff3" << "kdiff3" << "meld" << "diffuse"; 423 bases << "fmdiff3" << "meld" << "diffuse" << "kdiff3";
423 bool found = false; 424 bool found = false;
424 foreach (QString base, bases) { 425 foreach (QString base, bases) {
425 merge = findExecutable(base); 426 merge = findExecutable(base);
426 if (merge != base) { 427 if (merge != base) {
427 found = true; 428 found = true;
529 lastRevertedFiles = files; 530 lastRevertedFiles = files;
530 531
531 if (files.empty()) { 532 if (files.empty()) {
532 params << "revert" << "--no-backup"; 533 params << "revert" << "--no-backup";
533 } else { 534 } else {
534 params << "revert" << "--no-backup" << "--" << files; 535 params << "revert" << "--" << files;
535 } 536 }
536 537
537 //!!! This is problematic. If you've got an uncommitted 538 //!!! This is problematic. If you've got an uncommitted
538 //!!! merge, you can't revert it without declaring which 539 //!!! merge, you can't revert it without declaring which
539 //!!! parent of the merge you want to revert to (reasonably 540 //!!! parent of the merge you want to revert to (reasonably
560 params << "resolve" << "--mark"; 561 params << "resolve" << "--mark";
561 562
562 if (files.empty()) { 563 if (files.empty()) {
563 params << "--all"; 564 params << "--all";
564 } else { 565 } else {
565 params << files; 566 params << "--" << files;
566 } 567 }
567 568
568 runner->requestAction(HgAction(ACT_RESOLVE_MARK, workFolderPath, params)); 569 runner->requestAction(HgAction(ACT_RESOLVE_MARK, workFolderPath, params));
569 } 570 }
570 571
581 582
582 QStringList files = hgTabs->getSelectedUnresolvedFiles(); 583 QStringList files = hgTabs->getSelectedUnresolvedFiles();
583 if (files.empty()) { 584 if (files.empty()) {
584 params << "--all"; 585 params << "--all";
585 } else { 586 } else {
586 params << files; 587 params << "--" << files;
587 } 588 }
588 589
589 runner->requestAction(HgAction(ACT_RETRY_MERGE, workFolderPath, params)); 590 runner->requestAction(HgAction(ACT_RETRY_MERGE, workFolderPath, params));
590 591
591 mergeCommitComment = tr("Merge"); 592 mergeCommitComment = tr("Merge");
1423 case ACT_ADD: 1424 case ACT_ADD:
1424 hgTabs->clearSelections(); 1425 hgTabs->clearSelections();
1425 shouldHgStat = true; 1426 shouldHgStat = true;
1426 break; 1427 break;
1427 1428
1429 case ACT_TAG:
1430 needNewLog = true;
1431 shouldHgStat = true;
1432 break;
1433
1428 case ACT_FOLDERDIFF: 1434 case ACT_FOLDERDIFF:
1429 case ACT_CHGSETDIFF: 1435 case ACT_CHGSETDIFF:
1430 case ACT_SERVE: 1436 case ACT_SERVE:
1431 case ACT_TAG:
1432 case ACT_HG_IGNORE: 1437 case ACT_HG_IGNORE:
1433 shouldHgStat = true; 1438 shouldHgStat = true;
1434 break; 1439 break;
1435 1440
1436 case ACT_UPDATE: 1441 case ACT_UPDATE:
1539 connect(hgFolderDiffAct, SIGNAL(triggered()), this, SLOT(hgFolderDiff())); 1544 connect(hgFolderDiffAct, SIGNAL(triggered()), this, SLOT(hgFolderDiff()));
1540 // connect(hgChgSetDiffAct, SIGNAL(triggered()), this, SLOT(hgChgSetDiff())); 1545 // connect(hgChgSetDiffAct, SIGNAL(triggered()), this, SLOT(hgChgSetDiff()));
1541 connect(hgUpdateAct, SIGNAL(triggered()), this, SLOT(hgUpdate())); 1546 connect(hgUpdateAct, SIGNAL(triggered()), this, SLOT(hgUpdate()));
1542 connect(hgRevertAct, SIGNAL(triggered()), this, SLOT(hgRevert())); 1547 connect(hgRevertAct, SIGNAL(triggered()), this, SLOT(hgRevert()));
1543 connect(hgMergeAct, SIGNAL(triggered()), this, SLOT(hgMerge())); 1548 connect(hgMergeAct, SIGNAL(triggered()), this, SLOT(hgMerge()));
1544 connect(hgTagAct, SIGNAL(triggered()), this, SLOT(hgTag())); 1549 // connect(hgTagAct, SIGNAL(triggered()), this, SLOT(hgTag()));
1545 connect(hgIgnoreAct, SIGNAL(triggered()), this, SLOT(hgIgnore())); 1550 connect(hgIgnoreAct, SIGNAL(triggered()), this, SLOT(hgIgnore()));
1546 1551
1547 connect(settingsAct, SIGNAL(triggered()), this, SLOT(settings())); 1552 connect(settingsAct, SIGNAL(triggered()), this, SLOT(settings()));
1548 connect(openAct, SIGNAL(triggered()), this, SLOT(open())); 1553 connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
1549 1554
1581 connect(hgTabs, SIGNAL(diffToParent(QString, QString)), 1586 connect(hgTabs, SIGNAL(diffToParent(QString, QString)),
1582 this, SLOT(hgDiffToParent(QString, QString))); 1587 this, SLOT(hgDiffToParent(QString, QString)));
1583 1588
1584 connect(hgTabs, SIGNAL(mergeFrom(QString)), 1589 connect(hgTabs, SIGNAL(mergeFrom(QString)),
1585 this, SLOT(hgMergeFrom(QString))); 1590 this, SLOT(hgMergeFrom(QString)));
1586 /* 1591
1587 connect(hgTabs, SIGNAL(tag(QString)), 1592 connect(hgTabs, SIGNAL(tag(QString)),
1588 this, SLOT(hgTag(QString))); 1593 this, SLOT(hgTag(QString)));
1589 */
1590 } 1594 }
1591 1595
1592 /*!!! 1596 /*!!!
1593 void MainWindow::tabChanged(int currTab) 1597 void MainWindow::tabChanged(int currTab)
1594 { 1598 {