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)
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)
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)
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)
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)
def gitcfg(args): """ Edit the gitlock configuration file """ utils.check_required(args, ['gitpath']) utils.edit_git_cfg(args.gitpath, args.user)
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)