hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bus...@apache.org
Subject [1/6] hbase git commit: HBASE-19098 compatibility checker should handle remotes named something other than 'origin'.
Date Thu, 26 Oct 2017 21:13:15 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 5376b5b12 -> 3c6261237
  refs/heads/branch-1.2 a546ebda1 -> 155d2966c
  refs/heads/branch-1.3 64e16da8d -> e1f537f5c
  refs/heads/branch-1.4 f6a8d5737 -> 50b7037e7
  refs/heads/branch-2 9a5ab58bc -> e1152afdd
  refs/heads/master 459202bab -> 60aa1c228


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

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


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

Branch: refs/heads/master
Commit: 60aa1c228a12550fe0ada873a0989323d5beab27
Parents: 459202b
Author: Sean Busbey <busbey@apache.org>
Authored: Thu Oct 26 14:08:09 2017 -0500
Committer: Sean Busbey <busbey@apache.org>
Committed: Thu Oct 26 16:09:17 2017 -0500

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


http://git-wip-us.apache.org/repos/asf/hbase/blob/60aa1c22/dev-support/checkcompatibility.py
----------------------------------------------------------------------
diff --git a/dev-support/checkcompatibility.py b/dev-support/checkcompatibility.py
index 1e04065..83189cf 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))
 


Mime
View raw message