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