##// END OF EJS Templates
phabricator: use templatefilters.json in writediffproperties...
Ian Moody -
r42369:289d82a0 default
parent child Browse files
Show More
@@ -65,6 +65,7 b' from mercurial import ('
65 scmutil,
65 scmutil,
66 smartset,
66 smartset,
67 tags,
67 tags,
68 templatefilters,
68 templateutil,
69 templateutil,
69 url as urlmod,
70 url as urlmod,
70 util,
71 util,
@@ -380,11 +381,11 b' def writediffproperties(ctx, diff):'
380 params = {
381 params = {
381 b'diff_id': diff[b'id'],
382 b'diff_id': diff[b'id'],
382 b'name': b'hg:meta',
383 b'name': b'hg:meta',
383 b'data': json.dumps({
384 b'data': templatefilters.json({
384 u'user': encoding.unifromlocal(ctx.user()),
385 b'user': ctx.user(),
385 u'date': u'{:.0f} {}'.format(*ctx.date()),
386 b'date': b'%d %d' % ctx.date(),
386 u'node': encoding.unifromlocal(ctx.hex()),
387 b'node': ctx.hex(),
387 u'parent': encoding.unifromlocal(ctx.p1().hex()),
388 b'parent': ctx.p1().hex(),
388 }),
389 }),
389 }
390 }
390 callconduit(ctx.repo(), b'differential.setdiffproperty', params)
391 callconduit(ctx.repo(), b'differential.setdiffproperty', params)
@@ -392,12 +393,11 b' def writediffproperties(ctx, diff):'
392 params = {
393 params = {
393 b'diff_id': diff[b'id'],
394 b'diff_id': diff[b'id'],
394 b'name': b'local:commits',
395 b'name': b'local:commits',
395 b'data': json.dumps({
396 b'data': templatefilters.json({
396 encoding.unifromlocal(ctx.hex()): {
397 ctx.hex(): {
397 u'author': encoding.unifromlocal(stringutil.person(ctx.user())),
398 b'author': stringutil.person(ctx.user()),
398 u'authorEmail': encoding.unifromlocal(
399 b'authorEmail': stringutil.email(ctx.user()),
399 stringutil.email(ctx.user())),
400 b'time': b'%d' % ctx.date()[0],
400 u'time': u'{:.0f}'.format(ctx.date()[0]),
401 },
401 },
402 }),
402 }),
403 }
403 }
General Comments 0
You need to be logged in to leave comments. Login now