diff options
| author | Jeffrey Armstrong <jeffrey.armstrong@approximatrix.com> | 2014-01-03 10:04:01 -0500 |
|---|---|---|
| committer | Jeffrey Armstrong <jeffrey.armstrong@approximatrix.com> | 2014-01-03 10:04:01 -0500 |
| commit | 50ff0e53d94c60860e768100f549e4dfe9110096 (patch) | |
| tree | 65175313745a4aad498d781092dd89f8fbd47276 /prism.c | |
| parent | 2719471cb97c721e929c98c6bad40a381269295e (diff) | |
| download | prism-50ff0e53d94c60860e768100f549e4dfe9110096.tar.gz prism-50ff0e53d94c60860e768100f549e4dfe9110096.zip | |
Files can now be committed to version control. Each version is stored in gzip'd form. Fix to MD5 calculation.
Diffstat (limited to 'prism.c')
| -rw-r--r-- | prism.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -21,6 +21,8 @@ static void usage(const char *name) printf("\nUsage: %s <command> ...\n\n", name);
printf("Commands:\n\n");
printf("\tabout\tprints a banner and exits\n");
+ printf("\tadd\tadds the specified file to the commit queue\n");
+ printf("\tcommit\tcommits currently queued files\n");
printf("\thash\tdisplays a file's hash\n");
printf("\tinfo\tshow information about repository\n");
printf("\tinit\tinitializes this directory for versioning\n");
@@ -75,7 +77,21 @@ struct db_file oldfile; static void commit_task(const char *message)
{
+int fcount;
+int rev;
+ printf("Committing queue...\n");
+ fcount = disp_queue();
+ if(fcount <= 0) {
+ printf(" ERR: no files queued\n");
+ return;
+ }
+
+ rev = increment_revision();
+ if(commit_queue(rev) == PRET_OK)
+ printf(" commit completed\n");
+ else
+ printf(" ERR: commit failed\n");
}
static void info_task()
@@ -128,6 +144,10 @@ int main(int argc, char *argv[]) banner();
else if(strcmp(argv[1], "add") == 0 && argc == 3)
add_task(argv[2]);
+ else if(strcmp(argv[1], "commit") == 0 && argc == 3)
+ commit_task(argv[2]);
+ else if(strcmp(argv[1], "commit") == 0)
+ commit_task(NULL);
else if(strcmp(argv[1], "init") == 0)
init_task();
else if(strcmp(argv[1], "info") == 0)
|
