comparison hgext/extdiff.py @ 27681:174069440929

extdiff: use @command decorator to set up diff commands It can set "inferrepo" attribute appropriately.
author Yuya Nishihara <yuya@tcha.org>
date Fri, 01 Jan 2016 22:35:34 +0900
parents c750245c6b85
children 4f86c3bed63b
comparison
equal deleted inserted replaced
27680:c750245c6b85 27681:174069440929
367 # fail when the docstring contains non-ASCII characters. 367 # fail when the docstring contains non-ASCII characters.
368 # Decoding the string to a Unicode string here (using the 368 # Decoding the string to a Unicode string here (using the
369 # right encoding) prevents that. 369 # right encoding) prevents that.
370 mydiff.__doc__ = doc.decode(encoding.encoding) 370 mydiff.__doc__ = doc.decode(encoding.encoding)
371 return mydiff 371 return mydiff
372 cmdtable[cmd] = (save(cmdline), 372 command(cmd, extdiffopts[:], _('hg %s [OPTION]... [FILE]...') % cmd,
373 extdiffopts[:], 373 inferrepo=True)(save(cmdline))
374 _('hg %s [OPTION]... [FILE]...') % cmd)