From d277d60e8b0aa4c7146444cc47ca2e410417a5f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Sun, 11 Jul 2010 12:03:17 +0200 Subject: Introduce '--vcs' option for repoman. The '--vcs' option can be used to override VCS autodetection and force using specific one. It can be especially useful if the work directory is ambiguous (i.e. there is more than one VCS control directory in the same directory). --- bin/repoman | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'bin') diff --git a/bin/repoman b/bin/repoman index 8ded3475d..3243438e2 100755 --- a/bin/repoman +++ b/bin/repoman @@ -178,6 +178,9 @@ def ParseArgs(args, qahelp): parser.add_option('-f', '--force', dest='force', default=False, action='store_true', help='Commit with QA violations') + parser.add_option('--vcs', dest='vcs', + help='Force using specific VCS instead of autodetection') + parser.add_option('-v', '--verbose', dest="verbosity", action='count', help='be very verbose in output', default=0) @@ -476,14 +479,21 @@ if portdir is None: myreporoot = os.path.basename(portdir_overlay) myreporoot += mydir[len(portdir_overlay):] -vcses = utilities.FindVCS() -if len(vcses) > 1: - print(red('*** Ambiguous workdir -- more than one VCS found at the same depth: %s.' % ', '.join(vcses))) - sys.exit(1) -elif vcses: - vcs = vcses[0] +if options.vcs: + if options.vcs in ('cvs', 'svn', 'git', 'bzr', 'hg'): + vcs = options.vcs + else: + vcs = None else: - vcs = None + vcses = utilities.FindVCS() + if len(vcses) > 1: + print(red('*** Ambiguous workdir -- more than one VCS found at the same depth: %s.' % ', '.join(vcses))) + print(red('*** Please either clean up your workdir or specify --vcs option.')) + sys.exit(1) + elif vcses: + vcs = vcses[0] + else: + vcs = None # Note: We don't use ChangeLogs in distributed SCMs. # It will be generated on server side from scm log, -- cgit v1.2.3-1-g7c22