##// END OF EJS Templates
branches: simplify with repo.branchmap().iterbranches()...
Brodie Rao -
r20192:38fad5e7 default
parent child Browse files
Show More
@@ -1015,17 +1015,9 b' def branches(ui, repo, active=False, clo'
1015
1015
1016 allheads = set(repo.heads())
1016 allheads = set(repo.heads())
1017 branches = []
1017 branches = []
1018 for tag, heads in repo.branchmap().iteritems():
1018 for tag, heads, tip, isclosed in repo.branchmap().iterbranches():
1019 for h in reversed(heads):
1019 isactive = not isclosed and bool(set(heads) & allheads)
1020 ctx = repo[h]
1020 branches.append((tag, repo[tip], isactive, not isclosed))
1021 isopen = not ctx.closesbranch()
1022 if isopen:
1023 tip = ctx
1024 break
1025 else:
1026 tip = repo[heads[-1]]
1027 isactive = isopen and bool(set(heads) & allheads)
1028 branches.append((tag, tip, isactive, isopen))
1029 branches.sort(key=lambda i: (i[2], i[1].rev(), i[0], i[3]),
1021 branches.sort(key=lambda i: (i[2], i[1].rev(), i[0], i[3]),
1030 reverse=True)
1022 reverse=True)
1031
1023
General Comments 0
You need to be logged in to leave comments. Login now