Do not set up kwrepo when pulling from bundlerepo
authorChristian Ebert <blacktrash@gmx.net>
Thu, 07 Feb 2008 01:49:17 +0100
changeset 384 482c91f8c230
parent 383 af4c062c4b41
child 385 e93c63004ec2
Do not set up kwrepo when pulling from bundlerepo Spotted and test case provided by pmezard.
hgkw/keyword.py
tests/test-keyword
tests/test-keyword.out
--- a/hgkw/keyword.py	Wed Feb 06 23:32:21 2008 +0100
+++ b/hgkw/keyword.py	Thu Feb 07 01:49:17 2008 +0100
@@ -412,8 +412,12 @@
     This is done for local repos only, and only if there are
     files configured at all for keyword substitution.'''
 
-    if not repo.local() or '.hg' in repo.root.split('/'):
-        return
+    try:
+        if (not repo.local() or '.hg' in repo.root.split('/')
+            or repo._url.startswith('bundle:')):
+            return
+    except AttributeError:
+        pass
 
     hgcmd, func, args, opts, cmdopts = dispatch._parse(ui, sys.argv[1:])
     if hgcmd in nokwcommands.split():
--- a/tests/test-keyword	Wed Feb 06 23:32:21 2008 +0100
+++ b/tests/test-keyword	Thu Feb 07 01:49:17 2008 +0100
@@ -24,8 +24,8 @@
 
 hg --quiet kwdemo "Branch = {branches}"
 
-hg init Test
-cd Test
+hg init Test-bndl
+cd Test-bndl
 
 echo % kwshrink should exit silently in empty/invalid repo
 hg kwshrink
@@ -69,6 +69,16 @@
 mv $HGRCPATH.nohook $HGRCPATH
 rm hooktest
 
+echo % bundle
+hg bundle --base null ../kw.hg
+
+cd ..
+hg init Test
+cd Test
+
+echo % pull from bundle
+hg pull -u ../kw.hg
+
 echo % touch
 touch a b
 echo % status
--- a/tests/test-keyword.out	Wed Feb 06 23:32:21 2008 +0100
+++ b/tests/test-keyword.out	Thu Feb 07 01:49:17 2008 +0100
@@ -138,6 +138,16 @@
 a
 % diff a hooktest
 % removing commit hook from config
+% bundle
+1 changesets found
+% pull from bundle
+pulling from ../kw.hg
+requesting all changes
+adding changesets
+adding manifests
+adding file changes
+added 1 changesets with 3 changes to 3 files
+3 files updated, 0 files merged, 0 files removed, 0 files unresolved
 % touch
 % status
 % update