Ignore:
Timestamp:
Jul 6, 2010, 12:27:41 AM (14 years ago)
Author:
gdb
Message:

Use the expanded commit name internally

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-dev/python/invirt/builder.py

    r3028 r3035  
    2929    return os.path.join(_REPO_DIR, 'invirt/packages', '%s.git' % package)
    3030
    31 def ensureValidRepo(package):
     31def ensureValidPackage(package):
    3232    """Perform some basic sanity checks that the requested repo is in a
    3333    subdirectory of _REPO_DIR/invirt/packages.  This prevents weirdness
     
    4242    elif not os.path.exists(repo):
    4343        raise InvalidBuild('Nonexisting package %s' % package)
     44
     45def canonicalize_commit(package, commit, shorten=False):
     46    if shorten:
     47        flags = ['--short']
     48    else:
     49        flags = []
     50    return c.captureOutput(['git', 'rev-parse'] + flags + [commit],
     51                           cwd=getRepo(package)).strip()
    4452
    4553def pocketToGit(pocket):
     
    99107    it returns True.
    100108    """
    101     ensureValidRepo(package)
     109    ensureValidPackage(package)
    102110    package_repo = getRepo(package)
    103111    new_version = getVersion(package, commit)
Note: See TracChangeset for help on using the changeset viewer.