##// END OF EJS Templates
py3: convert keys of kwargs in template keywords functions to bytes...
Pulkit Goyal -
r32972:26e710f0 default
parent child Browse files
Show More
@@ -20,6 +20,7 b' from . import ('
20 20 hbisect,
21 21 obsutil,
22 22 patch,
23 pycompat,
23 24 registrar,
24 25 scmutil,
25 26 util,
@@ -293,6 +294,7 b' def showbranches(**args):'
293 294 changeset was committed. Will be empty if the branch name was
294 295 default. (DEPRECATED)
295 296 """
297 args = pycompat.byteskwargs(args)
296 298 branch = args['ctx'].branch()
297 299 if branch != 'default':
298 300 return showlist('branch', [branch], args, plural='branches')
@@ -303,6 +305,7 b' def showbookmarks(**args):'
303 305 """List of strings. Any bookmarks associated with the
304 306 changeset. Also sets 'active', the name of the active bookmark.
305 307 """
308 args = pycompat.byteskwargs(args)
306 309 repo = args['ctx']._repo
307 310 bookmarks = args['ctx'].bookmarks()
308 311 active = repo._activebookmark
@@ -313,6 +316,7 b' def showbookmarks(**args):'
313 316 @templatekeyword('children')
314 317 def showchildren(**args):
315 318 """List of strings. The children of the changeset."""
319 args = pycompat.byteskwargs(args)
316 320 ctx = args['ctx']
317 321 childrevs = ['%d:%s' % (cctx, cctx) for cctx in ctx.children()]
318 322 return showlist('children', childrevs, args, element='child')
@@ -360,6 +364,7 b' def showdiffstat(repo, ctx, templ, **arg'
360 364 @templatekeyword('envvars')
361 365 def showenvvars(repo, **args):
362 366 """A dictionary of environment variables. (EXPERIMENTAL)"""
367 args = pycompat.byteskwargs(args)
363 368 env = repo.ui.exportableenviron()
364 369 env = util.sortdict((k, env[k]) for k in sorted(env))
365 370 return showdict('envvar', env, args, plural='envvars')
@@ -368,6 +373,7 b' def showenvvars(repo, **args):'
368 373 def showextras(**args):
369 374 """List of dicts with key, value entries of the 'extras'
370 375 field of this changeset."""
376 args = pycompat.byteskwargs(args)
371 377 extras = args['ctx'].extra()
372 378 extras = util.sortdict((k, extras[k]) for k in sorted(extras))
373 379 makemap = lambda k: {'key': k, 'value': extras[k]}
@@ -379,6 +385,7 b' def showextras(**args):'
379 385 @templatekeyword('file_adds')
380 386 def showfileadds(**args):
381 387 """List of strings. Files added by this changeset."""
388 args = pycompat.byteskwargs(args)
382 389 repo, ctx, revcache = args['repo'], args['ctx'], args['revcache']
383 390 return showlist('file_add', getfiles(repo, ctx, revcache)[1], args,
384 391 element='file')
@@ -388,6 +395,7 b' def showfilecopies(**args):'
388 395 """List of strings. Files copied in this changeset with
389 396 their sources.
390 397 """
398 args = pycompat.byteskwargs(args)
391 399 cache, ctx = args['cache'], args['ctx']
392 400 copies = args['revcache'].get('copies')
393 401 if copies is None:
@@ -412,6 +420,7 b' def showfilecopiesswitch(**args):'
412 420 """List of strings. Like "file_copies" but displayed
413 421 only if the --copied switch is set.
414 422 """
423 args = pycompat.byteskwargs(args)
415 424 copies = args['revcache'].get('copies') or []
416 425 copies = util.sortdict(copies)
417 426 return showdict('file_copy', copies, args, plural='file_copies',
@@ -420,6 +429,7 b' def showfilecopiesswitch(**args):'
420 429 @templatekeyword('file_dels')
421 430 def showfiledels(**args):
422 431 """List of strings. Files removed by this changeset."""
432 args = pycompat.byteskwargs(args)
423 433 repo, ctx, revcache = args['repo'], args['ctx'], args['revcache']
424 434 return showlist('file_del', getfiles(repo, ctx, revcache)[2], args,
425 435 element='file')
@@ -427,6 +437,7 b' def showfiledels(**args):'
427 437 @templatekeyword('file_mods')
428 438 def showfilemods(**args):
429 439 """List of strings. Files modified by this changeset."""
440 args = pycompat.byteskwargs(args)
430 441 repo, ctx, revcache = args['repo'], args['ctx'], args['revcache']
431 442 return showlist('file_mod', getfiles(repo, ctx, revcache)[0], args,
432 443 element='file')
@@ -436,6 +447,7 b' def showfiles(**args):'
436 447 """List of strings. All files modified, added, or removed by this
437 448 changeset.
438 449 """
450 args = pycompat.byteskwargs(args)
439 451 return showlist('file', args['ctx'].files(), args)
440 452
441 453 @templatekeyword('graphnode')
@@ -470,6 +482,7 b' def showlatesttag(**args):'
470 482
471 483 def showlatesttags(pattern, **args):
472 484 """helper method for the latesttag keyword and function"""
485 args = pycompat.byteskwargs(args)
473 486 repo, ctx = args['repo'], args['ctx']
474 487 cache = args['cache']
475 488 latesttags = getlatesttags(repo, ctx, cache, pattern)
@@ -526,6 +539,7 b' def showmanifest(**args):'
526 539
527 540 def shownames(namespace, **args):
528 541 """helper method to generate a template keyword for a namespace"""
542 args = pycompat.byteskwargs(args)
529 543 ctx = args['ctx']
530 544 repo = ctx.repo()
531 545 ns = repo.names[namespace]
@@ -536,6 +550,7 b' def shownames(namespace, **args):'
536 550 def shownamespaces(**args):
537 551 """Dict of lists. Names attached to this changeset per
538 552 namespace."""
553 args = pycompat.byteskwargs(args)
539 554 ctx = args['ctx']
540 555 repo = ctx.repo()
541 556 namespaces = util.sortdict((k, showlist('name', ns.names(repo, ctx.node()),
@@ -603,6 +618,7 b' def showparents(**args):'
603 618 """List of strings. The parents of the changeset in "rev:node"
604 619 format. If the changeset has only one "natural" parent (the predecessor
605 620 revision) nothing is shown."""
621 args = pycompat.byteskwargs(args)
606 622 repo = args['repo']
607 623 ctx = args['ctx']
608 624 pctxs = scmutil.meaningfulparents(repo, ctx)
@@ -633,6 +649,7 b' def showrev(repo, ctx, templ, **args):'
633 649 def showrevslist(name, revs, **args):
634 650 """helper to generate a list of revisions in which a mapped template will
635 651 be evaluated"""
652 args = pycompat.byteskwargs(args)
636 653 repo = args['ctx'].repo()
637 654 revs = [str(r) for r in revs] # ifcontains() needs a list of str
638 655 f = _showlist(name, revs, args)
@@ -643,6 +660,7 b' def showrevslist(name, revs, **args):'
643 660 @templatekeyword('subrepos')
644 661 def showsubrepos(**args):
645 662 """List of strings. Updated subrepositories in the changeset."""
663 args = pycompat.byteskwargs(args)
646 664 ctx = args['ctx']
647 665 substate = ctx.substate
648 666 if not substate:
@@ -682,6 +700,7 b' def showtroubles(**args):'
682 700
683 701 (EXPERIMENTAL)
684 702 """
703 args = pycompat.byteskwargs(args)
685 704 return showlist('trouble', args['ctx'].troubles(), args)
686 705
687 706 # tell hggettext to extract docstrings from these functions:
General Comments 0
You need to be logged in to leave comments. Login now