module Copernicium

Revlog Top Level Function Definitions (Xiangru)

add_file: add a file to the revision history in - file name, content out - hash id of file (file_id)

delete_file: a delete a file from revision history in - file_id out - exit status code

diff_files: generate the differences between 2 files in - two file_ids out - list of differences

get_file: get the contents of a file based on hash id in - file_id out - content of specified file

hash_file: generate hash id for a given file in - file name, content out - hashed id

merge: given two files, try to merge them in - file_id_1, file_id_2 out - success and merged file name/content, or failure and conflict

Frank Tamburrino CSC 254 PushPull Module November 7, 2015

How to use for Push, Pull and Clone:

Push - cn push <user> <repo.host:/dir/of/repo> <branch-name>
Pull - cn pull <user> <repo.host:/dir/of/repo> <branch-name>
Clone - cn clone <user> <repo.host:/dir/of/repo>

assumes that the user has ssh keys to the remote server setup

make_snapshot: Creates new snapshot from current files and versions

in - array of file objects. file object = array of all versions:
{id, content}
out - hash id of snapshot

merge_snapshot: merge in a branch’s history into the current branch. if

in - branch name
out - [{path => content}, [conflicting paths]]

get_snapshot: Return a specific snapshot

in - snapshot id
out - snapshot object

restore_snapshot: Set current file versions to specified snapshot

in - id of target snapshot
out - Comm object with status

history: Returns ids for all snapshots

in - branch name
out - Array of snapshot ids

delete_snapshot: delete specified a snapshot

in - target snapshot
out -  Comm object with status

diff_snapshots: Returns diff between two different snapshots

in - two ids of snapshots to perform diff on
out - list of filenames and versions

make_branch: make a new branch

in - branch name
out - hash id of new branch

delete_branch: delete a branch

in - branch name
out - exit status code

note: @@history is a hash array of snapshot ids, which is saved as .cn/history to persist between calls to the copernicium tool

workspace module linfeng song, qiguang liu