public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: repoman/pym/repoman/modules/vcs/
@ 2016-06-01 19:57 Brian Dolbec
  0 siblings, 0 replies; only message in thread
From: Brian Dolbec @ 2016-06-01 19:57 UTC (permalink / raw
  To: gentoo-commits

commit:     6a26bdeafc4d113bb907f3accc971b61ba93d8c6
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  1 19:53:35 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed Jun  1 19:55:29 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=6a26bdea

repoman: Add support for .git as a file when --separate-git-dir is used bug 584786

The original test checked gor .git as a directry only.
This code also needs to be migrated to the vcs modules if possible.

 repoman/pym/repoman/modules/vcs/vcs.py | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/repoman/pym/repoman/modules/vcs/vcs.py b/repoman/pym/repoman/modules/vcs/vcs.py
index e9d45d4..b4ff3dc 100644
--- a/repoman/pym/repoman/modules/vcs/vcs.py
+++ b/repoman/pym/repoman/modules/vcs/vcs.py
@@ -9,24 +9,28 @@ from itertools import chain
 from portage import os
 
 
-_vcs_type = collections.namedtuple('_vcs_type', 'name dir_name')
+_vcs_type = collections.namedtuple('_vcs_type', 'name dir_name file_name')
 
 _FindVCS_data = (
 	_vcs_type(
 		name='git',
-		dir_name='.git'
+		dir_name='.git',
+		file_name='.git'
 	),
 	_vcs_type(
 		name='bzr',
-		dir_name='.bzr'
+		dir_name='.bzr',
+		file_name=''
 	),
 	_vcs_type(
 		name='hg',
-		dir_name='.hg'
+		dir_name='.hg',
+		file_name=''
 	),
 	_vcs_type(
 		name='svn',
-		dir_name='.svn'
+		dir_name='.svn',
+		file_name=''
 	)
 )
 
@@ -64,6 +68,14 @@ def FindVCS(cwd=None):
 							'name': vcs_type.name,
 							'vcs_dir': os.path.abspath(vcs_dir)})
 					retvcs.append(vcs_type.name)
+				elif vcs_type.file_name:
+					vcs_file = os.path.join(pathprep, vcs_type.file_name)
+					if os.path.exists(vcs_file):
+						logging.debug(
+							'FindVCS: found %(name)s file: %(vcs_file)s' % {
+								'name': vcs_type.name,
+								'vcs_file': os.path.abspath(vcs_file)})
+						retvcs.append(vcs_type.name)
 
 			if retvcs:
 				break


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-06-01 19:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-01 19:57 [gentoo-commits] proj/portage:master commit in: repoman/pym/repoman/modules/vcs/ Brian Dolbec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox