diff --git a/mercurial/commands.py b/mercurial/commands.py index 68df36ce3d8a3097d146c462f3ff9abdaf7f3944_bWVyY3VyaWFsL2NvbW1hbmRzLnB5..2d0b60b5abc0bdfaac1f7d11e0001aa215eecbe8_bWVyY3VyaWFsL2NvbW1hbmRzLnB5 100644 --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -5787,8 +5787,8 @@ ui.write(' ' + m, label='log.bookmark') ui.write('\n', label='log.bookmark') - st = list(repo.status(unknown=True))[:5] + status = repo.status(unknown=True) c = repo.dirstate.copies() copied, renamed = [], [] for d, s in c.iteritems(): @@ -5791,9 +5791,9 @@ c = repo.dirstate.copies() copied, renamed = [], [] for d, s in c.iteritems(): - if s in st[2]: - st[2].remove(s) + if s in status.removed: + status.removed.remove(s) renamed.append(d) else: copied.append(d) @@ -5797,9 +5797,7 @@ renamed.append(d) else: copied.append(d) - if d in st[1]: - st[1].remove(d) - st.insert(3, renamed) - st.insert(4, copied) + if d in status.added: + status.added.remove(d) ms = mergemod.mergestate(repo) @@ -5804,5 +5802,5 @@ ms = mergemod.mergestate(repo) - st.append([f for f in ms if ms[f] == 'u']) + unresolved = [f for f in ms if ms[f] == 'u'] subs = [s for s in ctx.substate if ctx.sub(s).dirty()] @@ -5807,14 +5805,13 @@ subs = [s for s in ctx.substate if ctx.sub(s).dirty()] - st.append(subs) - - labels = [ui.label(_('%d modified'), 'status.modified'), - ui.label(_('%d added'), 'status.added'), - ui.label(_('%d removed'), 'status.removed'), - ui.label(_('%d renamed'), 'status.copied'), - ui.label(_('%d copied'), 'status.copied'), - ui.label(_('%d deleted'), 'status.deleted'), - ui.label(_('%d unknown'), 'status.unknown'), - ui.label(_('%d unresolved'), 'resolve.unresolved'), - ui.label(_('%d subrepos'), 'status.modified')] + + labels = [(ui.label(_('%d modified'), 'status.modified'), status.modified), + (ui.label(_('%d added'), 'status.added'), status.added), + (ui.label(_('%d removed'), 'status.removed'), status.removed), + (ui.label(_('%d renamed'), 'status.copied'), renamed), + (ui.label(_('%d copied'), 'status.copied'), copied), + (ui.label(_('%d deleted'), 'status.deleted'), status.deleted), + (ui.label(_('%d unknown'), 'status.unknown'), status.unknown), + (ui.label(_('%d unresolved'), 'resolve.unresolved'), unresolved), + (ui.label(_('%d subrepos'), 'status.modified'), subs)] t = [] @@ -5820,5 +5817,5 @@ t = [] - for s, l in zip(st, labels): + for l, s in labels: if s: t.append(l % len(s)) @@ -5834,7 +5831,8 @@ elif (parents[0].closesbranch() and pnode in repo.branchheads(branch, closed=True)): t += _(' (head closed)') - elif not (st[0] or st[1] or st[2] or st[3] or st[4] or st[8]): + elif not (status.modified or status.added or status.removed or renamed or + copied or subs): t += _(' (clean)') cleanworkdir = True elif pnode not in bheads: