comparison mercurial/hg.py @ 8807:8bf6eb68ddaf

share: allow dest to default to the basename of source
author Matt Mackall <mpm@selenic.com>
date Sat, 13 Jun 2009 18:16:44 -0500
parents 971e38a9344b
children ab668c92a036
comparison
equal deleted inserted replaced
8806:14a0bdd59848 8807:8bf6eb68ddaf
79 return path[7:] 79 return path[7:]
80 if path.startswith('file:'): 80 if path.startswith('file:'):
81 return path[5:] 81 return path[5:]
82 return path 82 return path
83 83
84 def share(ui, source, dest, update=True): 84 def share(ui, source, dest=None, update=True):
85 '''create a shared repository''' 85 '''create a shared repository'''
86 86
87 if not islocal(source): 87 if not islocal(source):
88 raise util.Abort(_('can only share local repositories')) 88 raise util.Abort(_('can only share local repositories'))
89
90 if not dest:
91 dest = os.path.basename(source)
89 92
90 if isinstance(source, str): 93 if isinstance(source, str):
91 origsource = ui.expandpath(source) 94 origsource = ui.expandpath(source)
92 source, rev, checkout = parseurl(origsource, '') 95 source, rev, checkout = parseurl(origsource, '')
93 srcrepo = repository(ui, source) 96 srcrepo = repository(ui, source)