Exemplo n.º 1
0
def apply_series(series, **kwds):
   if is_pull_request(series):
       return apply_pull_request(series['messages'][0], **kwds)
   elif is_broken(series):
       raise Exception('Cannot apply series: series is either incomplete or improperly threaded.')
   elif not 'mbox_path' in series:
       raise Exception('Cannot apply series: missing mbox')
   return apply_patch(mbox.get_real_path(series['mbox_path']), **kwds)
Exemplo n.º 2
0
def apply_series(series, **kwds):
    if is_pull_request(series):
        return apply_pull_request(series['messages'][0], **kwds)
    elif is_broken(series):
        raise Exception(
            'Cannot apply series: series is either incomplete or improperly threaded.'
        )
    elif not 'mbox_path' in series:
        raise Exception('Cannot apply series: missing mbox')
    return apply_patch(mbox.get_real_path(series['mbox_path']), **kwds)
Exemplo n.º 3
0
        mbox_path = series['mbox_path']

        old_hash = mbox.get_hash(mbox_path)

        if 'mbox_hash' in series and series['mbox_hash'] == old_hash:
            continue

        print 'Fetching mbox for %s' % series['messages'][0]['subject']
        base, _ = url.rsplit('/', 1)

        try:
            fp = urlopen(base + '/' + series['mbox_path'])
        except HTTPError, e:
            print 'Skipping mbox %s' % series['mbox_path']
            continue

        try:
            mbox_data = fp.read()
        finally:
            fp.close()

        replace_file(mbox.get_real_path(series['mbox_path']), mbox_data)

    json_data = json.dumps(full_patches,
                           indent=2,
                           separators=(',', ': '),
                           encoding='iso-8859-1')

    replace_file(config.get_json_path(), json_data)
Exemplo n.º 4
0
            continue

        mbox_path = series['mbox_path']

        old_hash = mbox.get_hash(mbox_path)
        
        if 'mbox_hash' in series and series['mbox_hash'] == old_hash:
            continue

        print 'Fetching mbox for %s' % series['messages'][0]['subject']
        base, _ = url.rsplit('/', 1)

        try:
            fp = urlopen(base + '/' + series['mbox_path'])
        except HTTPError, e:
            print 'Skipping mbox %s' % series['mbox_path']
            continue
            
        try:
            mbox_data = fp.read()
        finally:
            fp.close()

        replace_file(mbox.get_real_path(series['mbox_path']), mbox_data)

    json_data = json.dumps(full_patches, indent=2,
                           separators=(',', ': '),
                           encoding='iso-8859-1')

    replace_file(config.get_json_path(), json_data)