示例#1
0
def update(dist):
    get_log().info("Updating %s" % dist)
    with chdir(dist.location):
        run(['hg','pull', '-u'])
        heads = run(['hg','heads', '--template','{node}-'],capture=True).split('-')[:-1]
        if len(heads) > 1:
            raise PackageError("Package %s has unmerged heads at %s" % (dist.project_name, dist.location))
示例#2
0
def tag(dist):
    get_log().info("Tagging %s" % dist)
    with chdir(dist.location):    
        diff = run(['hg','st'], capture = True)
        if 'setup.cfg' in diff:
            get_log().info("Committing new setup.cfg") 
            run(['hg','commit','-m','Pinning requirements for version %s' % dist.version])
        run(['hg','tag', str(dist.version)])
示例#3
0
def upload(dist):
    get_log().info("Uploading %s" % dist)
    with chdir(dist.location):
        cfg = get_parser()
        run([
            'scp',
            'dist/%s-%s.tar.gz' % (cfg.get('metadata', 'name'), dist.version),
            PKG_REPO
        ])
示例#4
0
def update(dist):
    get_log().info("Updating %s" % dist)
    with chdir(dist.location):
        run(['hg', 'pull', '-u'])
        heads = run(['hg', 'heads', '--template', '{node}-'],
                    capture=True).split('-')[:-1]
        if len(heads) > 1:
            raise PackageError("Package %s has unmerged heads at %s" %
                               (dist.project_name, dist.location))
示例#5
0
def tag(dist):
    get_log().info("Tagging %s" % dist)
    with chdir(dist.location):
        diff = run(['hg', 'st'], capture=True)
        if 'setup.cfg' in diff:
            get_log().info("Committing new setup.cfg")
            run([
                'hg', 'commit', '-m',
                'Pinning requirements for version %s' % dist.version
            ])
        run(['hg', 'tag', str(dist.version)])
示例#6
0
def verify(dist):
    get_log().info("Verifying %s" % dist)
    with chdir(dist.location):
        diff = run(['hg', 'st'], capture=True)
        if diff:
            raise PackageError("Package %s has uncommitted changes at %s" %
                               (dist.project_name, dist.location))
示例#7
0
def get_tags():
    """ Returns a list of tags for the cwd
    """
    items =  [ i.strip() for i in  \
               run(['hg','tags'], capture=True).split('\n') \
               if i.strip() ]
    res = {}
    for i in items:
        tag, rev = i.split()
        if tag == 'tip' or not RE_VERSION.match(tag): continue
        res[tag] = rev.split(':')[1]
    return res
示例#8
0
def get_previous_revno(revno):
    """ Retuns the revision number before this one, used
        for detecting similar tags.
    """
    return run(['hg','parents', '-r', revno, '--template',
                '{node}'],capture=True)[:12].strip()
示例#9
0
def get_revno():
    """ Returns the revision number of the cwd
    """
    return run(['hg','id','-i'],capture=True).strip()
示例#10
0
def verify(dist):
    get_log().info("Verifying %s" % dist)
    with chdir(dist.location):
        diff = run(['hg','st'], capture = True)
        if diff:
            raise PackageError("Package %s has uncommitted changes at %s" % (dist.project_name, dist.location))
示例#11
0
def upload(dist):
    get_log().info("Uploading %s" % dist)
    with chdir(dist.location):    
        cfg = get_parser()
        run(['scp', 'dist/%s-%s.tar.gz' % (cfg.get('metadata','name'), dist.version), PKG_REPO])
示例#12
0
def commit(dist):
    get_log().info("Committing %s" % dist)
    with chdir(dist.location):    
        run(['hg','commit','-m','Tagged at version %s' % dist.version])
示例#13
0
def build_dist(dist):
    get_log().info("Building %s" % dist)
    with chdir(dist.location):    
        run(['python','setup.py','egg_info','--tag-build=', 'sdist'])
示例#14
0
def commit(dist):
    get_log().info("Committing %s" % dist)
    with chdir(dist.location):
        run(['hg', 'commit', '-m', 'Tagged at version %s' % dist.version])
示例#15
0
def build_dist(dist):
    get_log().info("Building %s" % dist)
    with chdir(dist.location):
        run(['python', 'setup.py', 'egg_info', '--tag-build=', 'sdist'])