##// END OF EJS Templates
keyring_check handles a few args
Marcin Kasperski -
r188:44833bd3 default
parent child Browse files
Show More
@@ -677,7 +677,7 b' def _smtp(ui):'
677 677 # Custom commands
678 678 ############################################################
679 679
680 def cmd_keyring_check(ui, repo, path=None, **opts):
680 def cmd_keyring_check(ui, repo, *path_args, **opts):
681 681 """
682 682 Prints basic info (whether password is currently saved, and how is
683 683 it identified) for given path or all defined repo paths.
@@ -687,26 +687,25 b' def cmd_keyring_check(ui, repo, path=Non'
687 687 re_http_url = re.compile(r'^https?://')
688 688 defined_paths = [(name, url)
689 689 for name, url in ui.configitems('paths')]
690 if path:
690 if path_args:
691 691 # Maybe parameter is an alias
692 692 defined_paths_dic = dict(defined_paths)
693 resolved = defined_paths_dic.get(path, path)
694 if not re_http_url.search(resolved):
695 ui.status(_("keyring: %s is not http path (%s)\n") % (path, resolved))
696 return
697 paths = [(path, resolved)]
693 paths = [(path_arg, defined_paths_dic.get(path_arg, path_arg))
694 for path_arg in path_args]
698 695 else:
699 paths = [(name, url) for name, url in defined_paths
700 if re_http_url.search(url)]
696 paths = [(name, url) for name, url in defined_paths]
701 697
702 698 if not paths:
703 ui.status(_("keyring: no http path aliases defined\n"))
704 return
699 ui.status(_("keyring_check: no paths defined"))
705 700
706 701 handler = HTTPPasswordHandler()
707 702
708 703 ui.status(_("keyring password save status:\n"))
709 704 for name, url in paths:
705 if not re_http_url.search(url):
706 if path_args:
707 ui.status(_(" %s: non-http path (%s)\n") % (name, url))
708 continue
710 709 user, pwd, source, final_url = handler.get_credentials(passwordmgr(ui), name, url)
711 710 if pwd:
712 711 ui.status(_(" %s: password available, source: %s, bound to user %s, url %s\n") % (
General Comments 0
You need to be logged in to leave comments. Login now