changeset 159:087d7cdde662

* Add InConflict state (not yet used)
author Chris Cannam
date Fri, 03 Dec 2010 12:29:57 +0000
parents 006630304b69
children 98fa31128e9d
files filestates.cpp filestates.h
diffstat 2 files changed, 16 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/filestates.cpp	Fri Dec 03 12:29:24 2010 +0000
+++ b/filestates.cpp	Fri Dec 03 12:29:57 2010 +0000
@@ -31,11 +31,19 @@
     m_added.clear();
     m_removed.clear();
     m_missing.clear();
+    m_inConflict.clear();
     m_unknown.clear();
 }
 
 FileStates::State FileStates::charToState(QChar c, bool *ok)
 {
+    // Note that InConflict does not correspond to a stat char -- it's
+    // reported separately, by resolve --list -- stat reports files in
+    // conflict as M which means they will appear in more than one bin
+    // if we handle them naively.
+
+    //!!! -- but InConflict isn't actually handled elsewhere, it's
+    //!!! -- only a placeholder really at the moment
     if (ok) *ok = true;
     if (c == 'M') return Modified;
     if (c == 'A') return Added;
@@ -56,6 +64,7 @@
     case Unknown: return &m_unknown;
     case Removed: return &m_removed;
     case Missing: return &m_missing;
+    case InConflict: return &m_inConflict;
     }
 }
 
@@ -85,8 +94,9 @@
     }
 
     DEBUG << "FileStates: " << m_modified.size() << " modified, " << m_added.size()
-            << " added, " << m_removed.size() << " removed, " << m_missing.size()
-            << " missing, " << m_unknown.size() << " unknown" << endl;
+          << " added, " << m_removed.size() << " removed, " << m_missing.size()
+          << " missing, " << m_inConflict.size() << " in conflict, "
+          << m_unknown.size() << " unknown" << endl;
 }
 
 QStringList FileStates::getFilesInState(State s) const
--- a/filestates.h	Fri Dec 03 12:29:24 2010 +0000
+++ b/filestates.h	Fri Dec 03 12:29:57 2010 +0000
@@ -35,9 +35,10 @@
         Unknown,
         Removed,
         Missing,
+        InConflict
 
         FirstState = Clean,
-        LastState = Missing
+        LastState = InConflict
     };
 
     void parseStates(QString text);
@@ -51,6 +52,7 @@
     QStringList unknown() const { return m_unknown; }
     QStringList removed() const { return m_removed; }
     QStringList missing() const { return m_missing; }
+    QStringList inConflict() const { return m_inConflict; }
 
     State getStateOfFile(QString file) const;
 
@@ -60,6 +62,7 @@
     QStringList m_unknown;
     QStringList m_removed;
     QStringList m_missing;
+    QStringList m_inConflict;
     QMap<QString, State> m_stateMap;
 
     State charToState(QChar, bool * = 0);