##// END OF EJS Templates
share: allow dest to default to the basename of source
Matt Mackall -
r8807:8bf6eb68 default
parent child Browse files
Show More
@@ -9,7 +9,7 b' import os'
9 from mercurial.i18n import _
9 from mercurial.i18n import _
10 from mercurial import hg, commands
10 from mercurial import hg, commands
11
11
12 def share(ui, source, dest, noupdate=False):
12 def share(ui, source, dest=None, noupdate=False):
13 """create a new shared repository (experimental)
13 """create a new shared repository (experimental)
14
14
15 Initialize a new repository and working directory that shares its
15 Initialize a new repository and working directory that shares its
@@ -25,7 +25,7 b' cmdtable = {'
25 "share":
25 "share":
26 (share,
26 (share,
27 [('U', 'noupdate', None, _('do not create a working copy'))],
27 [('U', 'noupdate', None, _('do not create a working copy'))],
28 _('[-U] SOURCE DEST')),
28 _('[-U] SOURCE [DEST]')),
29 }
29 }
30
30
31 commands.norepo += " share"
31 commands.norepo += " share"
@@ -81,12 +81,15 b' def localpath(path):'
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
89
90 if not dest:
91 dest = os.path.basename(source)
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, '')
General Comments 0
You need to be logged in to leave comments. Login now