Example #1
0
def get_info(args):
    """
    Get the information about all of the locked files. If a user is specified, only
    get information about that users locked files
    """
    utils.check_required(args, ['pkg'])
    repo = gitlock.lock.Repo(args.pkg, args.gitpath)
    repo.get_locked_info(username=args.user, sortby=args.sortby, display=True)
Example #2
0
def unlock(args):
    """
    Attempt to unlock a file
    """
    utils.check_required(args, ['pkg', 'filename'])
    repo = gitlock.lock.Repo(args.pkg, args.gitpath)
    filename = os.path.join(os.getcwd(), args.filename)
    filename = os.path.relpath(filename, repo.config['pkg_path'])
    repo.unlock(filename, args.user)
Example #3
0
def update(args):
    """
    Update the lockfile
    """
    utils.check_required(args, ['pkg'])
    utils.create_lockfile(args.gitpath,
                          args.pkg,
                          args.pkg_path,
                          overwrite=False,
                          update=True)
Example #4
0
def build(args):
    """
    Build the lockfile
    """
    utils.check_required(args, ['pkg'])
    utils.create_lockfile(args.gitpath,
                          args.pkg,
                          args.pkg_path,
                          args.overwrite,
                          update=False)
Example #5
0
def init(args):
    """
    Create the gitlock configuration file, package configuration file, and build the
    lockfile (or overwrite it if it exists and overwrite is True).
    """
    utils.check_required(args, ['gitpath', 'pkg', 'pkg_path'])
    utils.edit_git_cfg(args.gitpath, args.user)
    utils.edit_lock_cfg(args.pkg, args.gitpath, args.pkg_path, args.user)
    utils.create_lockfile(args.gitpath,
                          args.pkg,
                          args.pkg_path,
                          args.overwrite,
                          update=False)
Example #6
0
def gitcfg(args):
    """
    Edit the gitlock configuration file
    """
    utils.check_required(args, ['gitpath'])
    utils.edit_git_cfg(args.gitpath, args.user)
Example #7
0
def cfg(args):
    """
    Edit the package configuration file
    """
    utils.check_required(args, ['pkg'])
    utils.edit_lock_cfg(args.pkg, args.gitpath, args.pkg_path, args.user)