You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ks...@apache.org on 2020/04/20 19:22:02 UTC

[arrow] 20/28: ARROW-8507: [Release] Detect .git directory automatically in changelog.py

This is an automated email from the ASF dual-hosted git repository.

kszucs pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git

commit acc7d4cbd550d270c29e0a34110729b5f05cdeca
Author: Sutou Kouhei <ko...@clear-code.com>
AuthorDate: Mon Apr 20 05:42:15 2020 +0900

    ARROW-8507: [Release] Detect .git directory automatically in changelog.py
    
    Closes #6975 from kou/release-changelog-detect-arrow-root
    
    Authored-by: Sutou Kouhei <ko...@clear-code.com>
    Signed-off-by: Sutou Kouhei <ko...@clear-code.com>
---
 dev/release/changelog.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dev/release/changelog.py b/dev/release/changelog.py
index 052b85d..4e85e46 100755
--- a/dev/release/changelog.py
+++ b/dev/release/changelog.py
@@ -47,9 +47,9 @@ asf_jira = jira.client.JIRA(options={'server': JIRA_API_BASE},
 locale.setlocale(locale.LC_ALL, 'en_US.utf-8')
 
 
-if 'ARROW_ROOT' not in os.environ:
-    raise Exception("Please set $ARROW_ROOT to the location of your "
-                    "Arrow git clone")
+release_dir = os.path.realpath(os.path.dirname(__file__))
+ARROW_ROOT_DEFAULT = os.path.join(release_dir, '..', '..')
+ARROW_ROOT = os.environ.get("ARROW_ROOT", ARROW_ROOT_DEFAULT)
 
 
 def get_issues_for_version(version):
@@ -91,7 +91,7 @@ def get_jiras_from_git_changelog(current_version):
     last_major_version = get_last_major_version(current_version)
 
     # Path to .git directory
-    git_dir = os.path.join(os.environ['ARROW_ROOT'], '.git')
+    git_dir = os.path.join(ARROW_ROOT, '.git')
 
     cmd = ['git', '--git-dir', git_dir, 'log', '--pretty=format:%s',
            'apache-arrow-{}..apache-arrow-{}'.format(last_major_version,