1 |
commit: 6a26bdeafc4d113bb907f3accc971b61ba93d8c6 |
2 |
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jun 1 19:53:35 2016 +0000 |
4 |
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jun 1 19:55:29 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=6a26bdea |
7 |
|
8 |
repoman: Add support for .git as a file when --separate-git-dir is used bug 584786 |
9 |
|
10 |
The original test checked gor .git as a directry only. |
11 |
This code also needs to be migrated to the vcs modules if possible. |
12 |
|
13 |
repoman/pym/repoman/modules/vcs/vcs.py | 22 +++++++++++++++++----- |
14 |
1 file changed, 17 insertions(+), 5 deletions(-) |
15 |
|
16 |
diff --git a/repoman/pym/repoman/modules/vcs/vcs.py b/repoman/pym/repoman/modules/vcs/vcs.py |
17 |
index e9d45d4..b4ff3dc 100644 |
18 |
--- a/repoman/pym/repoman/modules/vcs/vcs.py |
19 |
+++ b/repoman/pym/repoman/modules/vcs/vcs.py |
20 |
@@ -9,24 +9,28 @@ from itertools import chain |
21 |
from portage import os |
22 |
|
23 |
|
24 |
-_vcs_type = collections.namedtuple('_vcs_type', 'name dir_name') |
25 |
+_vcs_type = collections.namedtuple('_vcs_type', 'name dir_name file_name') |
26 |
|
27 |
_FindVCS_data = ( |
28 |
_vcs_type( |
29 |
name='git', |
30 |
- dir_name='.git' |
31 |
+ dir_name='.git', |
32 |
+ file_name='.git' |
33 |
), |
34 |
_vcs_type( |
35 |
name='bzr', |
36 |
- dir_name='.bzr' |
37 |
+ dir_name='.bzr', |
38 |
+ file_name='' |
39 |
), |
40 |
_vcs_type( |
41 |
name='hg', |
42 |
- dir_name='.hg' |
43 |
+ dir_name='.hg', |
44 |
+ file_name='' |
45 |
), |
46 |
_vcs_type( |
47 |
name='svn', |
48 |
- dir_name='.svn' |
49 |
+ dir_name='.svn', |
50 |
+ file_name='' |
51 |
) |
52 |
) |
53 |
|
54 |
@@ -64,6 +68,14 @@ def FindVCS(cwd=None): |
55 |
'name': vcs_type.name, |
56 |
'vcs_dir': os.path.abspath(vcs_dir)}) |
57 |
retvcs.append(vcs_type.name) |
58 |
+ elif vcs_type.file_name: |
59 |
+ vcs_file = os.path.join(pathprep, vcs_type.file_name) |
60 |
+ if os.path.exists(vcs_file): |
61 |
+ logging.debug( |
62 |
+ 'FindVCS: found %(name)s file: %(vcs_file)s' % { |
63 |
+ 'name': vcs_type.name, |
64 |
+ 'vcs_file': os.path.abspath(vcs_file)}) |
65 |
+ retvcs.append(vcs_type.name) |
66 |
|
67 |
if retvcs: |
68 |
break |