コード例 #1
0
ファイル: cmd.py プロジェクト: lsst-dm/gitlock
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)
コード例 #2
0
ファイル: cmd.py プロジェクト: lsst-dm/gitlock
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)
コード例 #3
0
ファイル: cmd.py プロジェクト: lsst-dm/gitlock
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)
コード例 #4
0
ファイル: cmd.py プロジェクト: lsst-dm/gitlock
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)
コード例 #5
0
ファイル: cmd.py プロジェクト: lsst-dm/gitlock
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)
コード例 #6
0
ファイル: cmd.py プロジェクト: lsst-dm/gitlock
def gitcfg(args):
    """
    Edit the gitlock configuration file
    """
    utils.check_required(args, ['gitpath'])
    utils.edit_git_cfg(args.gitpath, args.user)
コード例 #7
0
ファイル: cmd.py プロジェクト: lsst-dm/gitlock
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)