comparison mainwindow.cpp @ 330:bf4bbb53e217

Fix incorrect report following failed push (was falling through to merge-failed case)
author Chris Cannam
date Sat, 12 Mar 2011 22:18:08 +0000
parents ef977e7482cd
children acfe9390d5c6
comparison
equal deleted inserted replaced
329:ef977e7482cd 330:bf4bbb53e217
1816 return; 1816 return;
1817 case ACT_CLONEFROMREMOTE: 1817 case ACT_CLONEFROMREMOTE:
1818 // if clone fails, we have no repo 1818 // if clone fails, we have no repo
1819 m_workFolderPath = ""; 1819 m_workFolderPath = "";
1820 enableDisableActions(); 1820 enableDisableActions();
1821 break; 1821 break; // go on to default report
1822 case ACT_INCOMING: 1822 case ACT_INCOMING:
1823 // returns non-zero code and no output if the check was 1823 // returns non-zero code and no output if the check was
1824 // successful but there are no changes pending 1824 // successful but there are no changes pending
1825 if (output.replace(QRegExp("(^|\\n)warning: [^\\n]*\\n"), "").trimmed() == "") { 1825 if (output.replace(QRegExp("(^|\\n)warning: [^\\n]*\\n"), "").trimmed() == "") {
1826 showIncoming(""); 1826 showIncoming("");
1827 return; 1827 return;
1828 } 1828 }
1829 break; 1829 break; // go on to default report
1830 case ACT_QUERY_HEADS: 1830 case ACT_QUERY_HEADS:
1831 // fails if repo is empty; we don't care (if there's a genuine 1831 // fails if repo is empty; we don't care (if there's a genuine
1832 // problem, something else will fail too). Pretend it 1832 // problem, something else will fail too). Pretend it
1833 // succeeded, so that any further actions that are contingent 1833 // succeeded, so that any further actions that are contingent
1834 // on the success of the heads query get carried out properly. 1834 // on the success of the heads query get carried out properly.
1843 case ACT_PUSH: 1843 case ACT_PUSH:
1844 if (output.contains("creates new remote heads")) { 1844 if (output.contains("creates new remote heads")) {
1845 reportNewRemoteHeads(output); 1845 reportNewRemoteHeads(output);
1846 return; 1846 return;
1847 } 1847 }
1848 break; // go on to default report
1848 case ACT_MERGE: 1849 case ACT_MERGE:
1849 case ACT_RETRY_MERGE: 1850 case ACT_RETRY_MERGE:
1850 MoreInformationDialog::information 1851 MoreInformationDialog::information
1851 (this, tr("Merge"), tr("Merge failed"), 1852 (this, tr("Merge"), tr("Merge failed"),
1852 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."), 1853 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."),
1853 output); 1854 output);
1854 return; 1855 return;
1855 case ACT_STAT: 1856 case ACT_STAT:
1856 break; // go on and report 1857 break; // go on to default report
1857 default: 1858 default:
1858 break; 1859 break;
1859 } 1860 }
1860 1861
1861 QString command = action.executable; 1862 QString command = action.executable;