80 Expansions spanning more than one line and incremental expansions, |
80 Expansions spanning more than one line and incremental expansions, |
81 like CVS' $Log$, are not supported. A keyword template map "Log = |
81 like CVS' $Log$, are not supported. A keyword template map "Log = |
82 {desc}" expands to the first line of the changeset description. |
82 {desc}" expands to the first line of the changeset description. |
83 ''' |
83 ''' |
84 |
84 |
85 from mercurial import commands, cmdutil, dispatch, filelog, extensions |
85 from mercurial import commands, context, cmdutil, dispatch, filelog, extensions |
86 from mercurial import localrepo, match, patch, templatefilters, templater, util |
86 from mercurial import localrepo, match, patch, templatefilters, templater, util |
87 from mercurial.hgweb import webcommands |
87 from mercurial.hgweb import webcommands |
88 from mercurial.i18n import _ |
88 from mercurial.i18n import _ |
89 import re, shutil, tempfile |
89 import re, shutil, tempfile |
90 |
90 |
589 finally: |
589 finally: |
590 wlock.release() |
590 wlock.release() |
591 |
591 |
592 repo.__class__ = kwrepo |
592 repo.__class__ = kwrepo |
593 |
593 |
|
594 def kwfilectx_cmp(orig, self, fctx): |
|
595 # keyword affects data size, comparing wdir and filelog size does |
|
596 # not make sense |
|
597 return self._filelog.cmp(self._filenode, fctx.data()) |
|
598 extensions.wrapfunction(context.filectx, 'cmp', kwfilectx_cmp) |
|
599 |
594 extensions.wrapfunction(patch.patchfile, '__init__', kwpatchfile_init) |
600 extensions.wrapfunction(patch.patchfile, '__init__', kwpatchfile_init) |
595 extensions.wrapfunction(patch, 'diff', kw_diff) |
601 extensions.wrapfunction(patch, 'diff', kw_diff) |
596 extensions.wrapfunction(cmdutil, 'copy', kw_copy) |
602 extensions.wrapfunction(cmdutil, 'copy', kw_copy) |
597 for c in 'annotate changeset rev filediff diff'.split(): |
603 for c in 'annotate changeset rev filediff diff'.split(): |
598 extensions.wrapfunction(webcommands, c, kwweb_skip) |
604 extensions.wrapfunction(webcommands, c, kwweb_skip) |