comparison mainwindow.cpp @ 153:70fe12873106

* Show both parents of uncommitted merge; fixes to right-button menus
author Chris Cannam
date Thu, 02 Dec 2010 17:55:21 +0000
parents 2b997861174b
children 6bcb4a4d6521
comparison
equal deleted inserted replaced
152:2b997861174b 153:70fe12873106
87 findDiffBinaryName(); 87 findDiffBinaryName();
88 88
89 ColourSet *cs = ColourSet::instance(); 89 ColourSet *cs = ColourSet::instance();
90 cs->clearDefaultNames(); 90 cs->clearDefaultNames();
91 cs->addDefaultName(""); 91 cs->addDefaultName("");
92 cs->addDefaultName("default");
92 cs->addDefaultName(getUserInfo()); 93 cs->addDefaultName(getUserInfo());
93 94
94 if (workFolderPath == "") { 95 if (workFolderPath == "") {
95 open(); 96 open();
96 } 97 }
157 158
158 void MainWindow::hgStat() 159 void MainWindow::hgStat()
159 { 160 {
160 QStringList params; 161 QStringList params;
161 params << "stat" << "-ardum"; 162 params << "stat" << "-ardum";
163
164 // annoyingly, hg stat actually modifies the working directory --
165 // it creates files called hg-checklink and hg-checkexec to test
166 // properties of the filesystem
167 if (fsWatcher) fsWatcher->blockSignals(true);
168
162 runner->requestAction(HgAction(ACT_STAT, workFolderPath, params)); 169 runner->requestAction(HgAction(ACT_STAT, workFolderPath, params));
163 } 170 }
164 171
165 void MainWindow::hgQueryPaths() 172 void MainWindow::hgQueryPaths()
166 { 173 {
202 { 209 {
203 QStringList params; 210 QStringList params;
204 params << "log"; 211 params << "log";
205 212
206 foreach (QString p, prune) { 213 foreach (QString p, prune) {
207 QString number = p.split(':')[0]; 214 params << "--prune" << Changeset::hashOf(p);
208 params << "--prune" << number;
209 } 215 }
210 216
211 params << "--template"; 217 params << "--template";
212 params << Changeset::getLogTemplate(); 218 params << Changeset::getLogTemplate();
213 219
448 // Diff parent against working folder (folder diff) 454 // Diff parent against working folder (folder diff)
449 455
450 params << "--config" << "extensions.extdiff=" << "extdiff"; 456 params << "--config" << "extensions.extdiff=" << "extdiff";
451 params << "--program" << diffBinaryName; 457 params << "--program" << diffBinaryName;
452 458
459 params << hgTabs->getSelectedCommittableFiles(); // may be none: whole dir
460
453 runner->requestAction(HgAction(ACT_FOLDERDIFF, workFolderPath, params)); 461 runner->requestAction(HgAction(ACT_FOLDERDIFF, workFolderPath, params));
454 } 462 }
455 463
456 464
457 void MainWindow::hgDiffToCurrent(QString id) 465 void MainWindow::hgDiffToCurrent(QString id)
460 468
461 // Diff given revision against working folder 469 // Diff given revision against working folder
462 470
463 params << "--config" << "extensions.extdiff=" << "extdiff"; 471 params << "--config" << "extensions.extdiff=" << "extdiff";
464 params << "--program" << diffBinaryName; 472 params << "--program" << diffBinaryName;
465 params << "--rev" << id; 473 params << "--rev" << Changeset::hashOf(id);
466 474
467 runner->requestAction(HgAction(ACT_FOLDERDIFF, workFolderPath, params)); 475 runner->requestAction(HgAction(ACT_FOLDERDIFF, workFolderPath, params));
468 } 476 }
469 477
470 478
474 482
475 // Diff given revision against working folder 483 // Diff given revision against working folder
476 484
477 params << "--config" << "extensions.extdiff=" << "extdiff"; 485 params << "--config" << "extensions.extdiff=" << "extdiff";
478 params << "--program" << diffBinaryName; 486 params << "--program" << diffBinaryName;
479 params << "--rev" << parent << "--rev" << child; 487 params << "--rev" << Changeset::hashOf(parent)
488 << "--rev" << Changeset::hashOf(child);
480 489
481 runner->requestAction(HgAction(ACT_CHGSETDIFF, workFolderPath, params)); 490 runner->requestAction(HgAction(ACT_CHGSETDIFF, workFolderPath, params));
482 } 491 }
483 492
484 493
494 503
495 void MainWindow::hgUpdateToRev(QString id) 504 void MainWindow::hgUpdateToRev(QString id)
496 { 505 {
497 QStringList params; 506 QStringList params;
498 507
499 params << "update" << "--rev" << id << "--check"; 508 params << "update" << "--rev" << Changeset::hashOf(id) << "--check";
500 509
501 runner->requestAction(HgAction(ACT_UPDATE, workFolderPath, params)); 510 runner->requestAction(HgAction(ACT_UPDATE, workFolderPath, params));
502 } 511 }
503 512
504 513
549 void MainWindow::hgMergeFrom(QString id) 558 void MainWindow::hgMergeFrom(QString id)
550 { 559 {
551 QStringList params; 560 QStringList params;
552 561
553 params << "merge"; 562 params << "merge";
554 params << "--rev" << id; 563 params << "--rev" << Changeset::hashOf(id);
555 564
556 runner->requestAction(HgAction(ACT_MERGE, workFolderPath, params)); 565 runner->requestAction(HgAction(ACT_MERGE, workFolderPath, params));
557 } 566 }
558 567
559 568
1234 case ACT_QUERY_BRANCH: 1243 case ACT_QUERY_BRANCH:
1235 currentBranch = output.trimmed(); 1244 currentBranch = output.trimmed();
1236 break; 1245 break;
1237 1246
1238 case ACT_STAT: 1247 case ACT_STAT:
1248 if (fsWatcher) fsWatcher->blockSignals(false);
1239 hgTabs->updateWorkFolderFileList(output); 1249 hgTabs->updateWorkFolderFileList(output);
1240 updateFileSystemWatcher(); 1250 updateFileSystemWatcher();
1241 break; 1251 break;
1242 1252
1243 case ACT_INCOMING: 1253 case ACT_INCOMING:
1288 case ACT_QUERY_PARENTS: 1298 case ACT_QUERY_PARENTS:
1289 { 1299 {
1290 foreach (Changeset *cs, currentParents) delete cs; 1300 foreach (Changeset *cs, currentParents) delete cs;
1291 currentParents = Changeset::parseChangesets(output); 1301 currentParents = Changeset::parseChangesets(output);
1292 QStringList parentIds = Changeset::getIds(currentParents); 1302 QStringList parentIds = Changeset::getIds(currentParents);
1293 hgTabs->setCurrent(parentIds); 1303 hgTabs->setCurrent(parentIds, currentBranch);
1294 } 1304 }
1295 break; 1305 break;
1296 1306
1297 case ACT_QUERY_HEADS: 1307 case ACT_QUERY_HEADS:
1298 { 1308 {