diff --git a/hgext/keyword.py b/hgext/keyword.py --- a/hgext/keyword.py +++ b/hgext/keyword.py @@ -11,8 +11,8 @@ # # There are many good reasons why this is not needed in a distributed # SCM, still it may be useful in very small projects based on single -# files (like LaTeX packages), that are mostly addressed to an audience -# not running a version control system. +# files (like LaTeX packages), that are mostly addressed to an +# audience not running a version control system. # # For in-depth discussion refer to # . @@ -34,15 +34,15 @@ '''keyword expansion in local repositories -This extension expands RCS/CVS-like or self-customized $Keywords$ -in tracked text files selected by your configuration. +This extension expands RCS/CVS-like or self-customized $Keywords$ in +tracked text files selected by your configuration. -Keywords are only expanded in local repositories and not stored in -the change history. The mechanism can be regarded as a convenience -for the current user or for archive distribution. +Keywords are only expanded in local repositories and not stored in the +change history. The mechanism can be regarded as a convenience for the +current user or for archive distribution. -Configuration is done in the [keyword] and [keywordmaps] sections -of hgrc files. +Configuration is done in the [keyword] and [keywordmaps] sections of +hgrc files. Example: @@ -59,19 +59,21 @@ control run "hg kwdemo". An additional date template filter {date|utcdate} is provided. -The default template mappings (view with "hg kwdemo -d") can be replaced -with customized keywords and templates. -Again, run "hg kwdemo" to control the results of your config changes. +The default template mappings (view with "hg kwdemo -d") can be +replaced with customized keywords and templates. Again, run "hg +kwdemo" to control the results of your config changes. Before changing/disabling active keywords, run "hg kwshrink" to avoid -the risk of inadvertedly storing expanded keywords in the change history. +the risk of inadvertedly storing expanded keywords in the change +history. To force expansion after enabling it, or a configuration change, run "hg kwexpand". -Also, when committing with the record extension or using mq's qrecord, be aware -that keywords cannot be updated. Again, run "hg kwexpand" on the files in -question to update keyword expansions after all changes have been checked in. +Also, when committing with the record extension or using mq's qrecord, +be aware that keywords cannot be updated. Again, run "hg kwexpand" on +the files in question to update keyword expansions after all changes +have been checked in. Expansions spanning more than one line and incremental expansions, like CVS' $Log$, are not supported. A keyword template map @@ -276,11 +278,11 @@ def _kwfwrite(ui, repo, expand, *pats, * def demo(ui, repo, *args, **opts): '''print [keywordmaps] configuration and an expansion example - Show current, custom, or default keyword template maps - and their expansion. + Show current, custom, or default keyword template maps and their + expansion. - Extend current configuration by specifying maps as arguments - and optionally by reading from an additional hgrc file. + Extend current configuration by specifying maps as arguments and + optionally by reading from an additional hgrc file. Override current keyword template maps with "default" option. ''' @@ -367,9 +369,9 @@ def expand(ui, repo, *pats, **opts): def files(ui, repo, *pats, **opts): '''print files currently configured for keyword expansion - Crosscheck which files in working directory are potential targets for - keyword expansion. - That is, files matched by [keyword] config patterns but not symlinks. + Crosscheck which files in working directory are potential targets + for keyword expansion. That is, files matched by [keyword] config + patterns but not symlinks. ''' kwt = kwtools['templater'] status = _status(ui, repo, kwt, opts.get('untracked'), *pats, **opts) @@ -389,8 +391,8 @@ def files(ui, repo, *pats, **opts): def shrink(ui, repo, *pats, **opts): '''revert expanded keywords in working directory - Run before changing/disabling active keywords - or if you experience problems with "hg import" or "hg merge". + Run before changing/disabling active keywords or if you experience + problems with "hg import" or "hg merge". kwshrink refuses to run if given files contain local changes. ''' diff --git a/tests/test-keyword.out b/tests/test-keyword.out --- a/tests/test-keyword.out +++ b/tests/test-keyword.out @@ -1,15 +1,15 @@ % help keyword extension - keyword expansion in local repositories -This extension expands RCS/CVS-like or self-customized $Keywords$ -in tracked text files selected by your configuration. +This extension expands RCS/CVS-like or self-customized $Keywords$ in +tracked text files selected by your configuration. -Keywords are only expanded in local repositories and not stored in -the change history. The mechanism can be regarded as a convenience -for the current user or for archive distribution. +Keywords are only expanded in local repositories and not stored in the +change history. The mechanism can be regarded as a convenience for the +current user or for archive distribution. -Configuration is done in the [keyword] and [keywordmaps] sections -of hgrc files. +Configuration is done in the [keyword] and [keywordmaps] sections of +hgrc files. Example: @@ -26,19 +26,21 @@ control run "hg kwdemo". An additional date template filter {date|utcdate} is provided. -The default template mappings (view with "hg kwdemo -d") can be replaced -with customized keywords and templates. -Again, run "hg kwdemo" to control the results of your config changes. +The default template mappings (view with "hg kwdemo -d") can be +replaced with customized keywords and templates. Again, run "hg +kwdemo" to control the results of your config changes. Before changing/disabling active keywords, run "hg kwshrink" to avoid -the risk of inadvertedly storing expanded keywords in the change history. +the risk of inadvertedly storing expanded keywords in the change +history. To force expansion after enabling it, or a configuration change, run "hg kwexpand". -Also, when committing with the record extension or using mq's qrecord, be aware -that keywords cannot be updated. Again, run "hg kwexpand" on the files in -question to update keyword expansions after all changes have been checked in. +Also, when committing with the record extension or using mq's qrecord, +be aware that keywords cannot be updated. Again, run "hg kwexpand" on +the files in question to update keyword expansions after all changes +have been checked in. Expansions spanning more than one line and incremental expansions, like CVS' $Log$, are not supported. A keyword template map