[PATCH] keyword: simplify repo.local and bundle check (2nd try)

Christian Ebert blacktrash at gmx.net
Tue Dec 16 03:00:01 CST 2008


# HG changeset patch
# User Christian Ebert <blacktrash at gmx.net>
# Date 1229417921 -3600
# Node ID 5aca12729a0dda97231a5450d586809797cafc7d
# Parent  4acf5f24912be9dedecafbbd721b1b534b06b5e8
keyword: simplify repo.local and bundle check (as in 2f4a399a8787)

diff --git a/hgext/keyword.py b/hgext/keyword.py
--- a/hgext/keyword.py
+++ b/hgext/keyword.py
@@ -425,14 +425,10 @@
     keyword substitutions.
     Monkeypatches patch and webcommands.'''
 
-    try:
-        if (not repo.local() or not kwtools['inc']
-            or kwtools['hgcmd'] in nokwcommands.split()
-            or '.hg' in util.splitpath(repo.root)
-            or repo._url.startswith('bundle:')):
-            return
-    except AttributeError:
-        pass
+    if (not hasattr(repo, 'dirstate') or not kwtools['inc']
+        or kwtools['hgcmd'] in nokwcommands.split()
+        or '.hg' in util.splitpath(repo.root)):
+        return
 
     kwtools['templater'] = kwt = kwtemplater(ui, repo)
 


More information about the Mercurial-devel mailing list