Sistema de Apoio ao Processo Legislativo
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

27 lines
1.0 KiB

import requests
branch_master = requests.get('https://api.github.com/repos/interlegis/sapl/commits?per_page=100&sha=master')
branch_master = branch_master.json()
commits_master = [e['commit']['message'] for e in branch_master]
branch_3_1_x = requests.get('https://api.github.com/repos/interlegis/sapl/commits?per_page=70&sha=3.1.x')
branch_3_1_x = branch_3_1_x.json()
commits_3_1_x = [(e['commit']['message'], {'sha':e['sha'], 'data':e['commit']['author']['date']}) for e in branch_3_1_x]
print("\nCommits que estão em 3.1.x, mas não em master:\n")
# retira os \r para evitar bugs
commits_master = [commit.replace('\r', '') for commit in commits_master]
for c, s in commits_3_1_x:
# retira os \r para evitar bugs
c = c.replace('\r', '')
if c not in commits_master:
print('---------------------------------------------------------------------')
print('Data: ' + s['data'][:10])
print(s['sha'][:7] + '-> ' + c)
print('---------------------------------------------------------------------')