# HG changeset patch # User Sean Farley # Date 1470345366 25200 # Node ID 92d7702c19da0691c1e212e7b4e8f38ca3a8d954 # Parent 66336cb849b42eed350058987972da5bb56de6bc compat: add method for backwards compatible passwordmgr diff --git a/hggit/compat.py b/hggit/compat.py --- a/hggit/compat.py +++ b/hggit/compat.py @@ -1,3 +1,8 @@ +from mercurial import ( + url, + util as hgutil, +) + try: from mercurial import encoding hfsignoreclean = encoding.hfsignoreclean @@ -22,3 +27,11 @@ for c in _ignore: s = s.replace(c, '') return s + +def passwordmgr(ui, passwddb): + try: + return url.passwordmgr(ui, + hgutil.urlreq.httppasswordmgrwithdefaultrealm()) + except TypeError: + # compat with hg < 3.9 + return url.passwordmgr(ui)