##// END OF EJS Templates
Temporary working version
Marcin Kasperski -
r1:3d71375e default
parent child Browse files
Show More
@@ -0,0 +1,5 b''
1 syntax: regexp
2
3 \.pyc$
4 ~$
5 ^\.\# No newline at end of file
@@ -11,6 +11,12 b' 1) in ~/.hgrc (or /etc/hgext/...)'
11 11 ...
12 12 hgext.mercurial_keyring = /path/to/mercurial_keyring.py
13 13
14
15 2) Drop this file to hgext directory and in ~/.hgrc
16
17 [extensions]
18 hgext.mercurial_keyring =
19
14 20 """
15 21
16 22 from mercurial import hg, repo, util
@@ -24,7 +30,7 b' import keyring'
24 30 import getpass
25 31 from urlparse import urlparse
26 32
27 KEYRING_ENTRY_PFX = "Mercurial:%s"
33 KEYRING_SERVICE = "Mercurial"
28 34
29 35 def monkeypatch_method(cls):
30 36 def decorator(func):
@@ -44,9 +50,25 b' def find_user_password(self, realm, auth'
44 50 # https://repo.machine.com/repos/apps/module?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between
45 51 parsed_url = urlparse(authuri)
46 52 base_url = "%s://%s%s" % (parsed_url.scheme, parsed_url.netloc, parsed_url.path)
47
48 53 print "find_user_password", realm, base_url
49 54
50 # return user, password
51 return None, None
55
56 # TODO: odczyt danych z cache w procesie
57
58 # TODO: odczyt danych już obecnych w keyring-u
59
60 if not self.ui.interactive():
61 raise util.Abort(_('mercurial_keyring: http authorization required'))
62 self.ui.write(_("http authorization required\n"))
63 self.ui.status(_("realm: %s, url: %s\n" % (realm, base_url)))
64 username = self.ui.prompt(_("user:"), default = None)
65 password = self.ui.getpass(_("password for user %s:" % username))
52 66
67 # TODO: zapis w keyringu
68
69 # TODO: zapis w cache w procesie
70
71
72 return username, password
73 #return None, None
74
General Comments 0
You need to be logged in to leave comments. Login now