summaryrefslogtreecommitdiff
path: root/db.c
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeffrey.armstrong@approximatrix.com>2014-01-06 20:44:03 -0500
committerJeffrey Armstrong <jeffrey.armstrong@approximatrix.com>2014-01-06 20:44:03 -0500
commitab5153e97557791e2c12418ad3f53f53bed2a67a (patch)
treed4fec73b911307c743416b45bade86db8c75bbb3 /db.c
parent59a9b205dfb6d68545e75f28083cf68eb064547d (diff)
downloadprism-ab5153e97557791e2c12418ad3f53f53bed2a67a.tar.gz
prism-ab5153e97557791e2c12418ad3f53f53bed2a67a.zip
Prism now supports diff versus the repository
Diffstat (limited to 'db.c')
-rw-r--r--db.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/db.c b/db.c
index fb05330..c67487c 100644
--- a/db.c
+++ b/db.c
@@ -463,3 +463,25 @@ int res;
return decompress_file(filename, info.id, target_revision);
}
+
+int diff_db_file(const char *filename, int revision)
+{
+int target_revision;
+struct db_file info;
+int res;
+
+ res = get_db_fileinfo(filename, &info);
+ if(res != PRET_OK)
+ return res;
+
+ if(revision < 0)
+ target_revision = info.revision;
+ else {
+ target_revision = determine_revision(&info, revision);
+ if(target_revision < 0)
+ return PRET_NOREVISION;
+ }
+
+ return diff_file(filename, info.id, target_revision);
+}
+