Commits

Patrick Mézard committed 872a575

Fix ParseError import, work around demandload

Tests pass from 1.0 up to fff6e253e1f6

  • Participants
  • Parent commits 2571a40

Comments (0)

Files changed (1)

         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