mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-06-30 20:17:08 +00:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
2f968c943b | |||
2b5b4ac292 | |||
6f6cd77a50 | |||
896d5dffd3 |
@ -337,19 +337,16 @@ class RefSpec(object):
|
||||
_ssh_cache = {}
|
||||
_ssh_master = True
|
||||
|
||||
def _open_ssh(host, port=None):
|
||||
def _open_ssh(host, port):
|
||||
global _ssh_master
|
||||
|
||||
if port is None:
|
||||
port = 22
|
||||
|
||||
key = '%s:%s' % (host, port)
|
||||
if key in _ssh_cache:
|
||||
return True
|
||||
|
||||
if not _ssh_master \
|
||||
or 'GIT_SSH' in os.environ \
|
||||
or sys.platform == 'win32':
|
||||
or sys.platform in ('win32', 'cygwin'):
|
||||
# failed earlier, or cygwin ssh can't do this
|
||||
#
|
||||
return False
|
||||
@ -388,7 +385,7 @@ def close_ssh():
|
||||
pass
|
||||
|
||||
URI_SCP = re.compile(r'^([^@:]*@?[^:/]{1,}):')
|
||||
URI_ALL = re.compile(r'^([a-z][a-z+]*)://([^@/]*@?[^/])/')
|
||||
URI_ALL = re.compile(r'^([a-z][a-z+]*)://([^@/]*@?[^/]*)/')
|
||||
|
||||
def _preconnect(url):
|
||||
m = URI_ALL.match(url)
|
||||
@ -397,6 +394,8 @@ def _preconnect(url):
|
||||
host = m.group(2)
|
||||
if ':' in host:
|
||||
host, port = host.split(':')
|
||||
else:
|
||||
port = 22
|
||||
if scheme in ('ssh', 'git+ssh', 'ssh+git'):
|
||||
return _open_ssh(host, port)
|
||||
return False
|
||||
@ -404,7 +403,7 @@ def _preconnect(url):
|
||||
m = URI_SCP.match(url)
|
||||
if m:
|
||||
host = m.group(1)
|
||||
return _open_ssh(host)
|
||||
return _open_ssh(host, 22)
|
||||
|
||||
|
||||
class Remote(object):
|
||||
|
@ -22,13 +22,18 @@ class Start(Command):
|
||||
common = True
|
||||
helpSummary = "Start a new branch for development"
|
||||
helpUsage = """
|
||||
%prog <newbranchname> [<project>...]
|
||||
%prog <newbranchname> [--all | <project>...]
|
||||
"""
|
||||
helpDescription = """
|
||||
'%prog' begins a new branch of development, starting from the
|
||||
revision specified in the manifest.
|
||||
"""
|
||||
|
||||
def _Options(self, p):
|
||||
p.add_option('--all',
|
||||
dest='all', action='store_true',
|
||||
help='begin branch in all projects')
|
||||
|
||||
def Execute(self, opt, args):
|
||||
if not args:
|
||||
self.Usage()
|
||||
@ -39,7 +44,14 @@ revision specified in the manifest.
|
||||
sys.exit(1)
|
||||
|
||||
err = []
|
||||
all = self.GetProjects(args[1:])
|
||||
projects = []
|
||||
if not opt.all:
|
||||
projects = args[1:]
|
||||
if len(projects) < 1:
|
||||
print >>sys.stderr, "error: at least one project must be specified"
|
||||
sys.exit(1)
|
||||
|
||||
all = self.GetProjects(projects)
|
||||
|
||||
pm = Progress('Starting %s' % nb, len(all))
|
||||
for project in all:
|
||||
|
Reference in New Issue
Block a user