You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by bu...@apache.org on 2017/10/26 21:13:17 UTC

[3/6] hbase git commit: HBASE-19098 compatibility checker should handle remotes named something other than 'origin'.

HBASE-19098 compatibility checker should handle remotes named something other than 'origin'.

Signed-off-by: Andrew Purtell <ap...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/3c626123
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/3c626123
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/3c626123

Branch: refs/heads/branch-1
Commit: 3c62612374eebb913cf7c761a2b4e8c094bfe733
Parents: 5376b5b
Author: Sean Busbey <bu...@apache.org>
Authored: Thu Oct 26 14:08:09 2017 -0500
Committer: Sean Busbey <bu...@apache.org>
Committed: Thu Oct 26 16:11:09 2017 -0500

----------------------------------------------------------------------
 dev-support/checkcompatibility.py | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/3c626123/dev-support/checkcompatibility.py
----------------------------------------------------------------------
diff --git a/dev-support/checkcompatibility.py b/dev-support/checkcompatibility.py
index 0f90207..cad17e8 100755
--- a/dev-support/checkcompatibility.py
+++ b/dev-support/checkcompatibility.py
@@ -120,9 +120,9 @@ def get_git_hash(revname):
                         cwd=get_repo_dir()).strip()
 
 
-def get_repo_name():
+def get_repo_name(remote_name="origin"):
     """ Get the name of the repo based on the git remote."""
-    remote = check_output(["git", "config", "--get", "remote.origin.url"],
+    remote = check_output(["git", "config", "--get", "remote.{0}.url".format(remote_name)],
                            cwd=get_repo_dir()).strip()
     remote = remote.split("/")[-1]
     return remote[:-4] if remote.endswith(".git") else remote
@@ -262,7 +262,7 @@ def process_java_acc_output(output):
     return return_value
 
 
-def run_java_acc(src_name, src_jars, dst_name, dst_jars, annotations, skip_annotations):
+def run_java_acc(src_name, src_jars, dst_name, dst_jars, annotations, skip_annotations, name):
     """ Run the compliance checker to compare 'src' and 'dst'. """
     logging.info("Will check compatibility between original jars:\n\t%s\n"
                  "and new jars:\n\t%s",
@@ -280,7 +280,7 @@ def run_java_acc(src_name, src_jars, dst_name, dst_jars, annotations, skip_annot
     out_path = os.path.join(get_scratch_dir(), "report.html")
 
     args = ["perl", java_acc_path,
-            "-l", get_repo_name(),
+            "-l", name,
             "-d1", src_xml_path,
             "-d2", dst_xml_path,
             "-report-path", out_path]
@@ -424,6 +424,9 @@ def main():
     parser.add_argument("--verbose",
                         action="store_true",
                         help="more output")
+    parser.add_argument("-r", "--remote", default="origin", dest="remote_name",
+                        help="Name of remote to use. e.g. its repo name will be used as the name "
+                        "we pass to Java ACC for the library.")
     parser.add_argument("src_rev", nargs=1, help="Source revision.")
     parser.add_argument("dst_rev", nargs="?", default="HEAD",
                         help="Destination revision. "
@@ -505,7 +508,8 @@ def main():
         sys.exit(1)
 
     output = run_java_acc(src_rev, src_jars, dst_rev,
-                            dst_jars, args.annotations, skip_annotations)
+                            dst_jars, args.annotations, skip_annotations,
+                            get_repo_name(args.remote_name))
     sys.exit(compare_results(output, known_problems,
                               args.compare_warnings))