From dc4395b7375d453b71cb0a15328a23849799444f Mon Sep 17 00:00:00 2001 From: Wouter den Breejen Date: Tue, 24 Jul 2007 12:47:28 +0000 Subject: [PATCH] --- src/libext3cow/Makefile.am | 8 +- src/libext3cow/snapshot.cc | 15 ++-- src/libext3cow/snapshot.hh | 4 +- src/libstore/build.cc | 4 - src/libstore/db.cc | 69 +++++++++++++----- src/libstore/local-store.cc | 5 -- src/libstore/local-store.hh | 2 - src/libstore/remote-store.cc | 6 -- src/libstore/remote-store.hh | 2 - src/libstore/store-api.hh | 2 - src/libstore/store-state.cc | 137 +++++++++++------------------------ src/libstore/store-state.hh | 4 +- src/libutil/types.hh | 2 +- src/libutil/util.cc | 30 ++++++++ src/libutil/util.hh | 6 +- src/nix-state/nix-state.cc | 36 ++++----- 16 files changed, 164 insertions(+), 168 deletions(-) diff --git a/src/libext3cow/Makefile.am b/src/libext3cow/Makefile.am index bb9dc579a..8b9b7a1df 100644 --- a/src/libext3cow/Makefile.am +++ b/src/libext3cow/Makefile.am @@ -6,8 +6,12 @@ pkginclude_HEADERS = snapshot.hh #TODO linux kernel header -libext3cow_la_LIBADD = ../boost/format/libformat.la +libext3cow_la_LIBADD = ../libutil/libutil.la \ + ../boost/format/libformat.la AM_CXXFLAGS = -Wall \ - -I$(srcdir)/.. ${aterm_include} + -I$(srcdir)/.. ${aterm_include} \ + -I$(srcdir)/../libutil +AM_CFLAGS = \ + ${aterm_include} \ No newline at end of file diff --git a/src/libext3cow/snapshot.cc b/src/libext3cow/snapshot.cc index 992f3ec84..18789d4ba 100644 --- a/src/libext3cow/snapshot.cc +++ b/src/libext3cow/snapshot.cc @@ -6,11 +6,14 @@ #include "ext3cow_tools.h" #include "snapshot.hh" +#include "types.hh" //using namespace nix; namespace nix { +/////////////////////Original functions commented out: + /* void snapshot_usage(void){ @@ -18,7 +21,6 @@ void snapshot_usage(void){ } - int snapshot_main(int argc, char** argv){ int fd; @@ -56,13 +58,14 @@ int snapshot_main(int argc, char** argv){ } */ -//End original function -unsigned int take_snapshot(const char* dir) //const string & file_or_dir) +/////////////////////End original functions + + +unsigned int take_snapshot(const string & dir2) //const string & file_or_dir) { - //const char* dir = "test"; + const char* dir = dir2.c_str(); int fd; - int ret; unsigned int epoch = 0; //char path[256] = ".\0"; @@ -91,4 +94,4 @@ unsigned int take_snapshot(const char* dir) //const string & file_or_dir) return epoch; } -} \ No newline at end of file +} diff --git a/src/libext3cow/snapshot.hh b/src/libext3cow/snapshot.hh index 299a32bf0..93b074ee5 100644 --- a/src/libext3cow/snapshot.hh +++ b/src/libext3cow/snapshot.hh @@ -1,10 +1,12 @@ #ifndef SNAPSHOT_H_ #define SNAPSHOT_H_ +#include "types.hh" + namespace nix { //unsigned int take_snapshot(const string & file_or_dir); -unsigned int take_snapshot(const char* dir); +unsigned int take_snapshot(const string & dir); } diff --git a/src/libstore/build.cc b/src/libstore/build.cc index 1086d4c18..2bdb476ab 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -1812,10 +1812,6 @@ void DerivationGoal::computeClosure() //Commit state commitStatePathTxn(txn, statePath); - //Set first revision (if we committed something) - if(readRevisionNumber(statePath) == 1) - updateRevisionsRecursivelyTxn(txn, statePath); - //Shared state Path sharedState = drv.stateOutputs.find("state")->second.sharedState; if(sharedState != ""){ diff --git a/src/libstore/db.cc b/src/libstore/db.cc index a83e980b8..b1afc4c8a 100644 --- a/src/libstore/db.cc +++ b/src/libstore/db.cc @@ -1,6 +1,9 @@ #include "db.hh" #include "util.hh" #include "pathlocks.hh" +#include "derivations.hh" +#include "local-store.hh" +#include "misc.hh" #include #include @@ -595,25 +598,39 @@ void Database::setStateRevisions(const Transaction & txn, TableId table, int root_revision = getNewRevisionNumber(txn, table, statePath); //Sort based on statePath to RevisionNumbersClosure - RevisionNumbers sorted_revisions; vector sortedStatePaths; for (RevisionNumbersSet::const_iterator i = revisions.begin(); i != revisions.end(); ++i) sortedStatePaths.push_back((*i).first); sort(sortedStatePaths.begin(), sortedStatePaths.end()); - for (vector::const_iterator i = sortedStatePaths.begin(); i != sortedStatePaths.end(); ++i) - sorted_revisions.push_back(revisions.at(*i)); + + vector sorted_revisions; + for (vector::const_iterator i = sortedStatePaths.begin(); i != sortedStatePaths.end(); ++i){ + map ss_revisions = revisions.at(*i); + + //Sort the set of paths that have revisions based on + vector sorted_ssp; + for (map::const_iterator j = ss_revisions.begin(); j != ss_revisions.end(); ++j) + sorted_ssp.push_back((*j).first); + sort(sorted_ssp.begin(), sorted_ssp.end()); + + //Insert into sorted_ss_revs based on the sorted order + RevisionNumbers sorted_ss_revs; + for (vector::const_iterator j = sorted_ssp.begin(); j != sorted_ssp.end(); ++j) + sorted_ss_revs.push_back(ss_revisions.at(*j)); + + //Insert ...... + sorted_revisions.push_back(sorted_ss_revs); + } //Debugging - for (vector::const_iterator i = sortedStatePaths.begin(); i != sortedStatePaths.end(); ++i) - printMsg(lvlError, format("Insert: %1% into %2%") % int2String(revisions.at(*i)) % *i); + //for (vector::const_iterator i = sortedStatePaths.begin(); i != sortedStatePaths.end(); ++i) + // printMsg(lvlError, format("Insert: %1% into %2%") % revisions.at(*i) % *i); - //Convert the int's into Strings + //Convert the vector into Strings Strings data; - for (RevisionNumbers::const_iterator i = sorted_revisions.begin(); i != sorted_revisions.end(); ++i) { - int revisionnumber = *i; - data.push_back(int2String(revisionnumber)); - } - + for (vector::const_iterator i = sorted_revisions.begin(); i != sorted_revisions.end(); ++i) + data.push_back(packRevisionNumbers(*i)); + //Create the key string key = makeStatePathRevision(statePath, root_revision); @@ -651,14 +668,32 @@ bool Database::queryStateRevisions(const Transaction & txn, TableId table, const //Convert the Strings into int's and match them to the sorted statePaths for (vector::const_iterator i = sortedStatePaths.begin(); i != sortedStatePaths.end(); ++i){ - string getRevisionS = data.front(); + + RevisionNumbers ss_revisions = unpackRevisionNumbers(data.front()); data.pop_front(); - int getRevision; - bool succeed = string2Int(getRevisionS, getRevision); - if(!succeed) - throw Error(format("Cannot read revision number from db of path '%1%'") % statePath); - revisions[*i] = getRevision; + //query state versioined directorys/files + vector sortedPaths; + Derivation drv = derivationFromPath(queryStatePathDrvTxn(txn, statePath)); + DerivationStateOutputs stateOutputs = drv.stateOutputs; + DerivationStateOutputDirs stateOutputDirs = drv.stateOutputDirs; + for (DerivationStateOutputDirs::const_iterator j = stateOutputDirs.begin(); j != stateOutputDirs.end(); ++j){ + string thisdir = (j->second).path; + string fullstatedir = statePath + "/" + thisdir; + if(thisdir == "/") //exception for the root dir + fullstatedir = statePath + "/"; + sortedPaths.push_back(fullstatedir); + } + sort(sortedPaths.begin(), sortedPaths.end()); //sort + + //link + map revisions_ss; + for (vector::const_iterator j = sortedPaths.begin(); j != sortedPaths.end(); ++j){ + revisions_ss[*j] = ss_revisions.front(); + ss_revisions.pop_front(); + } + + revisions[*i] = revisions_ss; } if(!notempty) diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 68c1f0cc7..95753e50e 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -1700,11 +1700,6 @@ void LocalStore::commitStatePath(const Path & statePath) nix::commitStatePathTxn(noTxn, statePath); } -void LocalStore::updateRevisionsRecursively(const Path & statePath) -{ - nix::updateRevisionsRecursivelyTxn(noTxn, statePath); -} - void setSolidStateReferencesTxn(const Transaction & txn, const Path & statePath, const PathSet & paths) { Strings ss = Strings(paths.begin(), paths.end()); diff --git a/src/libstore/local-store.hh b/src/libstore/local-store.hh index 8d1401088..da93b9044 100644 --- a/src/libstore/local-store.hh +++ b/src/libstore/local-store.hh @@ -107,8 +107,6 @@ public: bool queryAvailableStateRevisions(const Path & statePath, RevisionNumbers & revisions); void commitStatePath(const Path & statePath); - - void updateRevisionsRecursively(const Path & statePath); }; diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index 976f09d1c..9e2e9955e 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -492,10 +492,4 @@ void RemoteStore::commitStatePath(const Path & statePath) } -//TODO -void RemoteStore::updateRevisionsRecursively(const Path & statePath) -{ - -} - } diff --git a/src/libstore/remote-store.hh b/src/libstore/remote-store.hh index 519d10b02..6fc97864f 100644 --- a/src/libstore/remote-store.hh +++ b/src/libstore/remote-store.hh @@ -96,8 +96,6 @@ public: void commitStatePath(const Path & statePath); - void updateRevisionsRecursively(const Path & statePath); - private: AutoCloseFD fdSocket; FdSink to; diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh index b9e15ea27..0d019a667 100644 --- a/src/libstore/store-api.hh +++ b/src/libstore/store-api.hh @@ -229,8 +229,6 @@ public: virtual bool queryAvailableStateRevisions(const Path & statePath, RevisionNumbers & revisions) = 0; virtual void commitStatePath(const Path & statePath) = 0; - - virtual void updateRevisionsRecursively(const Path & statePath) = 0; }; diff --git a/src/libstore/store-state.cc b/src/libstore/store-state.cc index 7522597fa..dbe590553 100644 --- a/src/libstore/store-state.cc +++ b/src/libstore/store-state.cc @@ -34,40 +34,17 @@ void createStateDirs(const DerivationStateOutputDirs & stateOutputDirs, const De Path statePath = stateOutputs.find("state")->second.statepath; string stateDir = statePath; - /* - - string svnbin = nixSVNPath + "/svn"; - string svnadminbin = nixSVNPath + "/svnadmin"; - PathSet intervalPaths; - //check if we can create state and staterepos dirs + //check if we can create state dirs //TODO - //Create a repository for this state location - string repos = getStateReposPath("stateOutput:staterepospath", stateDir); - - printMsg(lvlTalkative, format("Adding statedir '%1%' from repository '%2%'") % stateDir % repos); - - if(IsDirectory(repos)) - printMsg(lvlTalkative, format("Repos %1% already exists, so we use that repository") % repos); - else{ - Strings p_args; - p_args.push_back("create"); - p_args.push_back(repos); - runProgram_AndPrintOutput(svnadminbin, true, p_args, "svnadmin"); //TODO create as nixbld.nixbld chmod 700... can you still commit then ?? - } - - string statedir_svn = stateDir + "/.svn/"; - if( ! IsDirectory(statedir_svn) ){ - Strings p_args; - p_args.push_back("checkout"); - p_args.push_back("file://" + repos); - p_args.push_back(stateDir); - runProgram_AndPrintOutput(svnbin, true, p_args, "svn"); //TODO checkout as user + /* + if( ! IsDirectory( ....... ) ){ } else - printMsg(lvlTalkative, format("Statedir %1% already exists, so dont check out its repository again") % statedir_svn); + printMsg(lvlTalkative, format("Statedir %1% already exists, so dont ........ ???? ") % ...); + */ for (DerivationStateOutputDirs::const_reverse_iterator i = stateOutputDirs.rbegin(); i != stateOutputDirs.rend(); ++i){ DerivationStateOutputDir d = i->second; @@ -93,36 +70,22 @@ void createStateDirs(const DerivationStateOutputDirs & stateOutputDirs, const De //Initialize the counters for the statePaths that have an interval to 0 vector empty; store->setStatePathsInterval(intervalPaths, empty, true); - - */ } void commitStatePathTxn(const Transaction & txn, const Path & statePath) { + //TODO: include code from: updateRevisionsRecursivelyTxn(txn, root_statePath); + if(!isValidStatePathTxn(txn, statePath)) throw Error(format("path `%1%' is not a valid state path") % statePath); - //queryDeriversStatePath?? Derivation drv = derivationFromPath(queryStatePathDrvTxn(txn, statePath)); - - //Extract the neccecary info from each Drv DerivationStateOutputs stateOutputs = drv.stateOutputs; - //Path statePath = stateOutputs.find("state")->second.statepath; DerivationStateOutputDirs stateOutputDirs = drv.stateOutputDirs; - //Specifiy the SVN binarys - string svnbin = nixSVNPath + "/svn"; - string svnadminbin = nixSVNPath + "/svnadmin"; + printMsg(lvlError, format("Snapshotting statePath: %1%") % statePath); - //Print - printMsg(lvlError, format("Committing statePath: %1%") % statePath); - - //Vector includeing all commit scripts: - vector subversionedpaths; - vector subversionedpathsCommitBoolean; - vector nonversionedpaths; //of type none, no versioning needed - //Get all the inverals from the database at once PathSet intervalPaths; for (DerivationStateOutputDirs::const_reverse_iterator i = stateOutputDirs.rbegin(); i != stateOutputDirs.rend(); ++i){ @@ -135,10 +98,10 @@ void commitStatePathTxn(const Transaction & txn, const Path & statePath) intervalPaths.insert(fullstatedir); } } - vector intervals = store->getStatePathsInterval(intervalPaths); //TODO !!!!!!!!!!!!! txn ?? + vector intervals = store->getStatePathsInterval(intervalPaths); //TODO !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! txn int intervalAt=0; - for (DerivationStateOutputDirs::const_reverse_iterator i = stateOutputDirs.rbegin(); i != stateOutputDirs.rend(); ++i){ + for (DerivationStateOutputDirs::const_iterator i = stateOutputDirs.begin(); i != stateOutputDirs.end(); ++i){ DerivationStateOutputDir d = i->second; string thisdir = d.path; @@ -147,61 +110,50 @@ void commitStatePathTxn(const Transaction & txn, const Path & statePath) fullstatedir = statePath + "/"; if(d.type == "none"){ - nonversionedpaths.push_back(fullstatedir); continue; } - - subversionedpaths.push_back(fullstatedir); if(d.type == "interval"){ //Get the interval-counter from the database int interval_counter = intervals[intervalAt]; int interval = d.getInterval(); - subversionedpathsCommitBoolean.push_back(interval_counter % interval == 0); - + //update the interval intervals[intervalAt] = interval_counter + 1; intervalAt++; + + if(interval_counter % interval != 0){ return; } } - else if(d.type == "full") - subversionedpathsCommitBoolean.push_back(true); - else if(d.type == "manual") //TODO !!!!! - subversionedpathsCommitBoolean.push_back(false); + else if(d.type == "full"){ } + else if(d.type == "manual"){ return; } //TODO !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! else - throw Error(format("interval '%1%' is not handled in nix-state") % d.type); - } - - //Get the a repository for this state location - string repos = getStateReposPath("stateOutput:staterepospath", statePath); //this is a copy from store-state.cc - string checkoutcommand = svnbin + " --ignore-externals checkout file://" + repos + " " + statePath; + throw Error(format("Type '%1%' is not handled in nix-state") % d.type); - //Call the commit script with the appropiate paramenters - string subversionedstatepathsarray; - for (vector::iterator i = subversionedpaths.begin(); i != subversionedpaths.end(); ++i) - subversionedstatepathsarray += *(i) + " "; - - string subversionedpathsCommitBooleansarray; - for (vector::iterator i = subversionedpathsCommitBoolean.begin(); i != subversionedpathsCommitBoolean.end(); ++i) - subversionedpathsCommitBooleansarray += bool2string(*i) + " "; - - string nonversionedstatepathsarray; - for (vector::iterator i = nonversionedpaths.begin(); i != nonversionedpaths.end(); ++i) - nonversionedstatepathsarray += *(i) + " "; + //We got here so we need to commit + + unsigned int epoch_time; + + if(pathExists(fullstatedir) || FileExist(fullstatedir)){ + epoch_time = take_snapshot(fullstatedir); + printMsg(lvlError, format("Snapshotted '%1%' with id '%2%'") % fullstatedir % epoch_time); + } + else + { + //TODO !!!!!!!!!!!!!! + } + + //Put in database !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + //TODO + } - //make the call to the commit script - Strings p_args; - p_args.push_back(svnbin); - p_args.push_back(subversionedstatepathsarray); - p_args.push_back(subversionedpathsCommitBooleansarray); - p_args.push_back(nonversionedstatepathsarray); - p_args.push_back(checkoutcommand); - p_args.push_back(statePath); - runProgram_AndPrintOutput(nixLibexecDir + "/nix/nix-statecommit.sh", true, p_args, "svn"); - //Update the intervals again - //setStatePathsIntervalTxn(txn, intervalPaths, intervals); //TODO!!!!!!!!!!!!!!!!!!!!!! uncomment and txn ?? + //setStatePathsIntervalTxn(txn, intervalPaths, intervals); //TODO!!!!!!!!!!!!!!!!!!!!!!!!!!!!! uncomment } +/* + * This function takes all state requisites (references) and revision numbers and stores them ... + */ +/* void updateRevisionsRecursivelyTxn(const Transaction & txn, const Path & statePath) { //Save all revisions for the call to @@ -229,13 +181,6 @@ void updateRevisionsRecursivelyTxn(const Transaction & txn, const Path & statePa int readRevisionNumber(Path statePath) { - string s = "/media/ext3cow/cca/"; - const char* ss = s.c_str(); - unsigned int i = take_snapshot(ss); - printMsg(lvlError, format("SS: '%1%'") % i); - - //////// - /* string svnbin = nixSVNPath + "/svn"; RevisionNumbers revisions; @@ -257,8 +202,12 @@ int readRevisionNumber(Path statePath) throw Error(format("Cannot read revision number of path '%1%'") % repos); return revision; - */ - return 0; } +*/ + +// string s = "/media/ext3cow/cca/"; +// unsigned int i = take_snapshot(s); +// printMsg(lvlError, format("SS: '%1%'") % i); + } diff --git a/src/libstore/store-state.hh b/src/libstore/store-state.hh index 4fce4c128..65ad2fd41 100644 --- a/src/libstore/store-state.hh +++ b/src/libstore/store-state.hh @@ -14,10 +14,10 @@ void createStateDirs(const DerivationStateOutputDirs & stateOutputDirs, const De void commitStatePathTxn(const Transaction & txn, const Path & statePath); /* TODO */ -void updateRevisionsRecursivelyTxn(const Transaction & txn, const Path & statePath); +//void updateRevisionsRecursivelyTxn(const Transaction & txn, const Path & statePath); /* TODO */ -int readRevisionNumber(Path statePath); +//int readRevisionNumber(Path statePath); } diff --git a/src/libutil/types.hh b/src/libutil/types.hh index fd3ba23a0..40c8cf87a 100644 --- a/src/libutil/types.hh +++ b/src/libutil/types.hh @@ -60,7 +60,7 @@ typedef set PathSet; //state types typedef list RevisionNumbers; //the Strings (list) of StateReferences and this list are connected by position -typedef map RevisionNumbersSet; //We include to the paths to sort on +typedef map > RevisionNumbersSet; //We include to the paths to sort on typedef map StateReferences; diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 742ca9eae..fc4138717 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -918,6 +918,36 @@ Strings unpackStrings(const string & s) return strings; } +string packRevisionNumbers(const RevisionNumbers & revs) +{ + string seperator = "|"; + string d = ""; + for (RevisionNumbers::const_iterator i = revs.begin(); + i != revs.end(); ++i){ + d += int2String(*i) + seperator; + } + return d; +} + +RevisionNumbers unpackRevisionNumbers(const string & packed) +{ + string seperator = "|"; + Strings ss = tokenizeString(packed, seperator); + RevisionNumbers revs; + + for (Strings::const_iterator i = ss.begin(); + i != ss.end(); ++i){ + + int rev; + bool succeed = string2Int(*i, rev); + if(!succeed) + throw Error(format("Corrupted revisions db entry: `%1%'") % packed); + revs.push_back(rev); + } + + return revs; +} + Strings tokenizeString(const string & s, const string & separators) { diff --git a/src/libutil/util.hh b/src/libutil/util.hh index 83856a4cc..3381c164d 100644 --- a/src/libutil/util.hh +++ b/src/libutil/util.hh @@ -302,7 +302,7 @@ string time_t2string(const time_t & t); bool FileExist(const string FileName); -bool IsDirectory(const string FileName); +bool IsDirectory(const string FileName); //TODO replace by pathexists string getCallingUserName(); @@ -312,6 +312,10 @@ PathSet pathSets_union(const PathSet & paths1, const PathSet & paths2); /* TODO */ void pathSets_difference(const PathSet & oldpaths, const PathSet & newpaths, PathSet & addedpaths, PathSet & removedpaths); +string packRevisionNumbers(const RevisionNumbers & revs); + +RevisionNumbers unpackRevisionNumbers(const string & packed); + } #endif /* !__UTIL_H */ diff --git a/src/nix-state/nix-state.cc b/src/nix-state/nix-state.cc index 227928920..da38afe54 100644 --- a/src/nix-state/nix-state.cc +++ b/src/nix-state/nix-state.cc @@ -252,19 +252,9 @@ static void revertToRevision(Strings opFlags, Strings opArgs) //Revert each statePath in the list for (RevisionNumbersSet::iterator i = getRivisions.begin(); i != getRivisions.end(); ++i){ Path statePath = (*i).first; - int revision = (*i).second; - string repos = getStateReposPath("stateOutput:staterepospath", statePath); //this is a copy from store-state.cc - - printMsg(lvlError, format("Reverting statePath '%1%' to revision: %2%") % statePath % int2String(revision)); - Strings p_args; - p_args.push_back(nixSVNPath + "/svn"); - p_args.push_back(int2String(revision)); - p_args.push_back("file://" + repos); - p_args.push_back(statePath); - runProgram_AndPrintOutput(nixLibexecDir + "/nix/nix-restorerevision.sh", true, p_args, "svn"); //run + map revisioned_paths = (*i).second; - //TODO !!!!!!!!!!!!!!!!!!!!! do a commit - //TODO !!!!!!!!!!!!!!!!!!!!! check if statePath is a working copy + //TODO !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! } } @@ -364,7 +354,10 @@ void scanAndUpdateAllReferencesRecusivelyTxn(const Transaction & txn, const Path //We dont need to sort since the db does that //call scanForAllReferences again on all statePaths for (PathSet::iterator i = statePaths.begin(); i != statePaths.end(); ++i){ - int revision = readRevisionNumber(*i); + + //TODO !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + int revision = 0; + //Get last revision number from DB !!!!!!!!!! //Scan, update, call recursively PathSet newFoundComponentReferences; @@ -418,20 +411,17 @@ static void opRunComponent(Strings opFlags, Strings opArgs) executeShellCommand(root_componentPath + root_binary + " " + root_program_args); //more efficient way needed ??? //******************* With everything in place, we call the commit script on all statePaths (in)directly referenced ********************** + + //Start transaction TODO + + //Scan for new references if neccecary + if(scanforReferences) + scanAndUpdateAllReferencesRecusivelyTxn(txn, root_statePath); //Commit all statePaths for (PathSet::iterator i = statePaths.begin(); i != statePaths.end(); ++i) //TODO first commit own state path? commitStatePathTxn(txn, *i); - //Start transaction TODO - - //Scan for new references, and update with revision number - if(scanforReferences) - scanAndUpdateAllReferencesRecusivelyTxn(txn, root_statePath); - - //Get new revision number - updateRevisionsRecursivelyTxn(txn, root_statePath); - //Commit transaction //txn.commit(); @@ -439,7 +429,7 @@ static void opRunComponent(Strings opFlags, Strings opArgs) RevisionNumbersSet getRivisions; bool b = store->queryStateRevisions(root_statePath, getRivisions, -1); for (RevisionNumbersSet::iterator i = getRivisions.begin(); i != getRivisions.end(); ++i){ - printMsg(lvlError, format("State %1% has revision %2%") % (*i).first % int2String((*i).second)); + //printMsg(lvlError, format("State %1% has revision %2%") % (*i).first % int2String((*i).second)); }