comparison mercurial/commands.py @ 779:b3c7cb74d325

Add paths command The following patch adds the 'paths' commands to show a named path, or list of available paths. In case anyone find it useful.
author TK Soh <teekaysoh@yahoo.com>
date Wed, 27 Jul 2005 08:19:59 -0800
parents d09975474928
children 4b06fc1c0f26
comparison
equal deleted inserted replaced
778:d09975474928 779:b3c7cb74d325
774 p = repo.dirstate.parents() 774 p = repo.dirstate.parents()
775 775
776 for n in p: 776 for n in p:
777 if n != hg.nullid: 777 if n != hg.nullid:
778 show_changeset(ui, repo, changenode=n) 778 show_changeset(ui, repo, changenode=n)
779
780 def paths(ui, repo, search = None):
781 """show path or list of available paths"""
782 if search:
783 for name, path in ui.configitems("paths"):
784 if name == search:
785 ui.write("%s\n" % path)
786 return
787 ui.warn("not found!\n")
788 return 1
789 else:
790 for name, path in ui.configitems("paths"):
791 ui.write("%s = %s\n" % (name, path))
779 792
780 def pull(ui, repo, source="default", **opts): 793 def pull(ui, repo, source="default", **opts):
781 """pull changes from the specified source""" 794 """pull changes from the specified source"""
782 source = ui.expandpath(source) 795 source = ui.expandpath(source)
783 ui.status('pulling from %s\n' % (source)) 796 ui.status('pulling from %s\n' % (source))
1163 [('r', 'rev', [], 'revision'), 1176 [('r', 'rev', [], 'revision'),
1164 ('p', 'patch', None, 'show patch')], 1177 ('p', 'patch', None, 'show patch')],
1165 'hg log [-r REV1 [-r REV2]] [-p] [FILE]'), 1178 'hg log [-r REV1 [-r REV2]] [-p] [FILE]'),
1166 "manifest": (manifest, [], 'hg manifest [REV]'), 1179 "manifest": (manifest, [], 'hg manifest [REV]'),
1167 "parents": (parents, [], 'hg parents [REV]'), 1180 "parents": (parents, [], 'hg parents [REV]'),
1181 "paths": (paths, [], 'hg paths [name]'),
1168 "^pull": 1182 "^pull":
1169 (pull, 1183 (pull,
1170 [('u', 'update', None, 'update working directory')], 1184 [('u', 'update', None, 'update working directory')],
1171 'hg pull [-u] [SOURCE]'), 1185 'hg pull [-u] [SOURCE]'),
1172 "^push": (push, [], 'hg push [DEST]'), 1186 "^push": (push, [], 'hg push [DEST]'),