changeset 993:05c8aa7d3edc

git_handler: use compat.passwordmgr for hg < 3.9 support
author Sean Farley <sean@farley.io>
date Thu, 04 Aug 2016 14:16:44 -0700
parents 92d7702c19da
children 1fec6463922b
files hggit/git_handler.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hggit/git_handler.py
+++ b/hggit/git_handler.py
@@ -27,6 +27,7 @@
 )
 
 import _ssh
+import compat
 import git2hg
 import hg2git
 import util
@@ -1627,7 +1628,10 @@
             uri = uri[4:]
 
         if uri.startswith('http://') or uri.startswith('https://'):
-            auth = urllib2.HTTPBasicAuthHandler(url.passwordmgr(self.ui))
+            realm = hgutil.urlreq.httppasswordmgrwithdefaultrealm()
+            pmgr = compat.passwordmgr(self.ui, realm)
+            auth = urllib2.HTTPBasicAuthHandler(pmgr)
+
             opener = urllib2.build_opener(auth)
             ua = 'git/20x6 (hg-git ; uses dulwich and hg ; like git-core)'
             opener.addheaders = [('User-Agent', ua)]