Skip to content

Commit

Permalink
MAINT: Fix last commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
jseabold committed Nov 23, 2013
1 parent 65aa5a7 commit c4e132d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tools/backport_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
get_milestone_id,
)

from numpy import argsort
from pandas import Series

def find_rejects(root='.'):
for dirname, dirs, files in os.walk(root):
Expand Down Expand Up @@ -146,7 +146,7 @@ def should_backport(labels=None, milestone=None):
if pr['number'] not in should_backport:
merged_dates.append(pr['merged_at'])
should_backport.append(pr['number'])
return [should_backport[i] for i in argsort(merged_dates)]
return Series(merged_dates, index=should_backport)

if __name__ == '__main__':

Expand All @@ -160,7 +160,11 @@ def should_backport(labels=None, milestone=None):
#NOTE: change this to the label you've used for marking a backport
should = should_backport(milestone="0.5.1")
print ("The following PRs should be backported:")
for pr in should.difference(already):
to_backport = []
if already:
should = should.ix[set(should.index).difference(already)]
should.sort()
for pr, date in should.iteritems():
print (pr)
sys.exit(0)

Expand Down

0 comments on commit c4e132d

Please sign in to comment.