# HG changeset patch # User Christian Ebert # Date 1170913960 -3600 # Node ID 47b45198a30d485bf146ac855771178cabbafc78 # Parent e09b070073b25912a9162a571801c0093bcb6b66 "or" for "if" in getmodulename; shorter comment on backwards compatibiliy diff -r e09b070073b2 -r 47b45198a30d hgkw/keyword.py --- a/hgkw/keyword.py Thu Feb 08 06:45:12 2007 +0100 +++ b/hgkw/keyword.py Thu Feb 08 06:52:40 2007 +0100 @@ -72,11 +72,9 @@ ''' from mercurial.i18n import gettext as _ -# above line for backwards compatibility; can be changed to -# from mercurial.i18n import _ -# some day +# above line for backwards compatibility of standalone version +from mercurial import commands, cmdutil, templater, util from mercurial import context, filelog, revlog -from mercurial import commands, cmdutil, templater, util from mercurial.node import bin import os.path, re, sys, time @@ -98,9 +96,7 @@ '''Makes sure pretxncommit-hook can import keyword module regardless of where its located.''' for k, v in sys.modules.iteritems(): - if v is None: - continue - if not hasattr(v, '__file__'): + if v is None or not hasattr(v, '__file__'): continue if v.__file__.startswith(__file__): return k @@ -121,7 +117,6 @@ '|'.join(re.escape(k) for k in self.templates.keys())) templater.common_filters['utcdate'] = utcdate self.t = cmdutil.changeset_templater(ui, repo, False, '', False) - def expand(self, mobj, path, node): '''Expands keyword using corresponding template.'''