summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Górny <gentoo@mgorny.alt.pl>2010-07-11 12:03:17 +0200
committerZac Medico <zmedico@gentoo.org>2010-07-11 11:25:56 -0700
commitd277d60e8b0aa4c7146444cc47ca2e410417a5f0 (patch)
treedb693cbe8614a3b3ee1205ceae514ffbd2ea2102
parent49e3e6196c243ba1995ec1000b51ccee768493a4 (diff)
downloadportage-d277d60e8b0aa4c7146444cc47ca2e410417a5f0.tar.gz
portage-d277d60e8b0aa4c7146444cc47ca2e410417a5f0.tar.bz2
portage-d277d60e8b0aa4c7146444cc47ca2e410417a5f0.zip
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).
-rwxr-xr-xbin/repoman24
1 files changed, 17 insertions, 7 deletions
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,