# HG changeset patch # User Chris Cannam # Date 1294314743 0 # Node ID 05255f23f2af5e3f9ce2fa22c63f5a869a8f0a5a # Parent 5498774b34c80145078ca20658c83307bfded741 * Properly handle the case where the working copy is empty but the repo is not (e.g. just after convert) diff -r 5498774b34c8 -r 05255f23f2af filestatuswidget.cpp --- a/filestatuswidget.cpp Wed Jan 05 20:59:48 2011 +0000 +++ b/filestatuswidget.cpp Thu Jan 06 11:52:23 2011 +0000 @@ -97,8 +97,8 @@ m_descriptions[FileStates::Clean] = tr("You have not changed these files."); m_descriptions[FileStates::Modified] = tr("You have changed these files since you last committed them."); - m_descriptions[FileStates::Added] = tr("These files will be added to version control next time you commit."); - m_descriptions[FileStates::Removed] = tr("These files will be removed from version control next time you commit.
" + m_descriptions[FileStates::Added] = tr("These files will be added to version control next time you commit them."); + m_descriptions[FileStates::Removed] = tr("These files will be removed from version control next time you commit them.
" "They will not be deleted from the local folder."); m_descriptions[FileStates::Missing] = tr("These files are recorded in the version control, but absent from your working folder.
" "If you intended to delete them, select them and use Remove to tell the version control system about it.
" diff -r 5498774b34c8 -r 05255f23f2af mainwindow.cpp --- a/mainwindow.cpp Wed Jan 05 20:59:48 2011 +0000 +++ b/mainwindow.cpp Thu Jan 06 11:52:23 2011 +0000 @@ -181,7 +181,8 @@ "modify it under the terms of the GNU General Public License as " "published by the Free Software Foundation; either version 2 of the " "License, or (at your option) any later version. See the file " - "COPYING included with this distribution for more information.

")); + "COPYING included with this distribution for more information.

" + )); } void MainWindow::clearSelections() @@ -2023,6 +2024,7 @@ bool canUpdate = false; bool haveMerge = false; bool emptyRepo = false; + bool noWorkingCopy = false; int currentBranchHeads = 0; if (currentParents.size() == 1) { @@ -2049,7 +2051,16 @@ } } } else if (currentParents.size() == 0) { - emptyRepo = true; + if (currentHeads.size() == 0) { + // No heads -> empty repo + emptyRepo = true; + } else { + // Heads, but no parents -> no working copy, e.g. we have + // just converted this repo but haven't updated in it yet. + // Uncommon but confusing; probably merits a special case + noWorkingCopy = true; + canUpdate = true; + } } else { haveMerge = true; justMerged = true; @@ -2073,6 +2084,8 @@ hgTabs->setState(tr("(Examining repository)")); } else if (emptyRepo) { hgTabs->setState(tr("Nothing committed to this repository yet")); + } else if (noWorkingCopy) { + hgTabs->setState(tr("No working copy yet: consider updating")); } else if (canMerge) { hgTabs->setState(tr("Awaiting merge on %1").arg(branchText)); } else if (!hgTabs->getAllUnresolvedFiles().empty()) {