Skip to content

Commit

Permalink
[GR-27301] Support for --branch and --quiet in sclone.
Browse files Browse the repository at this point in the history
PullRequest: mx/1574
  • Loading branch information
ntemmar committed Mar 7, 2023
2 parents 9a0cdd6 + 375eccf commit 2b36bae
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions mx.py
Original file line number Diff line number Diff line change
Expand Up @@ -10261,6 +10261,8 @@ def _locked_cmd(self, repo, cmd, read_lock=False):
def _clone(self, url, dest=None, branch=None, rev=None, abortOnError=True, **extra_args):
hashed_url = hashlib.sha1(url.encode()).hexdigest()
cmd = ['git', 'clone']
if extra_args.get('quiet'):
cmd += ['--quiet']
if rev and self.object_cache_mode == 'refcache' and GitConfig._is_hash(rev):
cache = self._local_cache_repo()
if not self.exists(cache, rev):
Expand Down Expand Up @@ -16805,7 +16807,8 @@ def sclone(args):
parser.add_argument('--source', help='url/path of repo containing suite', metavar='<url>')
parser.add_argument('--subdir', help='sub-directory containing the suite in the repository (suite name)')
parser.add_argument('--dest', help='destination directory (default basename of source)', metavar='<path>')
parser.add_argument('--revision', help='revision to checkout')
parser.add_argument('--revision', '--branch', '-b', help='revision to checkout')
parser.add_argument('--quiet', '-q', action='store_true', help='operate quietly (only for git clone).')
parser.add_argument("--no-imports", action='store_true', help='do not clone imported suites')
parser.add_argument("--kind", help='vc kind for URL suites', default='hg')
parser.add_argument('--ignore-version', action='store_true', help='ignore version mismatch for existing suites')
Expand Down Expand Up @@ -16850,7 +16853,7 @@ def sclone(args):
dest_dir = join(dest, args.subdir) if args.subdir else dest
source = mx_urlrewrites.rewriteurl(source)
vc = vc_system(args.kind)
vc.clone(source, rev=revision, dest=dest)
vc.clone(source, rev=revision, dest=dest, quiet=args.quiet)
mxDir = _is_suite_dir(dest_dir)
if not mxDir:
warn(f"'{dest_dir}' is not an mx suite")
Expand Down Expand Up @@ -18371,7 +18374,7 @@ def alarm_handler(signum, frame):
abort(1, killsig=signal.SIGINT)

# The version must be updated for every PR (checked in CI) and the comment should reflect the PR's issue
version = VersionSpec("6.16.3") # GR-44614 better support for module-info.java
version = VersionSpec("6.16.4") # GR-27301 support for --branch and --quiet in sclone

currentUmask = None
_mx_start_datetime = datetime.utcnow()
Expand Down

0 comments on commit 2b36bae

Please sign in to comment.