comparison mercurial/logcmdutil.py @ 42502:c929f612afac

logcmdutil: also check for copies in null revision and working copy It's safe (and fast) to look for copies in the null revision, and it's incorrect not to look for them in the working copy, so let's look in both places. Differential Revision: https://phab.mercurial-scm.org/D6544
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 18 Jun 2019 23:19:24 -0700
parents b162229ebe0d
children a68350a7fc55
comparison
equal deleted inserted replaced
42501:75334e5b519e 42502:c929f612afac
889 state['graphshorten'] = ui.configbool('experimental', 'graphshorten') 889 state['graphshorten'] = ui.configbool('experimental', 'graphshorten')
890 890
891 for rev, type, ctx, parents in dag: 891 for rev, type, ctx, parents in dag:
892 char = formatnode(repo, ctx) 892 char = formatnode(repo, ctx)
893 copies = None 893 copies = None
894 if getrenamed and ctx.rev(): 894 if getrenamed:
895 copies = [] 895 copies = []
896 for fn in ctx.files(): 896 for fn in ctx.files():
897 rename = getrenamed(fn, ctx.rev()) 897 rename = getrenamed(fn, ctx.rev())
898 if rename: 898 if rename:
899 copies.append((fn, rename)) 899 copies.append((fn, rename))
917 917
918 def displayrevs(ui, repo, revs, displayer, getrenamed): 918 def displayrevs(ui, repo, revs, displayer, getrenamed):
919 for rev in revs: 919 for rev in revs:
920 ctx = repo[rev] 920 ctx = repo[rev]
921 copies = None 921 copies = None
922 if getrenamed is not None and rev: 922 if getrenamed is not None:
923 copies = [] 923 copies = []
924 for fn in ctx.files(): 924 for fn in ctx.files():
925 rename = getrenamed(fn, rev) 925 rename = getrenamed(fn, rev)
926 if rename: 926 if rename:
927 copies.append((fn, rename)) 927 copies.append((fn, rename))