# HG changeset patch # User Christian Ebert # Date 1168913680 -3600 # Node ID e086f7eb01986213716be4f0f41cc4b5511c98c1 # Parent 393d6f8ea83ccf49f3dcf38105ebf8fa824b38da Emergency brake against multiline expansion As expansion always happens ad hoc, is not tracked, multiline or incremental expansion do not seem worth the trouble. If at all, it would make sense with static, hardcoded keywords. diff -r 393d6f8ea83c -r e086f7eb0198 hgkw/keyword.py --- a/hgkw/keyword.py Tue Jan 16 01:04:46 2007 +0100 +++ b/hgkw/keyword.py Tue Jan 16 03:14:40 2007 +0100 @@ -17,6 +17,9 @@ You can either use the default cvs-like keywords or provide your own in hgrc. +Expansions spanning more than one line are truncated to their first line. +Incremental expansion (like CVS' $Log$) is not supported. + Default $keywords$ and their $keyword: substition $ are: Revision: changeset id Author: username @@ -40,7 +43,7 @@ # in case you prefer your own keyword maps over the cvs-like defaults: [keywordmaps] HGdate = {date|rfc822date} - lastlog = {desc|firstline} + lastlog = {desc} ## same as {desc|firstline} in this context checked in by = {author} ... ''' @@ -106,7 +109,8 @@ self.t.use_template(template) self.ui.pushbuffer() self.t.show(changenode=node, root=self.repo.root, file=path) - return '$%s: %s $' % (kw, self.ui.popbuffer()) + expansion = templater.firstline(self.ui.popbuffer()) + return '$%s: %s $' % (kw, expansion) def reposetup(ui, repo):