mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 23:07:18 +03:00
clone: add doctest for default destination
This commit is contained in:
parent
c173245d83
commit
b9bc586fe9
@ -123,7 +123,21 @@ def peer(uiorrepo, opts, path, create=False):
|
||||
return _peerorrepo(rui, path, create).peer()
|
||||
|
||||
def defaultdest(source):
|
||||
'''return default destination of clone if none is given'''
|
||||
'''return default destination of clone if none is given
|
||||
|
||||
>>> defaultdest('foo')
|
||||
'foo'
|
||||
>>> defaultdest('/foo/bar')
|
||||
'bar'
|
||||
>>> defaultdest('/')
|
||||
''
|
||||
>>> defaultdest('')
|
||||
'.'
|
||||
>>> defaultdest('http://example.org/')
|
||||
'.'
|
||||
>>> defaultdest('http://example.org/foo/')
|
||||
'foo'
|
||||
'''
|
||||
return os.path.basename(os.path.normpath(util.url(source).path or ''))
|
||||
|
||||
def share(ui, source, dest=None, update=True):
|
||||
|
@ -15,6 +15,7 @@ testmod('mercurial.changelog')
|
||||
testmod('mercurial.dagparser', optionflags=doctest.NORMALIZE_WHITESPACE)
|
||||
testmod('mercurial.dispatch')
|
||||
testmod('mercurial.encoding')
|
||||
testmod('mercurial.hg')
|
||||
testmod('mercurial.hgweb.hgwebdir_mod')
|
||||
testmod('mercurial.match')
|
||||
testmod('mercurial.minirst')
|
||||
|
Loading…
Reference in New Issue
Block a user