306 parser.error('--with-hg must specify an executable hg script') |
306 parser.error('--with-hg must specify an executable hg script') |
307 if not os.path.basename(options.with_hg) == b'hg': |
307 if not os.path.basename(options.with_hg) == b'hg': |
308 sys.stderr.write('warning: --with-hg should specify an hg script\n') |
308 sys.stderr.write('warning: --with-hg should specify an hg script\n') |
309 if options.local: |
309 if options.local: |
310 testdir = os.path.dirname(_bytespath(canonpath(sys.argv[0]))) |
310 testdir = os.path.dirname(_bytespath(canonpath(sys.argv[0]))) |
311 hgbin = os.path.join(os.path.dirname(testdir), b'hg') |
311 reporootdir = os.path.dirname(testdir) |
312 if os.name != 'nt' and not os.access(hgbin, os.X_OK): |
312 pathandattrs = [(b'hg', 'with_hg')] |
313 parser.error('--local specified, but %r not found or not executable' |
313 for relpath, attr in pathandattrs: |
314 % hgbin) |
314 binpath = os.path.join(reporootdir, relpath) |
315 options.with_hg = hgbin |
315 if os.name != 'nt' and not os.access(binpath, os.X_OK): |
|
316 parser.error('--local specified, but %r not found or ' |
|
317 'not executable' % binpath) |
|
318 setattr(options, attr, binpath) |
316 |
319 |
317 if (options.chg or options.with_chg) and os.name == 'nt': |
320 if (options.chg or options.with_chg) and os.name == 'nt': |
318 parser.error('chg does not work on %s' % os.name) |
321 parser.error('chg does not work on %s' % os.name) |
319 if options.with_chg: |
322 if options.with_chg: |
320 options.chg = False # no installation to temporary location |
323 options.chg = False # no installation to temporary location |