diff 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
line wrap: on
line diff
--- a/mainwindow.cpp	Thu Dec 02 11:51:15 2010 +0000
+++ b/mainwindow.cpp	Thu Dec 02 17:55:21 2010 +0000
@@ -89,6 +89,7 @@
     ColourSet *cs = ColourSet::instance();
     cs->clearDefaultNames();
     cs->addDefaultName("");
+    cs->addDefaultName("default");
     cs->addDefaultName(getUserInfo());
 
     if (workFolderPath == "") {
@@ -159,6 +160,12 @@
 {
     QStringList params;
     params << "stat" << "-ardum";
+
+    // annoyingly, hg stat actually modifies the working directory --
+    // it creates files called hg-checklink and hg-checkexec to test
+    // properties of the filesystem
+    if (fsWatcher) fsWatcher->blockSignals(true);
+
     runner->requestAction(HgAction(ACT_STAT, workFolderPath, params));
 }
 
@@ -204,8 +211,7 @@
     params << "log";
 
     foreach (QString p, prune) {
-        QString number = p.split(':')[0];
-        params << "--prune" << number;
+        params << "--prune" << Changeset::hashOf(p);
     }
         
     params << "--template";
@@ -450,6 +456,8 @@
     params << "--config" << "extensions.extdiff=" << "extdiff";
     params << "--program" << diffBinaryName;
 
+    params << hgTabs->getSelectedCommittableFiles(); // may be none: whole dir
+
     runner->requestAction(HgAction(ACT_FOLDERDIFF, workFolderPath, params));
 }
 
@@ -462,7 +470,7 @@
 
     params << "--config" << "extensions.extdiff=" << "extdiff";
     params << "--program" << diffBinaryName;
-    params << "--rev" << id;
+    params << "--rev" << Changeset::hashOf(id);
 
     runner->requestAction(HgAction(ACT_FOLDERDIFF, workFolderPath, params));
 }
@@ -476,7 +484,8 @@
 
     params << "--config" << "extensions.extdiff=" << "extdiff";
     params << "--program" << diffBinaryName;
-    params << "--rev" << parent << "--rev" << child;
+    params << "--rev" << Changeset::hashOf(parent)
+           << "--rev" << Changeset::hashOf(child);
 
     runner->requestAction(HgAction(ACT_CHGSETDIFF, workFolderPath, params));
 }
@@ -496,7 +505,7 @@
 {
     QStringList params;
 
-    params << "update" << "--rev" << id << "--check";
+    params << "update" << "--rev" << Changeset::hashOf(id) << "--check";
 
     runner->requestAction(HgAction(ACT_UPDATE, workFolderPath, params));
 }
@@ -551,7 +560,7 @@
     QStringList params;
 
     params << "merge";
-    params << "--rev" << id;
+    params << "--rev" << Changeset::hashOf(id);
     
     runner->requestAction(HgAction(ACT_MERGE, workFolderPath, params));
 }
@@ -1236,6 +1245,7 @@
         break;
 
     case ACT_STAT:
+        if (fsWatcher) fsWatcher->blockSignals(false);
         hgTabs->updateWorkFolderFileList(output);
         updateFileSystemWatcher();
         break;
@@ -1290,7 +1300,7 @@
         foreach (Changeset *cs, currentParents) delete cs;
         currentParents = Changeset::parseChangesets(output);
         QStringList parentIds = Changeset::getIds(currentParents);
-        hgTabs->setCurrent(parentIds);
+        hgTabs->setCurrent(parentIds, currentBranch);
     }
         break;