about summary refs log tree commit diff
path: root/src/store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-10-10T15·25+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-10-10T15·25+0000
commit1d61e473c88568fae7ef5edebc77acd53e4126f9 (patch)
tree403c4cec6f2093cb16e95362b60ea058af714eb7 /src/store.cc
parent0abe185688aa19c9ca87c9d22e24a54b4b359969 (diff)
* New query `nix --query --predecessors' to print the predecessors of
  a Nix expression.

Diffstat (limited to 'src/store.cc')
-rw-r--r--src/store.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/store.cc b/src/store.cc
index 69532071310f..3e755a0d1a9a 100644
--- a/src/store.cc
+++ b/src/store.cc
@@ -104,6 +104,14 @@ void registerSuccessor(const Transaction & txn,
 }
 
 
+Paths queryPredecessors(const Path & sucPath)
+{
+    Paths revs;
+    nixDB.queryStrings(noTxn, dbSuccessorsRev, sucPath, revs);
+    return revs;
+}
+
+
 void registerSubstitute(const Path & srcPath, const Path & subPath)
 {
     Transaction txn(nixDB);