summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <gentoo@mgorny.alt.pl>2010-07-11 11:50:02 +0200
committerZac Medico <zmedico@gentoo.org>2010-07-11 11:25:56 -0700
commit49e3e6196c243ba1995ec1000b51ccee768493a4 (patch)
treea2bca3f06dcf9a7a28dd6afcd352a93179e2041b /bin/repoman
parentemerge --info: show package names for providing packages (diff)
downloadportage-multirepo-49e3e6196c243ba1995ec1000b51ccee768493a4.tar.gz
portage-multirepo-49e3e6196c243ba1995ec1000b51ccee768493a4.tar.bz2
portage-multirepo-49e3e6196c243ba1995ec1000b51ccee768493a4.zip
Rewrite VCS detection code in repoman.
Move the real code into repoman.utilities. Support any repository depth for distributed SCMs -- i.e. Sunrise through git-svn. Bail out if more than one control version directory is found at the same depth.
Diffstat (limited to 'bin/repoman')
-rwxr-xr-xbin/repoman19
1 files changed, 8 insertions, 11 deletions
diff --git a/bin/repoman b/bin/repoman
index 324ad2ea..8ded3475 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -476,17 +476,14 @@ if portdir is None:
myreporoot = os.path.basename(portdir_overlay)
myreporoot += mydir[len(portdir_overlay):]
-vcs = None
-if os.path.isdir("CVS"):
- vcs = "cvs"
-if os.path.isdir(".svn"):
- vcs = "svn"
-elif os.path.isdir(os.path.join(portdir_overlay, ".git")):
- vcs = "git"
-elif os.path.isdir(os.path.join(portdir_overlay, ".bzr")):
- vcs = "bzr"
-elif os.path.isdir(os.path.join(portdir_overlay, ".hg")):
- vcs = "hg"
+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]
+else:
+ vcs = None
# Note: We don't use ChangeLogs in distributed SCMs.
# It will be generated on server side from scm log,