# # # patch "src/model/GetContentChanged.cpp" # from [2439f22b9d789044215089681d24f11f0fb13564] # to [fac748457f536fe8ae1e4022dfc4be9ae9e3a4eb] # # patch "src/model/Inventory.cpp" # from [5703f4938e870d6b7bce4bcb6842bdf774ccb1a3] # to [1533bee7e89701036706041fbaa6b96565754a8f] # # patch "src/monotone/MonotoneDelegate.cpp" # from [95343ee52914f400dd7684659e52014d183a06ad] # to [6fe7d984293395f5d83ffdcf0c6735d93186a6f7] # # patch "src/monotone/WorkspaceCommitter.cpp" # from [76e1c923faf0bc8b961f66de8e52b83168b4a925] # to [92385fbdf21a74204a437900988f228a3ab55e0b] # # patch "src/util/BasicIOWriter.cpp" # from [fe9b0a54b7bcd5ce91d9914f3efbf3cac736684e] # to [7b8e837fcf8496ffda95a7669e07ebb1abf60622] # # patch "src/view/InventoryView.cpp" # from [63c2663edc002f95e50cfc9424aeba3c6761d075] # to [441ff9c1a21693b33b00efe2894d0f50425f6b3c] # # patch "src/view/dialogs/FileHistory.cpp" # from [43a648e35da3f8bccd1faf087e6f14f7f243966a] # to [fb8b038667a771cbaee11c0f60d1269104e774d3] # ============================================================ --- src/model/GetContentChanged.cpp 2439f22b9d789044215089681d24f11f0fb13564 +++ src/model/GetContentChanged.cpp fac748457f536fe8ae1e4022dfc4be9ae9e3a4eb @@ -76,7 +76,7 @@ bool GetContentChanged::readChanges(cons // find a starting point // FIXME: we assume that the given path is part of this revision! startRev = MonotoneDelegate::getBaseWorkspaceRevision(this); - Q_ASSERT(!startRev.isNull()); + I(!startRev.isNull()); startPath = path; return queryContentChanged(startRev, startPath); @@ -140,7 +140,7 @@ void GetContentChanged::parseOutput() } revsForPathStack.enqueue(par); - Q_ASSERT(queryCorrespondingPath(startRev, startPath, par)); + I(queryCorrespondingPath(startRev, startPath, par)); } return; } @@ -151,13 +151,13 @@ void GetContentChanged::parseOutput() // _beforehand_ via get_corresponding_path, we should always // get a stanza out here BasicIOParser parser(AutomateCommand::data); - Q_ASSERT(parser.parse()); + I(parser.parse()); StanzaList stanzas = parser.getStanzas(); foreach (Stanza st, stanzas) { - Q_ASSERT(st.size() == 1); + I(st.size() == 1); QString rev = st.at(0).hash; - Q_ASSERT(!rev.isNull()); + I(!rev.isNull()); // if we have this particular revision already recorded, // skip it @@ -174,19 +174,19 @@ void GetContentChanged::parseOutput() revsForPathStack.enqueue(rev); // query for the corresponding path - Q_ASSERT(queryCorrespondingPath(startRev, startPath, rev)); + I(queryCorrespondingPath(startRev, startPath, rev)); } // query for the parents of this revision for the // next round - Q_ASSERT(queryParents(rev)); + I(queryParents(rev)); } return; } if (current == CorrespondingPath) { - Q_ASSERT(revsForPathStack.size() > 0); + I(revsForPathStack.size() > 0); QString rev = revsForPathStack.dequeue(); if (AutomateCommand::data.isEmpty()) @@ -196,7 +196,7 @@ void GetContentChanged::parseOutput() // but has no corresponding path) if (revisions.contains(rev)) { - Q_ASSERT(false); + I(false); } // apparently this is another, not interesting (parent) node @@ -207,13 +207,13 @@ void GetContentChanged::parseOutput() } BasicIOParser parser(AutomateCommand::data); - Q_ASSERT(parser.parse()); + I(parser.parse()); StanzaList stanzas = parser.getStanzas(); - Q_ASSERT(stanzas.size() == 1); + I(stanzas.size() == 1); Stanza st = stanzas.at(0); - Q_ASSERT(st.size() == 1); + I(st.size() == 1); StanzaEntry en = st.at(0); - Q_ASSERT(en.sym == "file" && en.vals.size() == 1); + I(en.sym == "file" && en.vals.size() == 1); QString path = en.vals.at(0); // we're also inserting a lot of uninteresting (revision, path) @@ -222,18 +222,18 @@ void GetContentChanged::parseOutput() pathInRevision.insert(rev, path); // try to get the next marked node - Q_ASSERT(queryContentChanged(rev, path)); + I(queryContentChanged(rev, path)); return; } - Q_ASSERT(false); + I(false); } bool GetContentChanged::handleError(int retCode) { if (retCode == 2) { - Q_ASSERT(commandStack.size() > 0); + I(commandStack.size() > 0); // FIXME: this is a big hack, since we assume that the only error 2 // we can get here for this command basically reads like @@ -277,7 +277,7 @@ QVariant GetContentChanged::data(const Q int row = index.row(); if (row >= revisions.size()) return QVariant(); QString rev = revisions.at(row); - Q_ASSERT(pathInRevision.contains(rev)); + I(pathInRevision.contains(rev)); switch (col) { ============================================================ --- src/model/Inventory.cpp 5703f4938e870d6b7bce4bcb6842bdf774ccb1a3 +++ src/model/Inventory.cpp 1533bee7e89701036706041fbaa6b96565754a8f @@ -140,6 +140,7 @@ QList Inventory::buildTr } QList Inventory::buildTreeRecursive(QList & items, InventoryItem * parentItem) +{ QList finalItems; QString parentPath = ""; @@ -324,8 +325,6 @@ bool Inventory::parseInventoryLine( } bool Inventory::parseInventoryLine( - const QString &inputString, - int &status, const QString &inputString, int &status, int &from_id, @@ -395,7 +394,7 @@ bool Inventory::parseInventoryLine( { status |= InventoryItem::Unchanged; } - { + else { W(QString("Unknown status third tripel %1").arg(list[3])); } @@ -468,7 +467,7 @@ QMap Inventory:: if (item->hasStatus(InventoryItem::RenamedTo)) { InventoryItem * oldItem = item->getRenamedFrom(); - Q_ASSERT(oldItem); + I(oldItem); // yes, there is an unknown path with the same name! if (oldItem->hasStatus(InventoryItem::Unknown)) @@ -483,7 +482,7 @@ QMap Inventory:: break; } } - Q_ASSERT(found); + I(found); candidates.append(entry); } else @@ -508,7 +507,7 @@ QMap Inventory:: break; } } - Q_ASSERT(found); + I(found); // TODO: for this to work however, we need some kind of // mtn automate ident command ============================================================ --- src/monotone/MonotoneDelegate.cpp 95343ee52914f400dd7684659e52014d183a06ad +++ src/monotone/MonotoneDelegate.cpp 6fe7d984293395f5d83ffdcf0c6735d93186a6f7 @@ -174,7 +174,7 @@ QString MonotoneDelegate::getBranchNameS QStringList parts = branchName.split('.'); if (parts.size() == 1) return branchName; - int maxSize = 20; + int maxSize = 30; int minNeededChars = (parts.size() * 2) - 1; QString shortBranchName; ============================================================ --- src/monotone/WorkspaceCommitter.cpp 76e1c923faf0bc8b961f66de8e52b83168b4a925 +++ src/monotone/WorkspaceCommitter.cpp 92385fbdf21a74204a437900988f228a3ab55e0b @@ -101,7 +101,7 @@ bool WorkspaceCommitter::run() if (isPatch && en.sym == "from") { I(!pair.first.isEmpty()); - Q_ASSERT(!en.hash.isNull()); + I(!en.hash.isNull()); pair.second = en.hash; fileChanges.append(pair); break; @@ -159,7 +159,7 @@ bool WorkspaceCommitter::run() D(QString("Committed revision %1").arg(revisionId)); // update _MTN/revision and _MTN/options - Q_ASSERT(workspaceDir.cd("_MTN")); + I(workspaceDir.cd("_MTN")); return writeRevision() && writeOptions(); } @@ -190,7 +190,7 @@ bool WorkspaceCommitter::writeRevision() BasicIOWriter writer(stanzas); QString rev = writer.write(); - Q_ASSERT(file.write(rev.toLatin1())); + I(file.write(rev.toLatin1())); file.close(); return true; @@ -207,23 +207,23 @@ bool WorkspaceCommitter::writeOptions() // read and parse the basic_io stanzas and set the correct branch name BasicIOParser parser(QString::fromUtf8(file.readAll())); - Q_ASSERT(parser.parse()); + I(parser.parse()); StanzaList stanzas = parser.getStanzas(); - Q_ASSERT(stanzas.size() == 1); + I(stanzas.size() == 1); for (int i=0, j=stanzas[0].size(); i 0)); + I(!(en.hash.isNull() && en.vals.size() > 0)); if (!en.hash.isNull()) { ============================================================ --- src/view/InventoryView.cpp 63c2663edc002f95e50cfc9424aeba3c6761d075 +++ src/view/InventoryView.cpp 441ff9c1a21693b33b00efe2894d0f50425f6b3c @@ -564,13 +564,13 @@ void InventoryView::slotFileHistory() if (item->hasStatus(InventoryItem::RenamedFrom)) { InventoryItem * newItem = item->getRenamedTo(); - Q_ASSERT(newItem); + I(newItem); path = newItem->getPath(); } if (item->hasStatus(InventoryItem::RenamedTo)) { InventoryItem * oldItem = item->getRenamedFrom(); - Q_ASSERT(oldItem); + I(oldItem); path = oldItem->getPath(); } ============================================================ --- src/view/dialogs/FileHistory.cpp 43a648e35da3f8bccd1faf087e6f14f7f243966a +++ src/view/dialogs/FileHistory.cpp fb8b038667a771cbaee11c0f60d1269104e774d3 @@ -47,7 +47,7 @@ FileHistory::FileHistory(QWidget * paren setWindowTitle(title.arg(path)); // read the changes - Q_ASSERT(changeModel->readChanges(path)); + I(changeModel->readChanges(path)); } FileHistory::~FileHistory()