Mercurial > hg
comparison mercurial/hgweb/webcommands.py @ 38140:220058198be6
hgweb: don't use dict(key=value) to build a mapping dict in filelog
It wasn't Py3 compatible because mapping keys must be bytes.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 04 Apr 2018 20:37:03 +0900 |
parents | d32f07069dd1 |
children | 53cc81a8caf6 |
comparison
equal
deleted
inserted
replaced
38139:d32f07069dd1 | 38140:220058198be6 |
---|---|
1088 diffs = None | 1088 diffs = None |
1089 if patch: | 1089 if patch: |
1090 diffs = diff(c, linerange=lr) | 1090 diffs = diff(c, linerange=lr) |
1091 # follow renames accross filtered (not in range) revisions | 1091 # follow renames accross filtered (not in range) revisions |
1092 path = c.path() | 1092 path = c.path() |
1093 entries.append(dict( | 1093 lm = webutil.commonentry(repo, c) |
1094 parity=next(parity), | 1094 lm.update({ |
1095 filerev=c.rev(), | 1095 'parity': next(parity), |
1096 file=path, | 1096 'filerev': c.rev(), |
1097 diff=diffs, | 1097 'file': path, |
1098 linerange=webutil.formatlinerange(*lr), | 1098 'diff': diffs, |
1099 **pycompat.strkwargs(webutil.commonentry(repo, c)))) | 1099 'linerange': webutil.formatlinerange(*lr), |
1100 }) | |
1101 entries.append(lm) | |
1100 if i == revcount: | 1102 if i == revcount: |
1101 break | 1103 break |
1102 lessvars['linerange'] = webutil.formatlinerange(*lrange) | 1104 lessvars['linerange'] = webutil.formatlinerange(*lrange) |
1103 morevars['linerange'] = lessvars['linerange'] | 1105 morevars['linerange'] = lessvars['linerange'] |
1104 else: | 1106 else: |
1105 for i in revs: | 1107 for i in revs: |
1106 iterfctx = fctx.filectx(i) | 1108 iterfctx = fctx.filectx(i) |
1107 diffs = None | 1109 diffs = None |
1108 if patch: | 1110 if patch: |
1109 diffs = diff(iterfctx) | 1111 diffs = diff(iterfctx) |
1110 entries.append(dict( | 1112 lm = webutil.commonentry(repo, iterfctx) |
1111 parity=next(parity), | 1113 lm.update({ |
1112 filerev=i, | 1114 'parity': next(parity), |
1113 file=f, | 1115 'filerev': i, |
1114 diff=diffs, | 1116 'file': f, |
1115 rename=webutil.renamelink(iterfctx), | 1117 'diff': diffs, |
1116 **pycompat.strkwargs(webutil.commonentry(repo, iterfctx)))) | 1118 'rename': webutil.renamelink(iterfctx), |
1119 }) | |
1120 entries.append(lm) | |
1117 entries.reverse() | 1121 entries.reverse() |
1118 revnav = webutil.filerevnav(web.repo, fctx.path()) | 1122 revnav = webutil.filerevnav(web.repo, fctx.path()) |
1119 nav = revnav.gen(end - 1, revcount, count) | 1123 nav = revnav.gen(end - 1, revcount, count) |
1120 | 1124 |
1121 latestentry = entries[:1] | 1125 latestentry = entries[:1] |