You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by fs...@apache.org on 2019/06/28 19:37:19 UTC
[arrow] branch master updated: ARROW-5781: [Archery] Ensure
benchmark clone accepts remote in revision
This is an automated email from the ASF dual-hosted git repository.
fsaintjacques pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/master by this push:
new db5379f ARROW-5781: [Archery] Ensure benchmark clone accepts remote in revision
db5379f is described below
commit db5379fd50f506b811bbd2fed1320b66ae9657cc
Author: François Saint-Jacques <fs...@gmail.com>
AuthorDate: Fri Jun 28 15:37:10 2019 -0400
ARROW-5781: [Archery] Ensure benchmark clone accepts remote in revision
A user can pass a revision that references a remote, e.g. `origin/master`. The notion of `origin` and any remotes, should be resolved in the source repository and not the fresh clone.
Author: François Saint-Jacques <fs...@gmail.com>
Closes #4741 from fsaintjacques/ARROW-5781-archery-clone-rev and squashes the following commits:
42458d2f4 <François Saint-Jacques> ARROW-5781: Ensure benchmark clone accepts remote in revision
---
dev/archery/archery/benchmark/runner.py | 5 ++++-
dev/archery/archery/utils/git.py | 2 +-
dev/archery/archery/utils/source.py | 8 +++++++-
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/dev/archery/archery/benchmark/runner.py b/dev/archery/archery/benchmark/runner.py
index 5cee778..46aa966 100644
--- a/dev/archery/archery/benchmark/runner.py
+++ b/dev/archery/archery/benchmark/runner.py
@@ -66,7 +66,10 @@ class BenchmarkRunner:
build = CMakeBuild.from_path(rev_or_path)
return CppBenchmarkRunner(build, **kwargs)
else:
- root_rev = os.path.join(root, rev_or_path)
+ # Revisions can references remote via the `/` character, ensure
+ # that the revision is path friendly
+ path_rev = rev_or_path.replace("/", "_")
+ root_rev = os.path.join(root, path_rev)
os.mkdir(root_rev)
clone_dir = os.path.join(root_rev, "arrow")
diff --git a/dev/archery/archery/utils/git.py b/dev/archery/archery/utils/git.py
index c611352..a9d69a4 100644
--- a/dev/archery/archery/utils/git.py
+++ b/dev/archery/archery/utils/git.py
@@ -55,9 +55,9 @@ class Git(Command):
def log(self, *argv, **kwargs):
return self.run_cmd(*argv, **kwargs)
+ @capture_stdout(strip=True)
@git_cmd
def rev_parse(self, *argv, **kwargs):
- print(self.head())
return self.run_cmd(*argv, **kwargs)
@capture_stdout(strip=True)
diff --git a/dev/archery/archery/utils/source.py b/dev/archery/archery/utils/source.py
index 12dc735..7189c68 100644
--- a/dev/archery/archery/utils/source.py
+++ b/dev/archery/archery/utils/source.py
@@ -87,7 +87,13 @@ class ArrowSources:
# that builds depending on said sources are not invalidated (or worse
# slightly affected when re-invoking the generator).
git.clone("--local", self.path, clone_dir)
- git.checkout(revision, git_dir=clone_dir)
+
+ # Revision can reference "origin/" (or any remotes) that are not found
+ # in the local clone. Thus, revisions are dereferenced in the source
+ # repository.
+ original_revision = git.rev_parse(revision)
+
+ git.checkout(original_revision, git_dir=clone_dir)
return ArrowSources(clone_dir), True