1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-27 04:30:59 +01:00
This commit is contained in:
Wouter den Breejen 2007-09-19 14:26:16 +00:00
parent f435abcdb6
commit 4c32f38047
13 changed files with 125 additions and 14 deletions

View file

@ -1837,6 +1837,11 @@ Path toNonSharedPathTxn(const Transaction & txn, const Path & statePath)
return returnedPath;
}
bool LocalStore::getSharedWith(const Path & statePath1, Path & statePath2)
{
return querySharedStateTxn(noTxn, statePath1, statePath2);
}
PathSet toNonSharedPathSetTxn(const Transaction & txn, const PathSet & statePaths)
{
PathSet real_statePaths;

View file

@ -110,6 +110,8 @@ public:
void scanAndUpdateAllReferences(const Path & statePath, const bool recursive);
bool getSharedWith(const Path & statePath1, Path & statePath2);
PathSet toNonSharedPathSet(const PathSet & statePaths);
void revertToRevision(const Path & statePath, const unsigned int revision_arg, const bool recursive);

View file

@ -286,7 +286,6 @@ Path RemoteStore::addTextToStore(const string & suffix, const string & s,
writeString(suffix, to);
writeString(s, to);
writeStringSet(references, to);
processStderr();
return readStorePath(from);
}
@ -310,7 +309,6 @@ Path RemoteStore::importPath(bool requireSignature, Source & source)
anyway. */
processStderr(0, &source);
//Path path = readStorePath(from); //TODO !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! remove
return readStorePath(from);
}
@ -504,6 +502,15 @@ void RemoteStore::scanAndUpdateAllReferences(const Path & statePath, const bool
readInt(from);
}
bool RemoteStore::getSharedWith(const Path & statePath1, Path & statePath2)
{
writeInt(wopGetSharedWith, to);
writeString(statePath1, to);
processStderr();
statePath2 = readString(from);
unsigned int reply = readInt(from);
return reply != 0;
}
PathSet RemoteStore::toNonSharedPathSet(const PathSet & statePaths)
{

View file

@ -96,6 +96,8 @@ public:
void scanAndUpdateAllReferences(const Path & statePath, const bool recursive);
bool getSharedWith(const Path & statePath1, Path & statePath2);
PathSet toNonSharedPathSet(const PathSet & statePaths);
void revertToRevision(const Path & statePath, const unsigned int revision_arg, const bool recursive);

View file

@ -237,6 +237,9 @@ public:
/* TODO */
virtual void scanAndUpdateAllReferences(const Path & statePath, const bool recursive) = 0;
/* TODO */
virtual bool getSharedWith(const Path & statePath1, Path & statePath2) = 0;
/* TODO */
virtual PathSet toNonSharedPathSet(const PathSet & statePaths) = 0;

View file

@ -44,6 +44,7 @@ typedef enum {
wopQueryAvailableStateRevisions,
wopCommitStatePath,
wopScanAndUpdateAllReferences,
wopGetSharedWith,
wopToNonSharedPathSet,
wopRevertToRevision,
wopShareState,