1 |
On 11/08/2015 11:24 PM, Michał Górny wrote: |
2 |
> Allow generating ChangeLogs from external git checkout via using |
3 |
> GIT_DIR, rather than requiring the repository to be git. |
4 |
> --- |
5 |
> bin/egencache | 4 +--- |
6 |
> 1 file changed, 1 insertion(+), 3 deletions(-) |
7 |
> |
8 |
> diff --git a/bin/egencache b/bin/egencache |
9 |
> index 51d115a..eeca255 100755 |
10 |
> --- a/bin/egencache |
11 |
> +++ b/bin/egencache |
12 |
> @@ -73,8 +73,6 @@ else: |
13 |
> else: |
14 |
> from repoman.metadata import parse_metadata_use |
15 |
> |
16 |
> -from repoman.vcs.vcs import FindVCS |
17 |
> - |
18 |
> if sys.hexversion >= 0x3000000: |
19 |
> # pylint: disable=W0622 |
20 |
> long = int |
21 |
> @@ -886,7 +884,7 @@ class GenChangeLogs(object): |
22 |
> repo_path = self._portdb.porttrees[0] |
23 |
> os.chdir(repo_path) |
24 |
> |
25 |
> - if 'git' not in FindVCS(): |
26 |
> + if not os.path.isdir(os.environ.get('GIT_DIR', '.git')): |
27 |
> writemsg_level( |
28 |
> "ERROR: --update-changelogs supported only in git repos\n", |
29 |
> level=logging.ERROR, noiselevel=-1) |
30 |
> |
31 |
|
32 |
Since this code runs inside of a generator method now, it would be much |
33 |
nicer to avoid the chdir call, and instead do something like this: |
34 |
|
35 |
if not os.path.isdir( |
36 |
os.environ.get('GIT_DIR', os.path.join(repo_path, '.git'))): |
37 |
-- |
38 |
Thanks, |
39 |
Zac |