comparison mercurial/commands.py @ 8210:344751cd8cb8

replace various uses of list.reverse()
author Matt Mackall <mpm@selenic.com>
date Sun, 26 Apr 2009 16:50:44 -0500
parents a1a5a57efe90
children 46293a0c7e9f
comparison
equal deleted inserted replaced
8209:a1a5a57efe90 8210:344751cd8cb8
445 """ 445 """
446 hexfunc = ui.debugflag and hex or short 446 hexfunc = ui.debugflag and hex or short
447 activebranches = [encoding.tolocal(repo[n].branch()) 447 activebranches = [encoding.tolocal(repo[n].branch())
448 for n in repo.heads(closed=False)] 448 for n in repo.heads(closed=False)]
449 branches = sorted([(tag in activebranches, repo.changelog.rev(node), tag) 449 branches = sorted([(tag in activebranches, repo.changelog.rev(node), tag)
450 for tag, node in repo.branchtags().items()]) 450 for tag, node in repo.branchtags().items()],
451 branches.reverse() 451 reverse=True)
452 452
453 for isactive, node, tag in branches: 453 for isactive, node, tag in branches:
454 if (not active) or isactive: 454 if (not active) or isactive:
455 if ui.quiet: 455 if ui.quiet:
456 ui.write("%s\n" % tag) 456 ui.write("%s\n" % tag)
2868 2868
2869 This lists both regular and local tags. When the -v/--verbose 2869 This lists both regular and local tags. When the -v/--verbose
2870 switch is used, a third column "local" is printed for local tags. 2870 switch is used, a third column "local" is printed for local tags.
2871 """ 2871 """
2872 2872
2873 l = repo.tagslist()
2874 l.reverse()
2875 hexfunc = ui.debugflag and hex or short 2873 hexfunc = ui.debugflag and hex or short
2876 tagtype = "" 2874 tagtype = ""
2877 2875
2878 for t, n in l: 2876 for t, n in reversed(repo.tagslist()):
2879 if ui.quiet: 2877 if ui.quiet:
2880 ui.write("%s\n" % t) 2878 ui.write("%s\n" % t)
2881 continue 2879 continue
2882 2880
2883 try: 2881 try: