From be58b862309fabfae996b94c441bf778b09df463 Mon Sep 17 00:00:00 2001 From: Jeffrey Armstrong Date: Tue, 7 Jan 2014 20:18:57 -0500 Subject: Added revision option support to revert and diff commands. --- prism.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'prism.c') diff --git a/prism.c b/prism.c index 0941312..bd18ae9 100644 --- a/prism.c +++ b/prism.c @@ -146,8 +146,13 @@ static void revert_task(const char *filename) { int res; - printf("Reverting changes to %s...\n", filename); - res = revert(filename, -1); + if(revision_option == -1) + printf("Reverting changes to %s...\n", filename); + else + printf("Reverting %s to revision %d...\n", filename, revision_option); + + res = revert(filename, revision_option); + switch(res) { case PRET_OK: printf(" changes reverted\n"); @@ -167,8 +172,13 @@ static void diff_task(const char *filename) { int res; - printf("Comparing current %s to latest repository revision...\n", filename); - res = diff_db_file(filename, -1); + printf("Comparing current %s to ",filename); + if(revision_option == -1) + printf("latest repository revision...\n"); + else + printf("revision %d...\n", revision_option); + + res = diff_db_file(filename, revision_option); switch(res) { case PRET_OK: printf(" diff complete\n"); -- cgit v1.2.3