changeset 914:a103d5211237

svnrepo: handle module/class rename in hg 2.3
author Bryan O'Sullivan <bryano@fb.com>
date Wed, 18 Jul 2012 14:04:02 -0700
parents 312f36a425f0
children d6c47c33f6a2
files hgsubversion/svnrepo.py
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/svnrepo.py
+++ b/hgsubversion/svnrepo.py
@@ -18,8 +18,13 @@ import errno
 
 from mercurial import error
 from mercurial import util as hgutil
-from mercurial import httprepo
-import mercurial.repo
+
+try:
+    from mercurial.peer import peerrepository
+    from mercurial import httppeer
+except ImportError:
+    from mercurial.repo import repository as peerrepository
+    from mercurial import httprepo as httppeer
 
 try:
     from mercurial import phases
@@ -107,7 +112,7 @@ def generate_repo_class(ui, repo):
 
     repo.__class__ = svnlocalrepo
 
-class svnremoterepo(mercurial.repo.repository):
+class svnremoterepo(peerrepository):
     """ the dumb wrapper for actual Subversion repositories """
 
     def __init__(self, ui, path=None):
@@ -177,7 +182,7 @@ def instance(ui, url, create):
     if url.startswith('http://') or url.startswith('https://'):
         try:
             # may yield a bogus 'real URL...' message
-            return httprepo.instance(ui, url, create)
+            return httppeer.instance(ui, url, create)
         except error.RepoError:
             ui.traceback()
             ui.note('(falling back to Subversion support)\n')