Esempio n. 1
0
def commitlog (args):
    gs = GitStore ()
    repo_name = args[0]
    rev = None
    if len(args)>1:
        rev = args[1]
    else:
        rev = None
    path = None 
    if len(args)>2:
        path = args[2]
    else:
        path = None
    from_rev = None
    to_rev = None
    if rev:
        if rev.find ('..') == -1:
            to_rev = rev
        else:
            arr = rev.split ('..')
            from_rev = arr[0]
            to_rev = arr[1]
    else:
        to_rev = 'HEAD'
    result = gs.log (repo_name, to_rev, from_rev, path)
    for e in result:
        print "%s:%s;%s" % (e['commit'], e['author_timestamp'], e['msg'])
Esempio n. 2
0
def store_file (args):
    gs = GitStore ()
    expect_latest_version = None
    (repo_name, branch_name, path, temppath) = args[0:4]
    if len (args) == 5:
        expect_latest_version = args[4]
    f = open (temppath, "r")
    try:
        print gs.store_file (repo_name, branch_name, {path:f}, expect_latest_version_dict={path:expect_latest_version})
    finally:
        f.close ()
Esempio n. 3
0
def create_repo (args):
    gs = GitStore ()
    commit = gs.create_repo (*args)
    print commit
Esempio n. 4
0
def get_latest_commit (args):
    gs = GitStore ()
    print gs.get_latest_commit (*args)
Esempio n. 5
0
def delete (args):
    gs = GitStore ()
    print gs.delete (*args)
Esempio n. 6
0
def mkdir (args):
    gs = GitStore ()
    print gs.mkdir (*args)
Esempio n. 7
0
def checkout (args):
    gs = GitStore ()
    gs.checkout (*args) 
Esempio n. 8
0
def ls (args):
    gs = GitStore ()
    files = gs.ls (*args)
    for f in files:
        print f
Esempio n. 9
0
def read (args):
    gs = GitStore ()
    buf = gs.read (*args)
    sys.stdout.write (buf)
Esempio n. 10
0
def ls_head (args):
    gs = GitStore ()
    print gs.ls_head(*args)
Esempio n. 11
0
def ls_branches (args):
    gs = GitStore ()
    branches = gs.ls_branches (*args)
    for b, v in branches.iteritems ():
        print b, v
Esempio n. 12
0
def ls_repos (args):
    gs = GitStore ()
    repos = gs.ls_repos (*args)
    for r in repos:
        print r
Esempio n. 13
0
def delete_branch (args):
    gs = GitStore ()
    gs.delete_branch (*args)
Esempio n. 14
0
def create_branch (args):
    gs = GitStore ()
    commit = gs.create_branch (*args)