##// END OF EJS Templates
Make hg paths and hg debugconfig work with -R/--repository option....
Thomas Arendsen Hein -
r1858:9fab6e90 default
parent child Browse files
Show More
@@ -1058,13 +1058,8 b' def debugcheckstate(ui, repo):'
1058 1058 error = _(".hg/dirstate inconsistent with current parent's manifest")
1059 1059 raise util.Abort(error)
1060 1060
1061 def debugconfig(ui):
1061 def debugconfig(ui, repo):
1062 1062 """show combined config settings from all hgrc files"""
1063 try:
1064 repo = hg.repository(ui)
1065 ui = repo.ui
1066 except hg.RepoError:
1067 pass
1068 1063 for section, name, value in ui.walkconfig():
1069 1064 ui.write('%s.%s=%s\n' % (section, name, value))
1070 1065
@@ -1763,7 +1758,7 b' def parents(ui, repo, rev=None, branches'
1763 1758 if n != nullid:
1764 1759 show_changeset(ui, repo, changenode=n, brinfo=br)
1765 1760
1766 def paths(ui, search=None):
1761 def paths(ui, repo, search=None):
1767 1762 """show definition of symbolic path names
1768 1763
1769 1764 Show definition of symbolic path name NAME. If no name is given, show
@@ -1772,12 +1767,6 b' def paths(ui, search=None):'
1772 1767 Path names are defined in the [paths] section of /etc/mercurial/hgrc
1773 1768 and $HOME/.hgrc. If run inside a repository, .hg/hgrc is used, too.
1774 1769 """
1775 try:
1776 repo = hg.repository(ui)
1777 ui = repo.ui
1778 except hg.RepoError:
1779 pass
1780
1781 1770 if search:
1782 1771 for name, path in ui.configitems("paths"):
1783 1772 if name == search:
@@ -2668,8 +2657,9 b' globalopts = ['
2668 2657 ('h', 'help', None, _('display help and exit')),
2669 2658 ]
2670 2659
2671 norepo = ("clone init version help debugancestor debugconfig debugdata"
2672 " debugindex debugindexdot paths")
2660 norepo = ("clone init version help debugancestor debugdata"
2661 " debugindex debugindexdot")
2662 optionalrepo = ("paths debugconfig")
2673 2663
2674 2664 def find(cmd):
2675 2665 """Return (aliases, command table entry) for command string."""
@@ -2869,12 +2859,16 b' def dispatch(args):'
2869 2859 (options['cwd'], inst.strerror))
2870 2860
2871 2861 if cmd not in norepo.split():
2872 if not repo:
2873 repo = hg.repository(u, path=path)
2874 u = repo.ui
2875 for x in external:
2876 if hasattr(x, 'reposetup'):
2877 x.reposetup(u, repo)
2862 try:
2863 if not repo:
2864 repo = hg.repository(u, path=path)
2865 u = repo.ui
2866 for x in external:
2867 if hasattr(x, 'reposetup'):
2868 x.reposetup(u, repo)
2869 except hg.RepoError:
2870 if cmd not in optionalrepo.split():
2871 raise
2878 2872 d = lambda: func(u, repo, *args, **cmdoptions)
2879 2873 else:
2880 2874 d = lambda: func(u, *args, **cmdoptions)
General Comments 0
You need to be logged in to leave comments. Login now