changeset 91:872a57531db6

Fix ParseError import, work around demandload Tests pass from 1.0 up to fff6e253e1f6
author Patrick Mezard <pmezard@gmail.com>
date Tue, 03 Feb 2009 22:05:11 +0100
parents 2571a40714e4
children 4b2c5c4ffeff
files forest.py
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/forest.py	Mon Jan 26 20:35:51 2009 -0600
+++ b/forest.py	Tue Feb 03 22:05:11 2009 +0100
@@ -82,10 +82,15 @@
         findcmd.UnknownCommand = m.UnknownCommand
         break
 try:
-    from mercurial.repo import RepoError
-    from mercurial.cmdutil import ParseError
+    # Assign the exceptions explicitely to avoid demandload issues
+    import mercurial.repo
+    import mercurial.cmdutil
+    RepoError = mercurial.repo.RepoError
+    ParseError = mercurial.dispatch.ParseError
 except AttributeError:
-    from mercurial.error import RepoError, ParseError
+    import mercurial.error
+    RepoError = mercurial.error.RepoError
+    ParseError = mercurial.error.ParseError
 
 # For backwards compatibility, find the parseurl() function that splits
 # urls and revisions.  Mercurial 0.9.3 doesn't have this, so we need