Mercurial > hg
view tests/heredoctest.py @ 25126:00e4c5601c74
test: test both bundle1 and bundle2 paths in 'test-push-hook-lock.t'
The locking scheme is a bit different in each cases. So we explicitly test each
case.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Sun, 10 May 2015 03:06:00 -0700 |
parents | 1db2127d2373 |
children | 4179d054b3e9 |
line wrap: on
line source
import sys globalvars = {} lines = sys.stdin.readlines() while lines: l = lines.pop(0) if l.startswith('SALT'): print(l[:-1]) elif l.startswith('>>> '): snippet = l[4:] while lines and lines[0].startswith('... '): l = lines.pop(0) snippet += l[4:] c = compile(snippet, '<heredoc>', 'single') try: exec(c, globalvars) except Exception as inst: print(repr(inst))