Changeset: 6bef9f8f1615 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/6bef9f8f1615 Modified Files: testing/Mtest.py.in Branch: default Log Message:
It's not a problem if we're not inside an HG repository. diffs (79 lines): diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in --- a/testing/Mtest.py.in +++ b/testing/Mtest.py.in @@ -680,7 +680,7 @@ def CreateHtmlIndex (env, ssout, sserr, if TSTDIR: header = Text(TSTDIR) - if URLPREFIX: + if REV: header = Element('a', {'href': '%s%s/%s' % (URLPREFIX, url(TSTDIR), TSTSUFF), 'target': '%s_%s_body' % (DISTVER, TSTDIR), @@ -946,7 +946,7 @@ def CreateSrcIndex (env, TST, EXT) : TSTSRCDIR = env['TSTSRCDIR'] TSTDIR = env['TSTDIR'] - if URLPREFIX: + if REV: framesrc = '%s%s/%s/%s%s' % (URLPREFIX, url(TSTDIR), TSTSUFF, TST, EXT) else: f = openutf8(".%s.nosrc.index.html" % TST, "w") @@ -1000,7 +1000,7 @@ def CreateSrcIndex (env, TST, EXT) : for s in listdir(TSTSRCDIR): if s.startswith(TST): slink = Text(s) - if URLPREFIX: + if REV: slink = Element('a', {'href': '%s%s/%s/%s' % (URLPREFIX, url(TSTDIR), TSTSUFF, s), 'target': '%s_%s_%s_body' % (DISTVER, TSTDIR, TST)}, @@ -3716,26 +3716,28 @@ def main(argv) : global REV global URLPREFIX REV = opts.revision - if REV is None: # no --revision option: try to find out - try: - with process.Popen(['hg', 'id', '-i'], - stdout=process.PIPE, - text=True) as proc: - out, err = proc.communicate() - if proc.returncode == 0: - REV = out.strip() - proc = None - except KeyboardInterrupt: - raise - except: - pass - # fix up URLPREFIX - if REV: - URLPREFIX += '%s/' % REV.split()[0].rstrip('+') - os.environ['REVISION'] = REV - else: - # if no revision known, can't refer to repository - URLPREFIX = None + if produce_html and CONDITIONALS['MERCURIAL']: + if REV is None: # no --revision option: try to find out + try: + with process.Popen(['hg', 'id', '-i'], + stdout=process.PIPE, + stderr=process.PIPE, + text=True) as proc: + out, err = proc.communicate() + if proc.returncode == 0: + REV = out.strip() + proc = None + except KeyboardInterrupt: + raise + except: + pass + # fix up URLPREFIX + if REV: + URLPREFIX += '%s/' % REV.split()[0].rstrip('+') + os.environ['REVISION'] = REV + else: + # if no revision known, can't refer to repository + URLPREFIX = None global SOCK, HOST try: # try/finally to clean up sockdir _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org