##// END OF EJS Templates
cmdutil: rewrite makefilename() to use ctx methods
Yuya Nishihara -
r36224:9ddc884e default
parent child Browse files
Show More
@@ -893,16 +893,14 b' def getcommiteditor(edit=False, finishde'
893
893
894 def makefilename(ctx, pat, desc=None,
894 def makefilename(ctx, pat, desc=None,
895 total=None, seqno=None, revwidth=None, pathname=None):
895 total=None, seqno=None, revwidth=None, pathname=None):
896 repo = ctx.repo()
897 node = ctx.node()
898 expander = {
896 expander = {
899 'H': lambda: hex(node),
897 'H': lambda: ctx.hex(),
900 'R': lambda: '%d' % repo.changelog.rev(node),
898 'R': lambda: '%d' % ctx.rev(),
901 'h': lambda: short(node),
899 'h': lambda: short(ctx.node()),
902 'm': lambda: re.sub('[^\w]', '_', desc or ''),
900 'm': lambda: re.sub('[^\w]', '_', desc or ''),
903 'r': lambda: ('%d' % repo.changelog.rev(node)).zfill(revwidth or 0),
901 'r': lambda: ('%d' % ctx.rev()).zfill(revwidth or 0),
904 '%': lambda: '%',
902 '%': lambda: '%',
905 'b': lambda: os.path.basename(repo.root),
903 'b': lambda: os.path.basename(ctx.repo().root),
906 }
904 }
907
905
908 try:
906 try:
General Comments 0
You need to be logged in to leave comments. Login now